pub fn parse(&self) -> Result<ArgvMap, Error> {
        let argv = self.argv.clone().unwrap_or_else(|| Docopt::get_argv());
        let vals = try!(
            self.p.parse_argv(argv, self.options_first)
                .map_err(|s| self.err_with_usage(Argv(s)))
                .and_then(|argv|
                    match self.p.matches(&argv) {
                        Some(m) => Ok(ArgvMap { map: m }),
                        None => Err(self.err_with_usage(NoMatch)),
                    }));
        if self.help && vals.get_bool("--help") {
            return Err(self.err_with_full_doc(Help));
        }
        match self.version {
            Some(ref v) if vals.get_bool("--version") => {
                return Err(Version(v.clone()))
            }
            _ => {},
        }
        Ok(vals)
    }
/// Parse command line arguments and try to match them against a usage
/// pattern specified in the Docopt string.
///
/// If there is a match, then an `ArgvMap` is returned, which maps
/// flags, commands and arguments to values.
///
/// If parsing the command line arguments fails, then an `Argv` error is
/// returned. If parsing succeeds but there is no match, then a `NoMatch`
/// error is returned. Both of these errors are always returned inside a
/// `WithProgramUsage` error.
///
/// If special handling of `help` or `version` is enabled (the former is
/// enabled by default), then `Help` or `Version` errors are returned
/// if `--help` or `--version` is present.
Parse command line arguments and try to match them against a usage
pattern specified in the Docopt string.

If there is a match, then an `ArgvMap` is returned, which maps
flags, commands and arguments to values.

If parsing the command line arguments fails, then an `Argv` error is
returned. If parsing succeeds but there is no match, then a `NoMatch`
error is returned. Both of these errors are always returned inside a
`WithProgramUsage` error.


Parse command line arguments and try to match them against a usage pattern specified in the Docopt string . If there is a match then an ` ArgvMap ` is returned which maps flags commands and arguments to values . If parsing the command line arguments fails then an ` Argv ` error is returned . If parsing succeeds but there is no match then a ` NoMatch ` error is returned . Both of these errors are always returned inside a ` WithProgramUsage ` error .
pub fn parse(&self) -> Result<ArgvMap, Error> {
        let argv = self.argv.clone().unwrap_or_else(|| Docopt::get_argv());
        let vals = try!(
            self.p.parse_argv(argv, self.options_first)
                .map_err(|s| self.err_with_usage(Argv(s)))
                .and_then(|argv|
                    match self.p.matches(&argv) {
                        Some(m) => Ok(ArgvMap { map: m }),
                        None => Err(self.err_with_usage(NoMatch)),
                    }));
        if self.help && vals.get_bool("--help") {
            return Err(self.err_with_full_doc(Help));
        }
        match self.version {
            Some(ref v) if vals.get_bool("--version") => {
                return Err(Version(v.clone()))
            }
            _ => {},
        }
        Ok(vals)
    }
pub fn parse ( & self ) -> Result < ArgvMap , Error > { let argv = self . argv . clone ( ) . unwrap_or_else ( | | Docopt :: get_argv ( ) ) ; let vals = try ! ( self p parse_argv ( argv self options_first ) map_err ( s self err_with_usage ( Argv ( s ) ) ) and_then ( argv match self p matches ( argv ) { Some ( m ) Ok ( ArgvMap { map m } ) None Err ( self err_with_usage ( NoMatch ) ) } ) ) ; if self . help && vals . get_bool ( " " ) { return Err ( self . err_with_full_doc ( Help ) ) ; } match self . version { Some ( ref v ) if vals . get_bool ( " " ) => { return Err ( Version ( v . clone ( ) ) ) } _ => { } , } Ok ( vals ) }
Parse command line arguments and try to match them against a usage
pattern specified in the Docopt string.
Parse command line arguments and try to match them against a usage pattern specified in the Docopt string .
&self
&self