From 23c3a4b86344f9a892d230bfeb46e14856a9213b Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 4 May 2018 11:19:47 +0200 Subject: [PATCH 1/3] Update help, clap does the rest here --- lib/core/libimagrt/src/runtime.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/libimagrt/src/runtime.rs b/lib/core/libimagrt/src/runtime.rs index 093bd3cc..3f3c640c 100644 --- a/lib/core/libimagrt/src/runtime.rs +++ b/lib/core/libimagrt/src/runtime.rs @@ -175,7 +175,7 @@ impl<'a> Runtime<'a> { .arg(Arg::with_name(Runtime::arg_verbosity_name()) .short("v") .long("verbose") - .help("Enables verbosity, can be used to set log level to one of 'trace', 'debug', 'info', 'warn' or 'error'") + .help("Set log level") .required(false) .takes_value(true) .possible_values(&["trace", "debug", "info", "warn", "error"]) From 9bf3f6da1b48a62f2b93ed4d23a4a7e4e4840afe Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 4 May 2018 11:20:09 +0200 Subject: [PATCH 2/3] Update help --- lib/core/libimagrt/src/runtime.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/libimagrt/src/runtime.rs b/lib/core/libimagrt/src/runtime.rs index 3f3c640c..967f6661 100644 --- a/lib/core/libimagrt/src/runtime.rs +++ b/lib/core/libimagrt/src/runtime.rs @@ -184,7 +184,7 @@ impl<'a> Runtime<'a> { .arg(Arg::with_name(Runtime::arg_debugging_name()) .long("debug") - .help("Enables debugging output") + .help("Enables debugging output. Shortcut for '--verbose debug'") .required(false) .takes_value(false)) From c65a3d1af94011fb4fdfc0ad28e0d762818923cc Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 4 May 2018 11:21:49 +0200 Subject: [PATCH 3/3] Add CLI validators in default CLI setup --- lib/core/libimagrt/src/runtime.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/core/libimagrt/src/runtime.rs b/lib/core/libimagrt/src/runtime.rs index 967f6661..ed1bdc7e 100644 --- a/lib/core/libimagrt/src/runtime.rs +++ b/lib/core/libimagrt/src/runtime.rs @@ -198,6 +198,7 @@ impl<'a> Runtime<'a> { .long("config") .help("Path to alternative config file") .required(false) + .validator(::libimagutil::cli_validators::is_existing_path) .takes_value(true)) .arg(Arg::with_name(Runtime::arg_config_override_name()) @@ -210,12 +211,14 @@ impl<'a> Runtime<'a> { .long("rtp") .help("Alternative runtimepath") .required(false) + .validator(::libimagutil::cli_validators::is_directory) .takes_value(true)) .arg(Arg::with_name(Runtime::arg_storepath_name()) .long("store") .help("Alternative storepath. Must be specified as full path, can be outside of the RTP") .required(false) + .validator(::libimagutil::cli_validators::is_directory) .takes_value(true)) .arg(Arg::with_name(Runtime::arg_editor_name())