-
Notifications
You must be signed in to change notification settings - Fork 282
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
Add shell completions by shtab #131
Conversation
Freed-Wu
commented
Aug 28, 2022
I fixed the conflict. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I think the feature works nice but there are some corner cases.
Another corner case: if we execute gpustat as |
Fixed. 😄 parser = argparse.ArgumentParser(prog='gpustat') |
Any other problems? It still displays |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you. I will merge it soon and write docs for this.
Example: gpustat --print-completion bash | sudo tee /usr/share/bash-completion/completions/gpustat gpustat --print-completion tcsh | sudo tee /etc/profile.d/gpustat.completion.csh gpustat --print-completion zsh | sudo tee /usr/share/zsh/site-functions/_gpustat
I have rebased your commit due to conflicts. Let me add some minor touches. |
Good. When can it be accepted? |
@Freed-Wu Thank you for your contribution! |
For those who do not have root privileges, you can do like
and add |