Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds support for external subcommands
External subcommands are now supported via the following: ```rust extern crate clap; use clap::{App, AppSettings}; fn main() { // Assume there is a third party subcommand named myprog-subcmd let m = App::new("myprog") .setting(AppSettings::AllowExternalSubcommands) .get_matches_from(vec![ "myprog", "subcmd", "--option", "value", "-fff", "--flag" ]); // All trailing arguments will be stored under the subcommands sub-matches under a // value of their runtime name (in this case "subcmd") match m.subcommand() { (external, Some(ext_m)) => { let ext_args: Vec<&str> = ext_m.values_of(external).unwrap().collect(); assert_eq!(ext_args ,["--option", "value", "-fff", "--flag"]); }, _ => unreachable!() } } ``` Closes #372
- Loading branch information