Closed krucod3 closed 1 day ago
I think the only command that is affected by this would be ank set state
, or?
Currently working on this.
Shifted to 0.5 due to lack of time.
@krucod3, @windsource: I have noticed that we are now having two required positional arguments instead of one for set state after reviewing the PR. One or more object field masks and a new state file.
Previously, the new state file was an optional argument allowing a user to do the following: Executing ank set state desiredState
without specifying a new state file and it deletes all workloads.
With the current changes in #340, the new state file is a required positional argument and is not optional anymore. Meaning the Option
as internal type for the cli argument is useless (and the conditional checks on this type as well).
Secondly, with this change the usability has increased in the success case (no -f and similar to other ank commands), but it has decreased when the user does something wrong with the arguments.
This is because, before this change it was allowed to swap the arguments since the state file arg was a named argument.
Now, if a user accidentally swaps the arguments, then it tries to open the file on a field mask because the last argument is always treated as a file since it is now an positional argument:
When we improve the error messages in the CLI this challenge comes back to us for the set state command.
Like discussed with @windsource, we bring the new changes to main.
@krucod3
Now, the ank CLI is unified and ank set state
is being called in the same manner as ank apply
.
All done here, thx @HorjuRares
Description
Before the
ank apply
subcommand (#26) was implemented, all commands required a-f
flag for reading files provided at the command line. The newapply
subcommand takes a different approach there to improve usability.To not make the usage of the ank CLI confusing, we should take care that the CLI behaves the same for all subcommands and change the old ones to use the new approach.
Goals
Unify the arguments taken by all ank subcommands to make the usage of the CLI easier and clearer.
Final result
Now, the ank CLI is unified and
ank set state
is being called in the same manner asank apply
.Tasks