Skip to content
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 dynamic flag completions to CLI #14691

Closed
4 tasks done
kadinsayani opened this issue Dec 18, 2024 · 1 comment · Fixed by #14758
Closed
4 tasks done

Add dynamic flag completions to CLI #14691

kadinsayani opened this issue Dec 18, 2024 · 1 comment · Fixed by #14758
Assignees
Labels
Improvement Improve to current situation Jira Triggers the synchronization of a GitHub issue in Jira
Milestone

Comments

@kadinsayani
Copy link
Contributor

kadinsayani commented Dec 18, 2024

Cobra provides support for dynamic flag completions. We can add dynamic completions for flags such as --project, --profile, --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).

  • --project completions
  • --mode completions
  • --profile completions
  • lxc file push|pull improved completions
@kadinsayani kadinsayani added the Improvement Improve to current situation label Dec 18, 2024
@kadinsayani kadinsayani added this to the later milestone Dec 18, 2024
@kadinsayani kadinsayani changed the title Add dynamic flag completion to CLI Add dynamic flag completions to CLI Dec 18, 2024
@kadinsayani kadinsayani self-assigned this Dec 18, 2024
@kadinsayani kadinsayani added the Jira Triggers the synchronization of a GitHub issue in Jira label Dec 18, 2024
@kadinsayani
Copy link
Contributor Author

Improved lxc file push|pull completions introduced with #14749.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Improve to current situation Jira Triggers the synchronization of a GitHub issue in Jira
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant