In #485, @stevemar, @ctreatma, and I discussed that while the precedent in metal-cli is for bool's to have --name=<true|false>, there is at least one exception with --app vs --sms for TFA.
We also discussed that in places where --name=false is used, we may not be handling it properly, where false values must be explicitly sent in API calls. These parameters are confusing to specify, and with Cobra, it is easy to miss incorrect handling during code review.
Metal CLI should adopt more obvious patterns for bools, such as named pairs (lock, unlock) or --no- prefixes.
It would be great to get these improvements from upstream project(s), but it can be implemented locally:
Originally posted by @displague in #485 (comment)
In #485, @stevemar, @ctreatma, and I discussed that while the precedent in
metal-cliis for bool's to have--name=<true|false>, there is at least one exception with--appvs--smsfor TFA.We also discussed that in places where
--name=falseis used, we may not be handling it properly, where false values must be explicitly sent in API calls. These parameters are confusing to specify, and with Cobra, it is easy to miss incorrect handling during code review.Metal CLI should adopt more obvious patterns for bools, such as named pairs (
lock,unlock) or--no-prefixes.It would be great to get these improvements from upstream project(s), but it can be implemented locally:
no-prefix spf13/cobra#958NoOptDefVal, no--foo=truesyntax. spf13/pflag#214Originally posted by @displague in #485 (comment)