aboutsummaryrefslogtreecommitdiff
path: root/nitrocli/src/main.rs
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2019-01-06 16:05:36 -0800
committerDaniel Mueller <deso@posteo.net>2019-01-06 16:05:36 -0800
commit350b3039ea0bc88c830bb3b4003af02b1000fd48 (patch)
treee99e9dc64bedc7a33fc1f9e9713fa0c673aa8fb3 /nitrocli/src/main.rs
parent21a68c0cdd6237313a4cfad2de108b3785b75b49 (diff)
downloadnitrocli-350b3039ea0bc88c830bb3b4003af02b1000fd48.tar.gz
nitrocli-350b3039ea0bc88c830bb3b4003af02b1000fd48.tar.bz2
Auto generate argument enums
The argparse module we use for parsing events expects an enum in order to convey what subcommand has been supplied as an argument. Such an enum also needs to implement str::FromStr and, preferably, fmt::Display. Manually writing down those definitions is error-prone, tedious, and adds no value -- only lines of code. As it turns out the proper definitions can be generated with relative easy with a declarative macro, making the code much more concise. Hence, with this change we use a newly introduced macro for generating those enums.
Diffstat (limited to 'nitrocli/src/main.rs')
-rw-r--r--nitrocli/src/main.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/nitrocli/src/main.rs b/nitrocli/src/main.rs
index a9e31f8..9f56f75 100644
--- a/nitrocli/src/main.rs
+++ b/nitrocli/src/main.rs
@@ -70,6 +70,8 @@
#[macro_use]
mod redefine;
+#[macro_use]
+mod arg_util;
mod args;
mod commands;