Add dynamic flag completions to CLI #14691
Labels
Improvement
Improve to current situation
Jira
Triggers the synchronization of a GitHub issue in Jira
Milestone
Cobra provides support for dynamic flag completions. We can add dynamic completions for flags such as
--project
,--config
,--mode
, etc.For example,
lxc init images:alpine/edge c1 -s default --project [TAB]
should complete available projects.We can also mark flags as required for completions, specify valid file extensions for file completions (e.g.
yaml
for profiles), and limit flag completions to valid directory names (e.g.lxc file push|pull
).The text was updated successfully, but these errors were encountered: