Refactor argument layers
I had this idea for a long time but explained it first in this comment: !44 (comment 47750).
Gcli has some strange way of passing arguments:
sometimes we use global arg:
# using global arg:
gcli -a 5Grw...utQY account balance
# instead of local:
gcli account balance -a 5Grw...utQY
but sometimes we use only local arg:
# using local arg only:
gcli identity get -a 5Grw...utQY
# the command with global arg is different:
gcli -a 5Grw...utQY identity show
We have to rethink the way we pass args to gcli to follow uniform rules like for example:
- allow local arguments which make sense for subcommand which are context-free and easier to understand
- when no local argument is given, fallback to global argument
- when no global argument is given, fallback to config file
- when no config is given, ask user interactively (and only in this case, see #37 for an example of need for non-interactivity)
In addition of making gcli usage easier, this concept of layers would allow to refactor some code, in particular the way to fetch and unlock a secret.
Edited by Hugo Trentesaux