Browse Source

Update CLI arguments

Samuel W. Flint 3 years ago
parent
commit
35950130e0
2 changed files with 10 additions and 10 deletions
  1. 4 4
      src/cli.yml
  2. 6 6
      src/main.rs

+ 4 - 4
src/cli.yml

@@ -112,7 +112,7 @@ subcommands:
         - add:
             about: Add a repo to a group
             args:
-              - group:
+              - name:
                   index: 1
                   value_name: GROUP_NAME
                   help: The name of the group
@@ -125,7 +125,7 @@ subcommands:
         - act:
             about: Add action to a group
             args:
-              - group:
+              - name:
                    index: 1
                    value_name: GROUP_NAME
                    help: The name of the group
@@ -138,7 +138,7 @@ subcommands:
         - remove:
             about: Remove a repo from a group
             args:
-              - group:
+              - name:
                   index: 1
                   value_name: GROUP_NAME
                   help: The name of the group
@@ -151,7 +151,7 @@ subcommands:
         - drop:
             about: Remove a group
             args:
-              - group:
+              - name:
                   index: 1
                   value_name: GROUP_NAME
                   help: The name of the group

+ 6 - 6
src/main.rs

@@ -114,30 +114,30 @@ fn main() {
         Some("group") => if let Some(matches) = matches.subcommand_matches("group") {
             match matches.subcommand_name() {
                 Some("create") => if let Some(matches) = matches.subcommand_matches("create") {
-                    let name = matches.value_of("group").unwrap().to_string();
+                    let name = matches.value_of("name").unwrap().to_string();
                     group::add(&mut configuration, &name);
                 },
                 Some("add") => if let Some(matches) = matches.subcommand_matches("add") {
-                    let name = matches.value_of("group").unwrap().to_string();
+                    let name = matches.value_of("name").unwrap().to_string();
                     let repo = matches.value_of("repo").unwrap().to_string();
                     group::add_repo(&mut configuration, &name, &repo);
                 },
                 Some("act") => if let Some(matches) = matches.subcommand_matches("act") {
-                    let name = matches.value_of("group").unwrap().to_string();
+                    let name = matches.value_of("name").unwrap().to_string();
                     let action = matches.value_of("action").unwrap().to_string();
                     group::add_action(&mut configuration, &name, &action);
                 },
                 Some("remove") => if let Some(matches) = matches.subcommand_matches("remove") {
-                    let name = matches.value_of("group").unwrap().to_string();
+                    let name = matches.value_of("name").unwrap().to_string();
                     let repo = matches.value_of("repo").unwrap().to_string();
                     group::remove_repo(&mut configuration, &name, &repo);
                 },
                 Some("drop") => if let Some(matches) = matches.subcommand_matches("drop") {
-                    let name = matches.value_of("group").unwrap().to_string();
+                    let name = matches.value_of("name").unwrap().to_string();
                     group::remove_group(&mut configuration, &name);
                 }
                 Some("show") => if let Some(matches) = matches.subcommand_matches("show") {
-                    let name = matches.value_of("group").unwrap().to_string();
+                    let name = matches.value_of("name").unwrap().to_string();
                     let group = configuration.groups.get(&name);
                     match group {
                         Some(group) => println!("{}", group),