summaryrefslogtreecommitdiff
path: root/src/arg_util.rs
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2020-01-07 15:15:38 +0000
committerDaniel Mueller <deso@posteo.net>2020-01-07 15:15:38 +0000
commitc1f35ab538dbdf3002a6a9aa0932ada687160787 (patch)
tree965ade0fc53cebb3ad8da04144592031a68d0b26 /src/arg_util.rs
parentb9fbc489819a111f21eecb2b9a07a931dca1b8ce (diff)
downloadnitrocli-c1f35ab538dbdf3002a6a9aa0932ada687160787.tar.gz
nitrocli-c1f35ab538dbdf3002a6a9aa0932ada687160787.tar.bz2
Replace argparse with structopt
This patch changes the argument handling code to use structopt instead of argparse using the data structures we introduced in the last patch. As part of that transition we replace the old Error::ArgparseError variant with ClapError that stores a structopt::clap::Error. Because of that replacement, the format of the help messages changed, breaking some of the tests. Hence, this change adapts them accordingly. Also clap currently prints the version output to stdout, so we ignore the version_option test case for now.
Diffstat (limited to 'src/arg_util.rs')
-rw-r--r--src/arg_util.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/arg_util.rs b/src/arg_util.rs
index b040e0d..dbb9ce1 100644
--- a/src/arg_util.rs
+++ b/src/arg_util.rs
@@ -67,11 +67,10 @@ macro_rules! Command {
fn execute(
self,
ctx: &mut crate::args::ExecCtx<'_>,
- args: ::std::vec::Vec<::std::string::String>,
) -> crate::Result<()> {
match self {
$(
- $name::$var(_) => $exec(ctx, args),
+ $name::$var(args) => $exec(ctx, args),
)*
}
}