From 9db36f7ba3310c2c51a169ea4a88c77946270b0e Mon Sep 17 00:00:00 2001 From: Jake Craige Date: Sun, 25 Nov 2018 15:47:47 -0800 Subject: [PATCH] Improve serve command error message (#2017) Update the command matcher for the server command to log a more helpful message when it's called without a subcommand. Before: ```sh $ target/debug/grin server :: Some(ArgMatches { args: {}, subcommand: None, usage: Some("USAGE:\n grin server [OPTIONS] [SUBCOMMAND]") }) ``` After: ```sh $ target/debug/grin server Subcommand required, use 'grin help server' for details ``` --- src/bin/cmd/server.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bin/cmd/server.rs b/src/bin/cmd/server.rs index ebce5b00a..96cbea21c 100644 --- a/src/bin/cmd/server.rs +++ b/src/bin/cmd/server.rs @@ -174,6 +174,9 @@ pub fn server_command(server_args: Option<&ArgMatches>, mut global_config: Globa } } ("stop", _) => println!("TODO. Just 'kill $pid' for now. Maybe /tmp/grin.pid is $pid"), + ("", _) => { + println!("Subcommand required, use 'grin help server' for details"); + } (cmd, _) => { println!(":: {:?}", server_args); panic!(