-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI refactor #731
Comments
When a CLI system is mixed with a configuration system (either toml yaml or json...), and can inherit environment variable, I consider it's a very high-level system already. I suggest to just fork ffcli into our codebase (step 1), and then to see what we do from there, step by step. This would fluidify execution of other tasks. |
I agree, and we can start with just the flag parsing part first. |
This change contains the minimum change required to support some of the requirements described in gnolang#731 What it brings: - Fork of `ffcli` in `tm2/pkg/commands/ffcli`. Note that the legacy `ff` is still used (so env var and config file override is still supported). - Accepts flags declared after the command arguments. This is one of the main complaints about `ffcli`. Now use can run ` -
This change contains the minimum change required to support some of the requirements described in gnolang#731 What it brings: - Fork of `ffcli` in `tm2/pkg/commands/ffcli`. Note that the legacy `ff` is still used (so env var and config file override is still supported). - Accepts flags declared after the command arguments. This is one of the main complaints about `ffcli`. Now use can run ` -
This change contains the minimum change required to support some of the requirements described in gnolang#731 What it brings: - Fork of `ffcli` in `tm2/pkg/commands/ffcli`. Note that the legacy `ff` is still used (so env var and config file override is still supported). - Accepts flags declared after the command arguments. This is one of the main complaints about `ffcli`. Now use can run ` -
@thehowl checkout this -> https://github.com/rsc/getopt/blob/master/getopt.go From golang/go#40138 Edit: FYI @thehowl, #828 partially tackled TOML config file support for an existing command. |
With the on-going discussion for running a multi-node testnet, i believe this issue is needed to be linked to it. Of course, genesis files can be written by hand for the moment, but i believe we should consider to add useful tools to simplify validators works like: (as in cosmos-sdk based chain)
|
Let's start by switching from a single command to multiple subcommands; then we can have PRs for each relevant addition. Edit: see #937 |
From discussions:
|
Looking at the |
This is a conflict I was aware of, although I know informally we verbally said that we should still go in the direction of having (some) short flags. wdyt @moul ? |
I recommend using short flags for common options, particularly if they are widely used in the Go binary or conform to Unix conventions. For example, Things to avoid include:
|
Following various discussions, issues, and PRs; I've a proposal for a new (and final?) refactor of the CLI.
Proposed changes:
ff/ffcli
dependency, focus on a minimalist flag management approach. Fork it, keep the spirit, make it better, for gno. fix(cli): accept flags after command's arguments #762flagset
with aflagBuilder
callback that can lasily be called recursively to support setting parent flags from a child command. feat: add support for toml configuration files + recursive flag definitions for subcommands #827toml
driver by default; make the CLI always looking for flags, then files, then default. feat: add support for toml configuration files + recursive flag definitions for subcommands #827gnoland
, beginning withinit
andrun
. refactor(gnoland): add subcommands support #937gnoland
.Read recent discussion at #623
Related with #460
Continues #497
Fixes #729
The text was updated successfully, but these errors were encountered: