Skip to content

Add filter commandline parameter #2643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

NovemberZulu
Copy link

Summary

This PR adds -f/--filter commandline parameter that sets default filter

Testing

Manual tests, unit tests

@vmingchen
Copy link

Thanks for proposing this PR! This is a missing feature I am looking forward to. It would be nice to have it because otherwise I have to manually type in the filter each time I enter k9s.

However, I tried this PR with ./k9s -n mork -f '-l service=MY_SERVICE' it does not show the filtered view when I entered the interface. Am I doing something wrong?

FWIW, when I type '/', I see -l service=MY_SERVICE in the filter history which saves me from typing.

@NovemberZulu
Copy link
Author

@vmingchen I haven't tested -l a=b initially. I pushed a new, hopefully less hacky, approach. It support both filter and -l a=b filters. I'll try to make codebeat happy,

@derailed derailed added the enhancement New feature or request label Aug 29, 2024
@NovemberZulu
Copy link
Author

OK, codebeat is happy now. It feels like whack-a-mole, ngl. All in all, I am not sure that the current version is actually btter than 8207681.
@derailed Could you please advise? 🙏

@vmingchen
Copy link

Great! The '-l' filter is working for me now. Thanks a lot for the fix!

@github-actions github-actions bot added the stale label Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants