Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Auto-generate shell completions for solana-cli (issue #8879 and #14005) (backport #18931) #18945

Merged
merged 1 commit into from
Jul 28, 2021

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 28, 2021

This is an automatic backport of pull request #18931 done by Mergify.


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.io/

… (#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

(cherry picked from commit 9d0a937)
@mergify mergify bot added the automerge Merge this Pull Request automatically once CI passes label Jul 28, 2021
@codecov
Copy link

codecov bot commented Jul 28, 2021

Codecov Report

Merging #18945 (b99f10a) into v1.7 (02c5093) will decrease coverage by 0.0%.
The diff coverage is 92.4%.

@@            Coverage Diff            @@
##             v1.7   #18945     +/-   ##
=========================================
- Coverage    82.3%    82.3%   -0.1%     
=========================================
  Files         434      435      +1     
  Lines      122840   122923     +83     
=========================================
+ Hits       101156   101216     +60     
- Misses      21684    21707     +23     

@mergify mergify bot merged commit 65fe00b into v1.7 Jul 28, 2021
@mergify mergify bot deleted the mergify/bp/v1.7/pr-18931 branch July 28, 2021 17:26
@brooksprumo brooksprumo mentioned this pull request Aug 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant