-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Conversation
dd75772
to
5b902e8
Compare
Maybe better to add a CLI option to generate that in runtime?
Makes different version management easier, since you just obtain the binary and generate the completions for yourself locally. |
Hi @tomusdrw, thanks for your feedback. I was considering it but went for a build only option in order to not overload the cli with code that is used only once at most and keep the polkadot cli as slim as possible but this is something that can be changed of course. It may be even worth having this as feature. If we decide to augment the cli, we will also need to pass and validate the shell:
|
README.md
Outdated
|
||
The Polkadot cli command supports shell auto-completion. For this to work, you will need to run the completion script matching you build and system. | ||
|
||
Assuming you built a release version using `cargo build --release` and use `bash` run the followig: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: followig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed.
polkadot/cli/build.rs
Outdated
|
||
fs::create_dir(&path).ok(); | ||
|
||
// println!("{:?}", path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remaining commented println
* Update Substrate * Update Substrate again * Integrate weight/fee stuff. * Add new files.
* Set 'opt-level = 0' for release builds * Use 'opt-level = 3' in CI
* Check feature runtime-benchmarks in CI * Fix runtime-benchmarks building
…up-part-9 Secondary chain cleanup part 9
* Add timestamp pallet test * Remove println * Make timestamp test more reliable
The Polkadot cli command now supports shell auto-completion.
The auto-completion is now generated from the build. Once executed, this script show the following if you type
polkadot <tab><tab>
:The completion script is generated from
cli.yml
so it will keep in sync as the command and flags evolve.See it in action below:
![asciicast](https://camo.githubusercontent.com/09d86c3692748d6e514f53ed126457f627446cccb1308f71afaa91d4a48cea4e/68747470733a2f2f61736369696e656d612e6f72672f612f3139323038302e706e67)
Assuming you built a release version using
cargo build --release
and usebash
run the followig:You can find completion scripts for: