You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Option -v is currently working only when specified directly after g2a command. Since usually -v parameter is added when users try to run command again in order to debug why it failed, it's really convieniet to add it on the very end of the line. The problem is, when -v is specified after name of subcommand, we cannot reliably parse it and remove it from parameters passed down to sub-command. To illustrate the issue, take a look for these examples:
g2a cmd -v – is -v verbosity parameter or some other parameter used by cmd command?
g2a cmd -vv – is -vvv a -v parameter specified 2 times, or -v parameter with v value?
g2a cmd -xv – is -xv two parameters, or single -x parameter with v value?
g2a cmd --param -v – is -v a parameter or a value of --param parameter?
It's impossible to mitigate all these issues without knowing exact structure of the sub-command's parameters, but we can try to reduce their impact by applying following rules:
If -v is specified after command name, pass it with the rest of parameters to this command (do not intercept it).
Parse only standalone occurences like -vv and --verbose, paramenters like -xv have to be ignored.
Behaviour of other global parameters (like --log-level) shouldn't be changed (they should be parsed only if specified before command name).
Since it will cause errors on commands wich doesn't accept unknown parameters, this change must apply only to commands using API newer than "g2a-cli/v1beta1".
The text was updated successfully, but these errors were encountered:
Option
-v
is currently working only when specified directly afterg2a
command. Since usually-v
parameter is added when users try to run command again in order to debug why it failed, it's really convieniet to add it on the very end of the line. The problem is, when-v
is specified after name of subcommand, we cannot reliably parse it and remove it from parameters passed down to sub-command. To illustrate the issue, take a look for these examples:g2a cmd -v
– is-v
verbosity parameter or some other parameter used bycmd
command?g2a cmd -vv
– is-vvv
a-v
parameter specified 2 times, or-v
parameter withv
value?g2a cmd -xv
– is-xv
two parameters, or single-x
parameter withv
value?g2a cmd --param -v
– is-v
a parameter or a value of--param
parameter?It's impossible to mitigate all these issues without knowing exact structure of the sub-command's parameters, but we can try to reduce their impact by applying following rules:
-v
is specified after command name, pass it with the rest of parameters to this command (do not intercept it).-vv
and--verbose
, paramenters like-xv
have to be ignored.--log-level
) shouldn't be changed (they should be parsed only if specified before command name).Since it will cause errors on commands wich doesn't accept unknown parameters, this change must apply only to commands using API newer than "g2a-cli/v1beta1".
The text was updated successfully, but these errors were encountered: