• Home
  • Raw
  • Download

Lines Matching +full:crate +full:- +full:example

8 /// # extern crate clap;
26 /// `"author1 lastname <author1@example.com>:author2 lastname <author2@example.com>"`
29 /// replacement string, so, for example,
31 /// `"author1 lastname <author1@example.com>,\nauthor2 lastname <author2@example.com>,\nauthor3 las…
37 /// # extern crate clap;
70 /// # extern crate clap;
89 /// When the crate name is set to something different from the package name,
91 /// See [the Cargo Book](https://doc.rust-lang.org/cargo/reference/environment-variables.html)
98 /// # extern crate clap;
115 /// **NOTE:** Changing the values in your `Cargo.toml` does not trigger a re-build automatically,
126 /// # extern crate clap;
135 $crate::command!($crate::crate_name!())
138 let mut cmd = $crate::Command::new($name).version($crate::crate_version!());
140 let author = $crate::crate_authors!();
145 let about = $crate::crate_description!();
188 "Single-letter identifier expected, got {}",
204 --$long:ident
208 …debug_assert!(!matches!($arg.get_action(), $crate::ArgAction::Append), "Flags should precede `...`…
211 let long = $crate::arg_impl! { @string $long };
215 let action = $crate::ArgAction::SetTrue;
219 let arg = $crate::arg_impl! {
227 --$long:literal
231 …debug_assert!(!matches!($arg.get_action(), $crate::ArgAction::Append), "Flags should precede `...`…
234 let long = $crate::arg_impl! { @string $long };
238 let action = $crate::ArgAction::SetTrue;
242 let arg = $crate::arg_impl! {
250 -$short:ident
255 …debug_assert!(!matches!($arg.get_action(), $crate::ArgAction::Append), "Flags should precede `...`…
257 let action = $crate::ArgAction::SetTrue;
259 .short($crate::arg_impl! { @char $short })
261 let arg = $crate::arg_impl! {
269 -$short:literal
274 …debug_assert!(!matches!($arg.get_action(), $crate::ArgAction::Append), "Flags should precede `...`…
276 let action = $crate::ArgAction::SetTrue;
278 .short($crate::arg_impl! { @char $short })
280 let arg = $crate::arg_impl! {
291 …debug_assert!(!matches!($arg.get_action(), $crate::ArgAction::Append), "Flags should precede `...`…
300 let value_name = $crate::arg_impl! { @string $value_name };
306 .action($crate::ArgAction::Set);
307 let arg = $crate::arg_impl! {
318 …debug_assert!(!matches!($arg.get_action(), $crate::ArgAction::Append), "Flags should precede `...`…
327 let value_name = $crate::arg_impl! { @string $value_name };
333 .action($crate::ArgAction::Set);
334 let arg = $crate::arg_impl! {
345 …debug_assert!(!matches!($arg.get_action(), $crate::ArgAction::Append), "Flags should precede `...`…
356 let value_name = $crate::arg_impl! { @string $value_name };
362 .action($crate::ArgAction::Set);
363 let arg = $crate::arg_impl! {
374 …debug_assert!(!matches!($arg.get_action(), $crate::ArgAction::Append), "Flags should precede `...`…
385 let value_name = $crate::arg_impl! { @string $value_name };
391 .action($crate::ArgAction::Set);
392 let arg = $crate::arg_impl! {
404 $crate::ArgAction::Set => {
408 .action($crate::ArgAction::Append)
410 $arg.action($crate::ArgAction::Append)
413 $crate::ArgAction::SetTrue | $crate::ArgAction::Help | $crate::ArgAction::Version => {
414 $arg.action($crate::ArgAction::Count)
420 let arg = $crate::arg_impl! {
457 /// The name may be either a bare-word or a string, followed by a `:`, like `name:` or
467 /// See [`Arg::id`][crate::Arg::id].
471 /// A short flag is a `-` followed by either a bare-character or quoted character, like `-f` or
472 /// `-'f'`.
474 /// See [`Arg::short`][crate::Arg::short].
478 /// A long flag is a `--` followed by either a bare-word or a string, like `--foo` or
479 /// `--"foo"`.
481 /// **NOTE:** Dashes in the long name (e.g. `--foo-bar`) is not supported and quoting is required
482 /// (e.g. `--"foo-bar"`).
484 /// See [`Arg::long`][crate::Arg::long].
488 /// This is set by placing bare-word between:
489 /// - `[]` like `[FOO]`
490 /// - Positional argument: optional
491 /// - Named argument: optional value
492 /// - `<>` like `<FOO>`: required
494 /// See [`Arg::value_name`][crate::Arg::value_name].
501 /// See [`ArgAction::Count`][crate::ArgAction::Count] and [`ArgAction::Append`][crate::ArgAction::A…
514 /// arg!(--config <FILE> "a required file for the configuration and no short"),
515 /// arg!(-d --debug ... "turns on debugging information and allows multiples"),
519 /// let m = cmd.try_get_matches_from(["prog", "--config", "file.toml"]).unwrap();
524 /// [`Arg`]: crate::Arg
528 let arg = $crate::Arg::new($crate::arg_impl! { @string $name });
529 let arg = $crate::arg_impl! {
535 let arg = $crate::Arg::default();
536 let arg = $crate::arg_impl! {
553 pub(crate) fn empty() -> Self {
558 pub(crate) fn insert(&mut self, rhs: Self) {
563 pub(crate) fn remove(&mut self, rhs: Self) {
568 pub(crate) fn set(&mut self, s: $settings) {
578 pub(crate) fn unset(&mut self, s: $settings) {
588 pub(crate) fn is_set(&self, s: $settings) -> bool {
601 fn bitor(mut self, rhs: Self) -> Self::Output {
608 fn from(setting: $settings) -> Self {
618 fn bitor(mut self, rhs: $settings) -> Self::Output {
627 fn bitor(self, rhs: Self) -> Self::Output {
642 let mut styled = $crate::builder::StyledStr::new();
646 …let color = $crate::output::fmt::Colorizer::new($crate::output::fmt::Stream::Stderr, $crate::Color…