-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
bash completion #58
base: main
Are you sure you want to change the base?
bash completion #58
Conversation
bc3db30
to
db9077f
Compare
db9077f
to
d3cd2c2
Compare
b2e1059
to
2e49f41
Compare
2e49f41
to
f725244
Compare
c42d470
to
6d815ef
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.
Some small fixes.
To create the completions, use a sub-command instead of a flag:
uenv completion bash
This fits the uenv <verb> <options>
model. Flags like --verbose
or --color
are optional information that influence actions.
}; | ||
|
||
struct global_settings { | ||
using enum cli_mode; | ||
|
||
int verbose = 0; | ||
cli_mode mode = unset; | ||
CLI::App* cli; |
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.
@bcumming I added this because I need a starting point to generate the completion script. Do you know how to get the pointer to CLI::App without adding it to the global_settings?
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.
I left a comment in src/cli/completion.h
with a suggestion for where to keep this information.
void completion_help(); | ||
|
||
struct completion_args { | ||
std::string shell_description; |
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.
Store the CLI::App*
in this type, and add a constructor ftakes the CLI::App*
as an argument, instead of storing it in the main settings.
}; | ||
|
||
struct global_settings { | ||
using enum cli_mode; | ||
|
||
int verbose = 0; | ||
cli_mode mode = unset; | ||
CLI::App* cli; |
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.
I left a comment in src/cli/completion.h
with a suggestion for where to keep this information.
No description provided.