From a1b227642bc812169bf0ce14cecd63e80fcc5460 Mon Sep 17 00:00:00 2001 From: Henrique Alves Date: Mon, 25 Jul 2022 21:14:13 -0300 Subject: Separate commands in another file --- src/main.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 6b7691b..5d05698 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,20 +22,20 @@ enum Commands { /// Package project git git_repo: String, /// Commit to checkout (default is latest) - #[clap(short, long, required=false)] + #[clap(short, long, required = false, default_value = "")] commit: String, + /// Don't copy to target folder + #[clap(short, long, required = false, takes_value = false)] + no_copy: bool, }, - /// Install packages on .glam file + /// Install all packages on .glam file Install { - /// Verbose (output subshell commands) - #[clap(short, long, takes_value = false)] - verbose: bool }, + /// Update a single GLAM package UpdatePackage { /// Name of the package to update (default is all packages) - #[clap(short, long)] package_name: String, }, @@ -66,18 +66,18 @@ fn main() { commands::initialize(&root); }, - Commands::InstallPackage {git_repo, commit} => { + Commands::InstallPackage {git_repo, commit, no_copy} => { let root = commands::search_project_root(); commands::check_ignores(&root); commands::initialize_glam_files(&root); - commands::install_package(&root, git_repo, commit, cli.verbose); + commands::install_package(&root, git_repo, commit, !*no_copy, cli.verbose); }, - Commands::Install { verbose } => { + Commands::Install { } => { let root = commands::search_project_root(); commands::check_ignores(&root); commands::initialize_glam_files(&root); - commands::install(&root, *verbose); + commands::install_all_packages(&root, cli.verbose); }, Commands::UpdatePackage { package_name } => { -- cgit v1.2.3