UpCloudLtd / upcloud-cli

UpCloud command line client (upctl)
https://upcloudltd.github.io/upcloud-cli/
MIT License
29 stars 7 forks source link

feat(completion): use cobras default completion command #204

Closed kangasta closed 1 year ago

kangasta commented 1 year ago

This requires removing whitespace from completions as cobras bash completions do not support values with whitespace (See https://github.com/spf13/cobra/issues/1740). This is done by replacing whitespace with non-breaking spaces during completion generation. The argument resolvers with values that can include whitespace are also updated to handle both modified and original arguments, i.e. user can still input whitespaces normally when argument is quoted or escaped.

kangasta commented 1 year ago

I know this is quite hacky, but so is our current bash completion override which prevents us from supporting zsh (#134) and other shell completions.

kangasta commented 1 year ago

The linting error seems to come from generics usage in node group parameters parsing, I'll try to see if there a route around that