Lines Matching refs:subcommands
36 /// This includes defining arguments, subcommands, parser behavior, and help output.
100 subcommands: Vec<Command>,
254 /// This can be useful for modifying auto-generated arguments of nested subcommands with
285 let pos = self.subcommands.iter().position(|s| s.name == name);
288 self.subcommands.remove(idx)
293 self.subcommands.push(f(subcmd));
368 /// subcommands, version, usage, etc. They also function just like [`Command`]s, in that they get
398 self.subcommands.push(subcmd);
402 /// Adds multiple subcommands to the list of valid possibilities.
409 /// .subcommands( [
417 pub fn subcommands(mut self, subcmds: impl IntoIterator<Item = impl Into<Self>>) -> Self {
907 // If there are global arguments, or settings we need to propagate them down to subcommands
917 /// These settings will apply to the top-level command and all subcommands, by default. Some
918 /// settings can be overridden in subcommands.
949 /// **NOTE:** This choice is propagated to all child subcommands.
986 /// **NOTE:** This choice is propagated to all child subcommands.
1005 /// **NOTE:** This choice is propagated to all child subcommands.
1028 /// **NOTE:** This choice is propagated to all child subcommands.
1133 /// Specifies to use the version of the current command for all [`subcommands`].
1135 /// Defaults to `false`; subcommands have independent version strings from their parents.
1137 /// **NOTE:** This choice is propagated to all child subcommands.
1152 /// [`subcommands`]: crate::Command::subcommand()
1162 /// Places the help string for all arguments and subcommands on the line after them.
1164 /// **NOTE:** This choice is propagated to all child subcommands.
1185 /// **NOTE:** This choice is propagated to all child subcommands.
1238 /// **NOTE:** This choice is propagated to all child subcommands.
1262 /// **NOTE:** This choice is propagated to all child subcommands.
1316 /// **NOTE:** This choice is propagated to all child subcommands.
1335 /// **NOTE:** This choice is propagated to all child subcommands.
1356 /// designing CLIs which allow inferred subcommands and have potential positional/free
1357 /// arguments whose values could start with the same characters as subcommands. If this is the
1361 /// **NOTE:** This choice is propagated to all child subcommands.
1391 /// These apply only to the current command and are not inherited by subcommands.
1417 /// subcommands, this setting **should** be used!
1705 /// command, meaning if you are using subcommands, those help messages will
1759 /// arguments, and subcommands) including titles.
1762 /// * `{subcommands}` - Help for subcommands.
1850 /// For subcommands, see [`Command::subcommand_help_heading`]
1871 /// Replaces an argument or subcommand used on the CLI at runtime with other arguments or subcommands.
1879 /// This can be used to create "shortcuts" for subcommands, or if a
1993 /// **NOTE:** [`subcommands`] count as arguments
2003 /// [`subcommands`]: crate::Command::subcommand()
2244 /// alias. This is more efficient and easier than creating multiple hidden subcommands as one
2279 /// and easier than creating multiple hidden subcommands as one only needs to check for the
2306 /// and easier than creating multiple hidden subcommands as one only needs to check for the
2332 /// given aliases. This is more efficient, and easier than creating multiple hidden subcommands
2364 /// Add aliases, which function as "hidden" short flag subcommands.
2367 /// and easier than creating multiple hidden subcommands as one only needs to check for the
2392 /// Add aliases, which function as "hidden" long flag subcommands.
2395 /// and easier than creating multiple hidden subcommands as one only needs to check for the
2423 /// than creating hidden subcommands as one only needs to check for
2459 /// and easier than creating multiple hidden subcommands as one only needs to check for the
2489 /// and easier than creating multiple hidden subcommands as one only needs to check for the
2519 /// than creating multiple hidden subcommands as one only needs to check for
2549 /// Add aliases, which function as *visible* short flag subcommands.
2573 /// Add aliases, which function as *visible* long flag subcommands.
2604 /// This is helpful when one would like to emphasize frequently used subcommands, or prioritize
2607 /// **NOTE:** The default is 999 for all subcommands.
2615 /// .subcommand(Command::new("alpha") // typically subcommands are grouped
2619 /// // all other 999 subcommands
2624 /// // Any other subcommands with a value of 1 will be displayed
2805 /// [`subcommands`]: crate::Command::subcommand()
2814 /// Specifies that use of an argument prevents the use of [`subcommands`].
2816 /// By default `clap` allows arguments between subcommands such
2835 /// [`subcommands`]: crate::Command::subcommand()
2844 /// Prevent subcommands from being consumed as an arguments value.
2903 /// Allows [`subcommands`] to override all requirements of the parent command.
2947 /// [`subcommands`]: crate::Command::subcommand()
2973 /// - Help and errors to report subcommands as if they were the top-level command
2994 /// **NOTE:** Applets are slightly semantically different from subcommands,
3011 /// The names of the immediate subcommands of the Command
3041 /// the subcommands must be defined both in the top-level Command
3042 /// and as subcommands of the "main" applet.
3055 /// .subcommands(applet_commands()),
3057 /// .subcommands(applet_commands());
3059 /// // its applets can be matched as subcommands.
3080 /// Sets the value name used for subcommands when printing usage and help.
3144 /// Sets the help heading used for subcommands when printing usage and help.
3370 /// Iterate through the set of subcommands, getting a reference to each.
3373 self.subcommands.iter()
3376 /// Iterate through the set of subcommands, getting a mutable reference to each.
3379 self.subcommands.iter_mut()
3382 /// Returns `true` if this `Command` has subcommands.
3385 !self.subcommands.is_empty()
3388 /// Returns the help heading for listing subcommands.
3400 /// Returns the help heading for listing subcommands.
3406 /// Returns the help heading for listing subcommands.
3412 /// Returns the help heading for listing subcommands.
3418 /// Returns the help heading for listing subcommands.
3426 /// This does not recurse through subcommands of subcommands.
3436 /// This does not recurse through subcommands of subcommands.
3502 // Get a unique list of all arguments of all commands and continuous subcommands the given argument conflicts with.
3532 // Get a list of subcommands which contain the provided Argument
3534 // This command will only include subcommands in its list for which the subcommands
3538 // It is useful to finding subcommands, that have inherited a global argument.
3547 for idx in 0..self.subcommands.len() {
3548 if self.subcommands[idx]
3553 vec.push(&self.subcommands[idx]);
3554 vec.append(&mut self.subcommands[idx].get_subcommands_containing(arg));
3788 // If there are global arguments, or settings we need to propagate them down to subcommands
3943 let sc = some!(self.subcommands.iter_mut().find(|s| s.name == name));
4037 for mut sc in &mut self.subcommands {
4143 for sub_app in &self.subcommands {
4171 for sc in &mut self.subcommands {
4175 // `myapp help subcmd <TAB>`, which should only suggest subcommands and not args,
4203 let mut subcommands = std::mem::take(&mut self.subcommands);
4204 for sc in &mut subcommands {
4207 self.subcommands = subcommands;
4276 .subcommands(self.get_subcommands().map(Command::_copy_subtree_for_help));
4306 self.subcommands.push(help_subcmd);
4315 .subcommands(self.get_subcommands().map(Command::_copy_subtree_for_help));
4403 self.subcommands
4455 /// Iterate through all the names of all subcommands (not recursively), including aliases.
4656 subcommands: Default::default(),