-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
R4R: add command to generate bash completion for gaia{d,cli} #3334
Conversation
13dc995
to
12da155
Compare
Is it possible to also generate |
Codecov Report
@@ Coverage Diff @@
## develop #3334 +/- ##
========================================
Coverage 55.63% 55.63%
========================================
Files 132 132
Lines 9559 9559
========================================
Hits 5318 5318
Misses 3905 3905
Partials 336 336 |
@cwgoes done |
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.
Commands work fine.
My zsh has some odd configuration so this should also be tested by someone with bash.
f815dd7
to
c75ac72
Compare
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.
missing docs update
@fedekunze done |
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.
LGTM
docs/gaia/gaiacli.md
Outdated
gaiacli completion --zsh > gaiacli_completion | ||
``` | ||
|
||
Refer to the user's manual of your interpreter for information |
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.
While this is admirable, maybe we provide short examples of how to link it in your bash
and zsh
profiles?
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.
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.
server/util.go
Outdated
@@ -233,6 +233,38 @@ func UpgradeOldPrivValFile(config *cfg.Config) { | |||
} | |||
} | |||
|
|||
// NewCompletionCmd builds a cobra.Command that generate bash completion |
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.
Maybe this wants to live somewhere in the client
folder? We need to do some thinking on CLI code organization.
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.
done
Was able to get this working by saving the files as suggested and inserting them in my # Load gaiad and gaiacli completions
[[ -s "$HOME/.dotfiles/gaiad.bash" ]] && source $HOME/.dotfiles/gaiad.bash
[[ -s "$HOME/.dotfiles/gaiacli.bash" ]] && source $HOME/.dotfiles/gaiacli.bash |
Should we add this to docs? 👍 |
I'd strongly prefer avoiding explaining in detail or w/ examples where users should drop their interpreters config files - we would risk to make th |
@alessio point well taken. This looks great. |
docs/
)PENDING.md
with issue #Files changed
in the github PR explorerFor Admin Use: