]> git.proxmox.com Git - rustc.git/blobdiff - src/vendor/clap/src/app/settings.rs
New upstream version 1.23.0+dfsg1
[rustc.git] / src / vendor / clap / src / app / settings.rs
index c77fe3e5362254f6d9edd81a52a16d5b9ea382c4..d1bba53fc752252482288dd8551616438c2d6593 100644 (file)
@@ -41,7 +41,7 @@ bitflags! {
         const ALLOW_MISSING_POS    = 1 << 33;
         const TRAILING_VALUES      = 1 << 34;
         const VALID_NEG_NUM_FOUND  = 1 << 35;
-        const PROPOGATED           = 1 << 36;
+        const PROPAGATED           = 1 << 36;
         const VALID_ARG_FOUND      = 1 << 37;
         const INFER_SUBCOMMANDS    = 1 << 38;
         const CONTAINS_LAST        = 1 << 39;
@@ -103,7 +103,7 @@ impl AppFlags {
         WaitOnError => WAIT_ON_ERROR,
         TrailingValues => TRAILING_VALUES,
         ValidNegNumFound => VALID_NEG_NUM_FOUND,
-        Propogated => PROPOGATED,
+        Propagated => PROPAGATED,
         ValidArgFound => VALID_ARG_FOUND,
         InferSubcommands => INFER_SUBCOMMANDS,
         ContainsLast => CONTAINS_LAST
@@ -588,18 +588,17 @@ pub enum AppSettings {
     /// ```
     NextLineHelp,
 
-    /// Specifies that the parser should propagate global arg's values down through any *used* child
-    /// subcommands. Meaning, if a subcommand wasn't used, the values won't be propagated down to
+    /// **DEPRECATED**: This setting is no longer required in order to propagate values up or down
+    /// 
+    /// Specifies that the parser should propagate global arg's values down or up through any *used*
+    /// child subcommands. Meaning, if a subcommand wasn't used, the values won't be propagated to 
     /// said subcommand.
     ///
-    /// **NOTE:** Values are only propagated *down* through futher child commands, not up
-    ///
     /// # Examples
     ///
     /// ```rust
     /// # use clap::{App, Arg, AppSettings, SubCommand};
     /// let m = App::new("myprog")
-    ///     .setting(AppSettings::PropagateGlobalValuesDown)
     ///     .arg(Arg::from_usage("[cmd] 'command to run'")
     ///         .global(true))
     ///     .subcommand(SubCommand::with_name("foo"))
@@ -616,7 +615,6 @@ pub enum AppSettings {
     /// ```rust
     /// # use clap::{App, Arg, AppSettings, SubCommand};
     /// let m = App::new("myprog")
-    ///     .setting(AppSettings::PropagateGlobalValuesDown)
     ///     .arg(Arg::from_usage("[cmd] 'command to run'")
     ///         .global(true))
     ///     .subcommand(SubCommand::with_name("foo"))
@@ -626,6 +624,7 @@ pub enum AppSettings {
     ///
     /// assert!(m.subcommand_matches("foo").is_none());
     /// ```
+    #[deprecated(since = "2.27.0", note = "No longer required to propagate values")]
     PropagateGlobalValuesDown,
 
     /// Allows [`SubCommand`]s to override all requirements of the parent command.
@@ -856,7 +855,7 @@ pub enum AppSettings {
     ValidNegNumFound,
 
     #[doc(hidden)]
-    Propogated,
+    Propagated,
 
     #[doc(hidden)]
     ValidArgFound,
@@ -901,7 +900,7 @@ impl FromStr for AppSettings {
             "waitonerror" => Ok(AppSettings::WaitOnError),
             "validnegnumfound" => Ok(AppSettings::ValidNegNumFound),
             "validargfound" => Ok(AppSettings::ValidArgFound),
-            "propogated" => Ok(AppSettings::Propogated),
+            "propagated" => Ok(AppSettings::Propagated),
             "trailingvalues" => Ok(AppSettings::TrailingValues),
             _ => Err("unknown AppSetting, cannot convert from str".to_owned()),
         }
@@ -976,8 +975,8 @@ mod test {
                    AppSettings::ValidNegNumFound);
         assert_eq!("validargfound".parse::<AppSettings>().unwrap(),
                    AppSettings::ValidArgFound);
-        assert_eq!("propogated".parse::<AppSettings>().unwrap(),
-                   AppSettings::Propogated);
+        assert_eq!("propagated".parse::<AppSettings>().unwrap(),
+                   AppSettings::Propagated);
         assert_eq!("trailingvalues".parse::<AppSettings>().unwrap(),
                    AppSettings::TrailingValues);
         assert_eq!("infersubcommands".parse::<AppSettings>().unwrap(),