Add `splinter user list` command to CLI
Adds a `splinter-user-list` subcommand to the Splinter CLI, behind the
experimental `user-list` feature. This subcommand currently has
one subcommand, `list`, which will be used to list all of Splinter's
users, including Biome and OAuth users.
@@ -1557,6 +1557,42 @@ fn run<I: IntoIterator<Item = T>, T: Into<OsString> + Clone>(args: I) -> Result<
)
}
+ #[cfg(feature = "user-list")]
+ {
+ app = app.subcommand(
+ SubCommand::with_name("user")
+ .about("Splinter user commands")
+ .subcommand(
+ SubCommand::with_name("list")
+ .about("List Splinter users, including Biome and OAuth users")
+ .arg(
+ Arg::with_name("format")
+ .short("F")
+ .long("format")
+ .help("Output format")
+ .possible_values(&["human", "csv"])
+ .default_value("human")
+ .takes_value(true),
+ )
+ .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"),
+ ),
+ ),
+ );
+ }
+
let matches = app.get_matches_from_safe(args)?;
// set default to info
@@ -1699,6 +1735,15 @@ fn run<I: IntoIterator<Item = T>, T: Into<OsString> + Clone>(args: I) -> Result<
subcommands = subcommands.with_command("permissions", permissions::ListAction)
}
+ #[cfg(feature = "user-list")]
+ {
+ use action::user;
+ subcommands = subcommands.with_command(
+ "user",
+ SubcommandActions::new().with_command("list", user::ListSplinterUsersAction),
+ )
+ }
+
subcommands.run(Some(&matches))
}
