Closed ltfschoen closed 6 years ago
I expect that we will merge our work into Parity eventually, so could you look into how we would add our work with their CLI? I don't want us to spend a lot of time on changes that will need to be substantially reworked to fit with Parity, useful though they may be in the mean time. I'm not saying that your reorganization can't be. Maybe @NikVolf, @folsen or @debris can advise?
We aim to make our CLI bits a thin wrapper completely separate and outside the parity "library", and thus any CLI stuff should be pretty manageable. I'd recommend that you have your own CLI for now so as not to have to deal with all the legacy, and then when/if time comes to merge things, we just take what your CLI has and put that into ours. The most important thing is that your code would be similarly structured in a CLI bit and a library bit that the CLI code "calls into".
OK, thanks Fredrik! We have a separate folder and crate for the CLI which uses Clap, although it doesn't call into other crates in our repo yet.
We've not integrated Clap into the CLI, which includes an in-built Help menu for Commands (i.e. Log, which is optional)
cargo run -- --log 4
and Sub-Commands (i.e. Mode, which may be used in conjunction with a Command). We can use Cargo Make to conveniently check everything is working still in the Main Package and all Libraries with:cargo make test-all
cargo make all
We can see the Help menu for all Commands with:
cargo run -- help
We can see the Help menu for the "mode" SubCommand with:cargo run -- mode --help
Below are different combinations you can use, which the Help menu's will explain anyway:
The last three commands above are equivalent to the following three commands respectively: