ko icon indicating copy to clipboard operation
ko copied to clipboard

Use Cobra flag helpers for better shell completion

Open imjasonh opened this issue 2 years ago • 6 comments

Cobra has a helper methods which can make shell completion a little nicer:

  • MarkFlagFilename tells Cobra that the flag represents a filename. This tells the ko completion logic to generate helpers to match filenames. (e.g., ko apply -f <tab>)
  • MarkFlagRequired tells Cobra that the flag is required, and prioritizes in completion if it's unset (e.g., ko apply <tab> prioritizes -f over --preserve-import-paths).

Audit flags we configure and see if there are any that would benefit from being marked this way. Check that the expected behavior is actually observed when shell completion is configured.

imjasonh avatar Dec 14 '21 14:12 imjasonh

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Keep fresh with the 'lifecycle/frozen' label.

github-actions[bot] avatar Mar 15 '22 01:03 github-actions[bot]

I still want this.

imjasonh avatar Mar 16 '22 15:03 imjasonh

Hello @imjasonh , is this issue still available? I would love to work on it

MohabMohamed avatar May 09 '22 09:05 MohabMohamed

Hello @imjasonh , is this issue still available? I would love to work on it

Go for it! Let me know if you have any questions, I'd be happy to help.

And thanks!

imjasonh avatar May 09 '22 14:05 imjasonh

Thank you

MohabMohamed avatar May 10 '22 09:05 MohabMohamed

@imjasonh I made the required change in PR #705, but are there any flags other than -f that need to be required? as I didn't use ko before.

MohabMohamed avatar May 16 '22 09:05 MohabMohamed