solana/cli
theonekeyg 9d0a937a05
Auto-generate shell completions for solana-cli (issue #8879 and #14005) (#18931)
* Auto-generate shell completions for solana-cli (issue #8879 and #14005)

Implement `completion` SubCommand for solana-cli, which outputs
completion script to stdout and exits the process. The script generation
handled completely by clap.

In order to implement the generation, one minor design change was
necessary regarding the creation of clap `App`.

Previously: One part of App initialization was in the `app` function,
and some other arguments and subcommands were added later directly in
the `main` function.

Now: The whole construction of App was moved to `get_clap_app` function.

P.S. I wasn't sure if constructing App separately had visual importance,
so both constructing parts are still separate in `base_clap_app` and
`final_clap_app` functions. But they sure could be in one single
function.

* Dereplicode match expr, fix clippy warning.

* Move clap App construction into separate module

Also join two parts of the construction into a single function

* Fix tests

* Apply rustfmt lints
2021-07-28 09:43:32 -06:00
..
src Auto-generate shell completions for solana-cli (issue #8879 and #14005) (#18931) 2021-07-28 09:43:32 -06:00
tests adds validator flag to allow private ip addresses (#18850) 2021-07-23 15:25:03 +00:00
.gitignore
Cargo.toml chore: bump const_format from 0.2.14 to 0.2.15 (#18903) 2021-07-26 19:20:31 -06:00