Lines Matching defs:new
56 /// let m = Command::new("My Program")
61 /// Arg::new("in_file")
113 /// Creates a new instance of an `Command`.
125 /// Command::new("My Program")
128 pub fn new(name: impl Into<Str>) -> Self {
129 /// The actual implementation of `new`, non-generic to save code size.
149 /// Command::new("myprog")
150 /// // Adding a single "flag" argument with a short and help text, using Arg::new()
152 /// Arg::new("debug")
191 /// Command::new("myprog")
194 /// Arg::new("input").help("the input file to use")
220 /// let mut cmd = Command::new("foo")
221 /// .arg(Arg::new("bar")
266 /// let mut cmd = Command::new("foo")
267 /// .subcommand(Command::new("bar"))
318 /// Command::new("cmd")
323 /// .group(ArgGroup::new("vers")
341 /// Command::new("cmd")
349 /// ArgGroup::new("vers")
352 /// ArgGroup::new("input")
379 /// Command::new("myprog")
380 /// .subcommand(Command::new("config")
408 /// # Command::new("myprog")
410 /// Command::new("config").about("Controls configuration functionality")
411 /// .arg(Arg::new("config_file")),
412 /// Command::new("debug").about("Controls debug functionality")])
439 /// Command::new("foo")
441 /// Arg::new("bar").short('b').action(ArgAction::SetTrue)
465 /// let mut cmd = Command::new("myprog");
482 /// let matches = Command::new("myprog")
505 /// let mut cmd = Command::new("myprog")
532 /// let matches = Command::new("myprog")
566 /// let matches = Command::new("myprog")
604 /// let matches = Command::new("myprog")
649 /// let mut cmd = Command::new("myprog");
663 let mut raw_args = clap_lex::RawArgs::new(itr.into_iter());
668 let argv0 = Path::new(&argv0);
696 let p = Path::new(name);
719 /// let mut cmd = Command::new("myprog");
727 let mut styled = StyledStr::new();
728 let usage = Usage::new(self);
731 let c = Colorizer::new(Stream::Stdout, color).with_content(styled);
743 /// let mut cmd = Command::new("myprog");
754 let mut styled = StyledStr::new();
755 let usage = Usage::new(self);
758 let c = Colorizer::new(Stream::Stdout, color).with_content(styled);
771 /// let mut cmd = Command::new("myprog");
782 let mut styled = StyledStr::new();
783 let usage = Usage::new(self);
797 /// let mut cmd = Command::new("myprog");
808 let mut styled = StyledStr::new();
809 let usage = Usage::new(self);
822 let mut styled = StyledStr::new();
823 let usage = Usage::new(self);
837 let mut styled = StyledStr::new();
838 let usage = Usage::new(self);
857 /// let cmd = Command::new("myprog");
881 /// let cmd = Command::new("myprog");
899 /// let mut cmd = Command::new("myprog");
911 Usage::new(self).create_usage_with_title(&[])
929 /// let m = Command::new("myprog")
955 /// let cmd = Command::new("cmd")
1011 /// Command::new("myprog")
1036 /// Command::new("myprog")
1071 /// Command::new("myprog")
1098 /// Command::new("myprog")
1116 /// let res = Command::new("myprog")
1143 /// Command::new("myprog")
1146 /// .subcommand(Command::new("test"))
1170 /// Command::new("myprog")
1191 /// let res = Command::new("myprog")
1214 /// let res = Command::new("myprog")
1218 /// .subcommand(Command::new("test"))
1244 /// Command::new("myprog")
1268 /// Command::new("myprog")
1271 /// Arg::new("foo").help("It does foo stuff")
1281 /// Command::new("myapp")
1284 /// Arg::new("foo")
1367 /// let m = Command::new("prog")
1369 /// .subcommand(Command::new("test"))
1395 /// See [`Command::new`] for more details.
1427 /// Command::new("My Program")
1443 /// Command::new("My Program")
1466 /// Command::new("myprog")
1489 /// Command::new("myprog")
1510 /// Command::new("myprog")
1535 /// Command::new("myprog")
1557 /// Command::new("myprog")
1578 /// Command::new("myprog")
1598 /// Command::new("myprog")
1620 /// Command::new("myprog")
1642 /// Command::new("myprog")
1675 /// Command::new("myprog")
1684 /// Command::new("myprog")
1713 /// Command::new("myapp")
1773 /// Command::new("myprog")
1783 /// Command::new("myprog")
1903 /// let m = Command::new("cmd")
1904 /// .subcommand(Command::new("module")
1905 /// .subcommand(Command::new("install")))
1936 /// let m = Command::new("cmd")
1937 /// .arg(Arg::new("save-context")
1940 /// .arg(Arg::new("save-runtime")
1958 /// let m = Command::new("cmd")
1959 /// .arg(Arg::new("save-context")
1962 /// .arg(Arg::new("save-runtime")
1965 /// .arg(Arg::new("format")
1999 /// Command::new("myprog")
2089 /// let m = Command::new("myprog")
2091 /// .arg(Arg::new("arg1"))
2092 /// .arg(Arg::new("arg2")
2107 /// let m = Command::new("myprog")
2109 /// .arg(Arg::new("arg1")
2111 /// .arg(Arg::new("arg2")
2126 /// let m = Command::new("myprog")
2128 /// .arg(Arg::new("foo"))
2129 /// .arg(Arg::new("bar"))
2130 /// .arg(Arg::new("baz").action(ArgAction::Set).num_args(1..))
2145 /// let m = Command::new("myprog")
2147 /// .arg(Arg::new("foo"))
2148 /// .arg(Arg::new("bar"))
2149 /// .arg(Arg::new("baz").action(ArgAction::Set).num_args(1..))
2180 /// let matches = Command::new("pacman")
2182 /// Command::new("sync").short_flag('S').arg(
2183 /// Arg::new("search")
2217 /// let matches = Command::new("pacman")
2219 /// Command::new("sync").long_flag("sync").arg(
2220 /// Arg::new("search")
2259 /// let m = Command::new("myprog")
2260 /// .subcommand(Command::new("test")
2286 /// let m = Command::new("myprog")
2287 /// .subcommand(Command::new("test").short_flag('t')
2313 /// let m = Command::new("myprog")
2314 /// .subcommand(Command::new("test").long_flag("test")
2347 /// let m = Command::new("myprog")
2348 /// .subcommand(Command::new("test")
2350 /// .arg(Arg::new("input")
2374 /// let m = Command::new("myprog")
2375 /// .subcommand(Command::new("test").short_flag('t')
2377 /// .arg(Arg::new("input")
2402 /// let m = Command::new("myprog")
2403 /// .subcommand(Command::new("test").long_flag("test")
2405 /// .arg(Arg::new("input")
2439 /// let m = Command::new("myprog")
2440 /// .subcommand(Command::new("test")
2468 /// let m = Command::new("myprog")
2469 /// .subcommand(Command::new("test").short_flag('t')
2498 /// let m = Command::new("myprog")
2499 /// .subcommand(Command::new("test").long_flag("test")
2535 /// let m = Command::new("myprog")
2536 /// .subcommand(Command::new("test")
2557 /// let m = Command::new("myprog")
2558 /// .subcommand(Command::new("test").short_flag('b')
2581 /// let m = Command::new("myprog")
2582 /// .subcommand(Command::new("test").long_flag("test")
2614 /// let m = Command::new("cust-ord")
2615 /// .subcommand(Command::new("alpha") // typically subcommands are grouped
2621 /// .subcommand(Command::new("beta")
2660 /// Command::new("myprog")
2662 /// Command::new("test").hide(true)
2683 /// let err = Command::new("myprog")
2685 /// .subcommand(Command::new("test"))
2721 /// let m = Command::new("myprog")
2765 /// let m = Command::new("myprog")
2787 /// let m = Command::new("myprog")
2831 /// Command::new("myprog")
2868 /// let cmd = Command::new("cmd").subcommand(Command::new("sub")).arg(
2869 /// Arg::new("arg")
2918 /// let err = Command::new("myprog")
2920 /// .arg(Arg::new("opt").required(true))
2921 /// .subcommand(Command::new("test"))
2935 /// let noerr = Command::new("myprog")
2937 /// .arg(Arg::new("opt").required(true))
2938 /// .subcommand(Command::new("test"))
3019 /// let mut cmd = Command::new("hostname")
3021 /// .subcommand(Command::new("hostname"))
3022 /// .subcommand(Command::new("dnsdomainname"));
3047 /// [Command::new("true"), Command::new("false")]
3049 /// let mut cmd = Command::new("busybox")
3052 /// Command::new("busybox")
3090 /// Command::new("myprog")
3091 /// .subcommand(Command::new("sub1"))
3116 /// Command::new("myprog")
3117 /// .subcommand(Command::new("sub1"))
3154 /// Command::new("myprog")
3155 /// .subcommand(Command::new("sub1"))
3180 /// Command::new("myprog")
3181 /// .subcommand(Command::new("sub1"))
3484 let mut result = Vec::new();
3546 let mut vec = std::vec::Vec::new();
3694 /// let cmd = clap::Command::new("raw")
3792 let mut matcher = ArgMatcher::new(self);
3795 let mut parser = Parser::new(self);
3869 let mut ag = ArgGroup::new(g);
3934 let reqs = Usage::new(self).get_required_usage_from(&[], None, true); // maybe Some(m)
3946 let mut sc_names = String::new();
4021 let reqs = Usage::new(self).get_required_usage_from(&[], None, true); // maybe Some(m)
4043 let mut sc_names = String::new();
4211 // We have to create a new scope in order to tell rustc the borrow of `sc` is
4240 let mut arg = Arg::new(Id::HELP)
4257 let arg = Arg::new(Id::VERSION)
4273 let help_subcmd = Command::new("help")
4278 let mut help_help_subcmd = Command::new("help").about(help_about);
4287 Command::new("help").about(help_about).arg(
4288 Arg::new("subcommand")
4311 let mut cmd = Command::new(self.name.clone())
4356 let mut styled = StyledStr::new();
4569 let usage = Usage::new(self);
4571 let mut styled = StyledStr::new();
4579 let mut styled = StyledStr::new();