Merge pull request #15 from AleoHQ/feature/subcommands

Implements subcommand ordering and updates subcommand descriptions
This commit is contained in:
Howard Wu 2020-05-16 20:31:05 -07:00 committed by GitHub
commit ce141b2cf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 12 deletions

View File

@ -22,7 +22,7 @@ impl CLI for BuildCommand {
type Output = (Compiler<Fr, EdwardsProjective>, bool);
const NAME: NameType = "build";
const ABOUT: AboutType = "Compile the current package";
const ABOUT: AboutType = "Compile the package as a program";
const ARGUMENTS: &'static [ArgumentType] = &[];
const FLAGS: &'static [FlagType] = &[];
const OPTIONS: &'static [OptionType] = &[];

View File

@ -15,7 +15,7 @@ impl CLI for DeployCommand {
type Output = ();
const NAME: NameType = "deploy";
const ABOUT: AboutType = "Deploy package as program to the network (*)";
const ABOUT: AboutType = "Deploy the package as a program to the network (*)";
const ARGUMENTS: &'static [ArgumentType] = &[];
const FLAGS: &'static [FlagType] = &[];
const OPTIONS: &'static [OptionType] = &[];

View File

@ -15,7 +15,7 @@ impl CLI for PublishCommand {
type Output = ();
const NAME: NameType = "publish";
const ABOUT: AboutType = "Package circuit and upload this package to the registry (*)";
const ABOUT: AboutType = "Publish the package to the package manager (*)";
const ARGUMENTS: &'static [ArgumentType] = &[];
const FLAGS: &'static [FlagType] = &[];
const OPTIONS: &'static [OptionType] = &[];

View File

@ -17,16 +17,15 @@ fn main() -> Result<(), CLIError> {
AppSettings::DisableVersion,
AppSettings::SubcommandRequiredElseHelp,
])
// TODO (howardwu): Print subcommands in non-alphabetical order, instead print as ordered here.
.subcommands(vec![
NewCommand::new(),
InitCommand::new(),
BuildCommand::new(),
SetupCommand::new(),
ProveCommand::new(),
RunCommand::new(),
PublishCommand::new(),
DeployCommand::new(),
NewCommand::new().display_order(0),
InitCommand::new().display_order(1),
BuildCommand::new().display_order(2),
SetupCommand::new().display_order(3),
ProveCommand::new().display_order(4),
RunCommand::new().display_order(5),
PublishCommand::new().display_order(6),
DeployCommand::new().display_order(7),
])
.set_term_width(0)
.get_matches();