Open davidferlay opened 9 months ago
doesn't look doable
launchr is based on cobra commands and they don't support --help for arguments https://github.com/spf13/cobra/issues/571 maximum we can add right now is sorta validation function with more description
like
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
var comps []string
if len(args) == 0 {
comps = cobra.AppendActiveHelp(comps, "You must choose a name for the repo you are adding")
} else if len(args) == 1 {
comps = cobra.AppendActiveHelp(comps, "You must specify the URL for the repo you are adding")
} else {
comps = cobra.AppendActiveHelp(comps, "This command does not take any more arguments")
}
return comps, cobra.ShellCompDirectiveNoFileComp
},
We may implement through custom templates. I had some plans for it. Come to me for details.
Why not contribute it to cobra istead ?
Context
Observed
options
are described in--help
(see--override
) but arguments are not -username
,password
)Flags: -h, --help help for platform:compare-artifact --overriden_comparison_ref string Overriden comparison reference (branch or tag name)
Global Flags: --keyring-passphrase string Passphrase for keyring encryption/decryption -q, --quiet disable stdOut -v, --verbose count log verbosity level, use -vvv DEBUG, -vv WARN, -v INFO