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

feat: allow auto-completing context flag #861

Merged
merged 1 commit into from
Sep 12, 2024
Merged

Conversation

phm07
Copy link
Contributor

@phm07 phm07 commented Sep 6, 2024

See #853 for more information. Closes #853

@phm07 phm07 added the feature label Sep 6, 2024
@phm07 phm07 self-assigned this Sep 6, 2024
@phm07 phm07 requested a review from a team as a code owner September 6, 2024 10:04
Copy link

codecov bot commented Sep 6, 2024

Codecov Report

Attention: Patch coverage is 52.63158% with 9 lines in your changes missing coverage. Please review.

Project coverage is 61.48%. Comparing base (b59cfbf) to head (fa07c8d).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
internal/state/config/options.go 45.45% 6 Missing ⚠️
internal/cli/root.go 62.50% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #861      +/-   ##
==========================================
- Coverage   61.49%   61.48%   -0.01%     
==========================================
  Files         238      238              
  Lines        8522     8538      +16     
==========================================
+ Hits         5241     5250       +9     
- Misses       2572     2576       +4     
- Partials      709      712       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

)

OptionContext = newOpt(
"context",
"Currently active context",
"",
OptionFlagConfig|OptionFlagEnv|OptionFlagPFlag,
func(_ hcapi2.Client, cfg Config, _ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) {
ctxs := cfg.Contexts()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤡 Does this consider the --config flag?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it does 😄

@apricote apricote self-requested a review September 12, 2024 08:12
@phm07 phm07 merged commit 7495b14 into main Sep 12, 2024
5 checks passed
@phm07 phm07 deleted the context-auto-completions branch September 12, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix: --context value is not auto completed
2 participants