soroban-cli
soroban-cli copied to clipboard
CLI: `--global` is not a valid option outside of `config` command tree
What version are you using?
0.9.1
What did you do?
Any command that currently consumes configs adds locator::Args to its Cmd struct. This means that --global shows up as an option in a bunch of commands where it doesn't do anything, such as soroban contract bindings typescript
What did you expect to see?
When setting config, the CLI needs to know whether to write it to the current directory (the default) or to the user's home directory (--global behavior).
When consuming config, both need to be checked. Local first, then global if a local network or identity with the given name isn't found. We do not need to give people the flexibility to say which config to check; doing so adds cognitive overhead without benefit.
This was true prior to #528 / 13ee0d59fd77d06b983e37b42d6; see there that the old locator::read_* instances were replaced with self.locator.read_*, requiring locator to be added to the Args for each command.
What did you see instead?
A should-be-irrelevant --global option all over the place, adding noise and confusion to the CLI.