diff options
author | Daniel Mueller <deso@posteo.net> | 2020-04-01 22:59:22 -0700 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2020-04-01 22:59:22 -0700 |
commit | a3f8ae474d153048c5a9252125099ef49cc6b5f4 (patch) | |
tree | 106663b08f026cd873f0b6168a1d108925ab8e24 /src/arg_util.rs | |
parent | 550a730cb7ab9c9e3963ba46ac7cad93535f13d5 (diff) | |
download | nitrocli-a3f8ae474d153048c5a9252125099ef49cc6b5f4.tar.gz nitrocli-a3f8ae474d153048c5a9252125099ef49cc6b5f4.tar.bz2 |
Factor out arg_defs.rs for argument parsing related types
This change marks the first step in a restructuring of the argument
handling code, the ultimate goal of which is a separation of the type
definitions as used by structopt from the logic associated with it. This
change in particular introduces a new module, arg_defs, that contains
all those type definitions that previously resided in the args module.
Diffstat (limited to 'src/arg_util.rs')
-rw-r--r-- | src/arg_util.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/arg_util.rs b/src/arg_util.rs index 930e470..c16c326 100644 --- a/src/arg_util.rs +++ b/src/arg_util.rs @@ -35,7 +35,7 @@ macro_rules! tr { macro_rules! Command { ( $name:ident, [ $( $(#[$doc:meta])* $var:ident$(($inner:ty))? => $exec:expr, ) *] ) => { #[derive(Debug, PartialEq, structopt::StructOpt)] - enum $name { + pub enum $name { $( $(#[$doc])* $var$(($inner))?, @@ -44,7 +44,7 @@ macro_rules! Command { #[allow(unused_qualifications)] impl $name { - fn execute( + pub fn execute( self, ctx: &mut crate::args::ExecCtx<'_>, ) -> crate::Result<()> { |