From 6cd9c8a01ad8b664fe361f543bc9c6b2caf59e4a Mon Sep 17 00:00:00 2001 From: fdb-hiroshima <35889323+fdb-hiroshima@users.noreply.github.com> Date: Thu, 21 Mar 2019 23:25:22 +0100 Subject: [PATCH] Print help when subcommand is given without arguments (#498) Fix #490 --- plume-cli/src/instance.rs | 1 + plume-cli/src/search.rs | 1 + plume-cli/src/users.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/plume-cli/src/instance.rs b/plume-cli/src/instance.rs index 6ffb0430..8fa48060 100644 --- a/plume-cli/src/instance.rs +++ b/plume-cli/src/instance.rs @@ -33,6 +33,7 @@ pub fn run<'a>(args: &ArgMatches<'a>, conn: &Connection) { let conn = conn; match args.subcommand() { ("new", Some(x)) => new(x, conn), + ("", None) => command().print_help().unwrap(), _ => println!("Unknown subcommand"), } } diff --git a/plume-cli/src/search.rs b/plume-cli/src/search.rs index e8e301ef..8a3f1f31 100644 --- a/plume-cli/src/search.rs +++ b/plume-cli/src/search.rs @@ -59,6 +59,7 @@ pub fn run<'a>(args: &ArgMatches<'a>, conn: &Connection) { ("init", Some(x)) => init(x, conn), ("refill", Some(x)) => refill(x, conn, None), ("unlock", Some(x)) => unlock(x), + ("", None) => command().print_help().unwrap(), _ => println!("Unknown subcommand"), } } diff --git a/plume-cli/src/users.rs b/plume-cli/src/users.rs index 1815dd5b..38a4972b 100644 --- a/plume-cli/src/users.rs +++ b/plume-cli/src/users.rs @@ -80,6 +80,7 @@ pub fn run<'a>(args: &ArgMatches<'a>, conn: &Connection) { match args.subcommand() { ("new", Some(x)) => new(x, conn), ("reset-password", Some(x)) => reset_password(x, conn), + ("", None) => command().print_help().unwrap(), _ => println!("Unknown subcommand"), } }