pub fn positional(
        name: &str,
        help: &str,
        mut default_value: Option<&[&str]>,
        is_variadic: bool,
    ) -> Result<Spec> {
        if let Some(dvs) = default_value {
            if dvs.len() > 1 && !is_variadic {
                return Err(Error::InvalidArgument(format!(
                    "Only variadic positional arguments can have multiple default values"
                )));
            }

            if dvs.is_empty() {
                default_value = None;
            }
        }

        Ok(Spec {
            name: name.to_owned(),
            help: help.to_owned(),
            short_name: None,
            flag_type: Type::Positional {
                default_value: default_value.map(|vs| vs.iter().map(|&v| v.to_owned()).collect()),
                is_variadic: is_variadic,
            },
        })
    }
/// Constructs a Spec which describes a positional flag. Flags of this type
/// are not looked up by name after a "-" or "--" character, but instead
/// are parsed purely by their position in the list of command-line
/// arguments.
///
/// This also means that the order in which positional flags are added to a
/// Specs structure matters for parsing.
///
/// A positional flag is variadic if it should be able to collect more than
/// one value (e.g., for a command which takes a list of files to process
/// of unspecified length).
Constructs a Spec which describes a positional flag. Flags of this type
are not looked up by name after a "-" or "--" character, but instead
are parsed purely by their position in the list of command-line
arguments.

This also means that the order in which positional flags are added to a
Specs structure matters for parsing.

A positional flag is variadic if it should be able to collect more than
one value .
Constructs a Spec which describes a positional flag . Flags of this type are not looked up by name after a " - " or " -- " character but instead are parsed purely by their position in the list of command - line arguments . This also means that the order in which positional flags are added to a Specs structure matters for parsing . A positional flag is variadic if it should be able to collect more than one value .
pub fn positional(
        name: &str,
        help: &str,
        mut default_value: Option<&[&str]>,
        is_variadic: bool,
    ) -> Result<Spec> {
        if let Some(dvs) = default_value {
            if dvs.len() > 1 && !is_variadic {
                return Err(Error::InvalidArgument(format!(
                    "Only variadic positional arguments can have multiple default values"
                )));
            }
            if dvs.is_empty() {
                default_value = None;
            }
        }
        Ok(Spec {
            name: name.to_owned(),
            help: help.to_owned(),
            short_name: None,
            flag_type: Type::Positional {
                default_value: default_value.map(|vs| vs.iter().map(|&v| v.to_owned()).collect()),
                is_variadic: is_variadic,
            },
        })
    }
pub fn positional ( name : & str , help : & str , mut default_value : Option < & [ & str ] > , is_variadic : bool , ) -> Result < Spec > { if let Some ( dvs ) = default_value { if dvs . len ( ) > 1 && ! is_variadic { return Err ( Error :: InvalidArgument ( format ! ( " " ) ) ) ; } if dvs . is_empty ( ) { default_value = None ; } } Ok ( Spec { name : name . to_owned ( ) , help : help . to_owned ( ) , short_name : None , flag_type : Type :: Positional { default_value : default_value . map ( | vs | vs . iter ( ) . map ( | & v | v . to_owned ( ) ) . collect ( ) ) , is_variadic : is_variadic , } , } ) }
Constructs a Spec which describes a positional flag.
Constructs a Spec which describes a positional flag .
name
&str
help
&str
default_value
Option<&[&str]>
is_variadic
bool
name
&str
help
&str
default_value
Option<&[&str]>
is_variadic
bool