Add role show command
This change adds the role show command to the CLI arguments and
configures the ShowRoleAction to apply when the "role show" subcommand
is executed.
@@ -855,6 +855,41 @@ fn run<I: IntoIterator<Item = T>, T: Into<OsString> + Clone>(args: I) -> Result<
.default_value("human")
.takes_value(true),
),
+ )
+ .subcommand(
+ SubCommand::with_name("show")
+ .about("Show a specific role for a Splinter node")
+ .arg(
+ Arg::with_name("url")
+ .short("U")
+ .long("url")
+ .help("URL of the Splinter daemon REST API")
+ .takes_value(true),
+ )
+ .arg(
+ Arg::with_name("private_key_file")
+ .value_name("private-key-file")
+ .short("k")
+ .long("key")
+ .takes_value(true)
+ .help("Name or path of private key"),
+ )
+ .arg(
+ Arg::with_name("format")
+ .short("F")
+ .long("format")
+ .help("Output format")
+ .possible_values(&["human", "json", "yaml"])
+ .default_value("human")
+ .takes_value(true),
+ )
+ .arg(
+ Arg::with_name("role_id")
+ .required(true)
+ .takes_value(true)
+ .value_name("ROLE ID")
+ .help("ID of role to be shown"),
+ ),
),
);
}
@@ -992,7 +1027,9 @@ fn run<I: IntoIterator<Item = T>, T: Into<OsString> + Clone>(args: I) -> Result<
use action::rbac;
subcommands = subcommands.with_command(
"role",
- SubcommandActions::new().with_command("list", rbac::ListRolesAction),
+ SubcommandActions::new()
+ .with_command("list", rbac::ListRolesAction)
+ .with_command("show", rbac::ShowRoleAction),
)
}
