From a3f8ae474d153048c5a9252125099ef49cc6b5f4 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Wed, 1 Apr 2020 22:59:22 -0700 Subject: 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. --- src/arg_util.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/arg_util.rs') 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<()> { -- cgit v1.2.1