Repository: clap-rs/clap
Pull request #1686 (2020-02-10 18:26:50)

Use 'Clap Maintainers' as authors

CreepySkeleton: bors merge
bors[bot]: :clock1: Waiting for PR status (Github check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set.
bors[bot]: :-1: Rejected by PR status

Patch:
diff --git a/Cargo.toml b/Cargo.toml
index 610a5b50..ecbafd3b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,7 +2,10 @@
 name = "clap"
 version = "3.0.0-beta.1"
 edition = "2018"
-authors = ["Kevin K. <kbknapp@gmail.com>"]
+authors = [
+	"Kevin K. <kbknapp@gmail.com>",
+	"Clap Maintainers"
+]
 include = [
 	"src/**/*",
 	"Cargo.toml",
diff --git a/clap_derive/Cargo.toml b/clap_derive/Cargo.toml
index a4734eef..54d28e64 100644
--- a/clap_derive/Cargo.toml
+++ b/clap_derive/Cargo.toml
@@ -4,8 +4,7 @@ version = "3.0.0-beta.1"
 edition = "2018"
 authors = [
 	"Guillaume Pinot <texitoi@texitoi.eu>",
-	"Kevin K. <kbknapp@gmail.com>",
-	"hoverbear <andrew@hoverbear.org>"
+	"Clap Maintainers"
 ]
 include = [
 	"src/**/*",
@@ -44,7 +43,7 @@ proc-macro-error = "0.4.3"
 
 [dev-dependencies]
 clap = { path = "../", version = "3.0.0-beta.1" }
-trybuild = "1.0.5"
+trybuild = "1.0"
 rustversion = "1"
 version-sync = "0.8"
 
diff --git a/clap_generate/Cargo.toml b/clap_generate/Cargo.toml
index e7caa6c1..f6cc343b 100644
--- a/clap_generate/Cargo.toml
+++ b/clap_generate/Cargo.toml
@@ -4,7 +4,7 @@ version = "3.0.0-beta.1"
 edition = "2018"
 authors = [
 	"Kevin K. <kbknapp@gmail.com>",
-	"Pavan Kumar Sunkara <pavan.sss1991@gmail.com>",
+	"Clap Maintainers"
 ]
 include = [
 	"src/**/*",
diff --git a/clap_generate/src/generators/mod.rs b/clap_generate/src/generators/mod.rs
index 3dd8fe18..483b920e 100644
--- a/clap_generate/src/generators/mod.rs
+++ b/clap_generate/src/generators/mod.rs
@@ -4,7 +4,7 @@ mod shells;
 use std::io::Write;
 
 // Internal
-use clap::*;
+use clap::{find_subcmd, flags, match_alias, subcommands, App, AppSettings, Arg};
 pub use shells::*;
 
 /// Generator trait which can be used to write generators
@@ -265,7 +265,7 @@ mod tests {
     #[test]
     fn test_find_subcommand_with_path() {
         let app = common();
-        let sc_app = Foo::find_subcommand_with_path(&app, "test config".split(" ").collect());
+        let sc_app = Foo::find_subcommand_with_path(&app, "test config".split(' ').collect());
 
         assert_eq!(sc_app.name, "config");
     }
diff --git a/clap_generate/src/lib.rs b/clap_generate/src/lib.rs
index bd6b4925..dfa625bf 100644
--- a/clap_generate/src/lib.rs
+++ b/clap_generate/src/lib.rs
@@ -107,9 +107,11 @@ pub use generators::Generator;
 ///     };
 ///
 ///     let mut app = build_cli();
-///     generate_to::<Bash, _>(&mut app,     // We need to specify what generator to use
-///                            "myapp",      // We need to specify the bin name manually
-///                            outdir);      // We need to specify where to write to
+///     generate_to::<Bash, _, _>(
+///         &mut app,     // We need to specify what generator to use
+///         "myapp",      // We need to specify the bin name manually
+///         outdir,       // We need to specify where to write to
+///     );
 /// }
 /// ```
 ///
diff --git a/src/build/app/mod.rs b/src/build/app/mod.rs
index dc835e5d..10a488ed 100644
--- a/src/build/app/mod.rs
+++ b/src/build/app/mod.rs
@@ -1461,31 +1461,6 @@ impl<'b> App<'b> {
         debug_assert!(self._app_debug_asserts());
         self.args._build();
         self.settings.set(AppSettings::Built);
-        Self::_panic_on_missing_help(&self, self.g_settings.is_set(AppSettings::HelpRequired));
-    }
-
-    #[cfg(not(debug_assertions))]
-    fn _panic_on_missing_help(app: &App, help_required_globally: bool) {}
-
-    #[cfg(debug_assertions)]
-    fn _panic_on_missing_help(app: &App, help_required_globally: bool) {
-        if app.is_set(AppSettings::HelpRequired) || help_required_globally {
-            let args_missing_help: Vec<String> = app
-                .args
-                .args
-                .iter()
-                .filter(|arg| arg.help.is_none() && arg.long_help.is_none())
-                .map(|arg| String::from(arg.name))
-                .collect();
-
-            if !args_missing_help.is_empty() {
-                let abort_message = format!("AppSettings::HelpRequired is enabled for the App {}, but at least one of its arguments does not have either `help` or `long_help` set. List of such arguments: {}", app.name, args_missing_help.join(", "));
-                panic!(abort_message);
-            }
-        }
-        for sub_app in &app.subcommands {
-            Self::_panic_on_missing_help(&sub_app, help_required_globally);
-        }
     }
 
     // Perform some expensive assertions on the Parser itself
diff --git a/src/build/app/settings.rs b/src/build/app/settings.rs
index 24336a35..3e3bfa3e 100644
--- a/src/build/app/settings.rs
+++ b/src/build/app/settings.rs
@@ -46,7 +46,6 @@ bitflags! {
         const INFER_SUBCOMMANDS    = 1 << 37;
         const CONTAINS_LAST        = 1 << 38;
         const ARGS_OVERRIDE_SELF   = 1 << 39;
-        const HELP_REQUIRED        = 1 << 40;
     }
 }
 
@@ -113,8 +112,6 @@ impl_settings! { AppSettings, AppFlags,
         => Flags::GLOBAL_VERSION,
     HidePossibleValuesInHelp("hidepossiblevaluesinhelp")
         => Flags::NO_POS_VALUES,
-    HelpRequired("helprequired")
-        => Flags::HELP_REQUIRED,
     Hidden("hidden")
         => Flags::HIDDEN,
     LowIndexMultiplePositional("lowindexmultiplepositional")
@@ -658,37 +655,6 @@ pub enum AppSettings {
     /// This can be useful if there are many values, or they are explained elsewhere.
     HidePossibleValuesInHelp,
 
-    /// Tells `clap` to panic if help strings are omitted
-    ///  
-    /// # Examples
-    ///
-    /// ```rust
-    /// # use clap::{App, Arg, AppSettings};
-    /// App::new("myprog")
-    ///     .setting(AppSettings::HelpRequired)
-    ///     .arg(
-    ///         Arg::with_name("foo").help("It does foo stuff")
-    ///         // As required via AppSettings::HelpRequired, a help message was supplied
-    ///      )
-    /// #    .get_matches();
-    /// ```
-    ///
-    /// # Panics
-    ///
-    /// ```rust,should_panic
-    /// # use clap::{App, Arg, AppSettings};
-    /// App::new("myapp")
-    ///     .setting(AppSettings::HelpRequired)
-    ///     .arg(
-    ///         Arg::with_name("foo")
-    ///         // Someone forgot to put .help("...") here
-    ///         // Since the setting AppSettings::HelpRequired is activated, this will lead to
-    ///         // a panic (if you are in debug mode)
-    ///     )
-    /// #   .get_matches();
-    ///```
-    HelpRequired,
-
     /// Tries to match unknown args to partial [`subcommands`] or their [aliases]. For example to
     /// match a subcommand named `test`, one could use `t`, `te`, `tes`, and `test`.
     ///
@@ -1062,10 +1028,6 @@ mod test {
             "hidepossiblevaluesinhelp".parse::<AppSettings>().unwrap(),
             AppSettings::HidePossibleValuesInHelp
         );
-        assert_eq!(
-            "helprequired".parse::<AppSettings>().unwrap(),
-            AppSettings::HelpRequired
-        );
         assert_eq!(
             "lowindexmultiplePositional".parse::<AppSettings>().unwrap(),
             AppSettings::LowIndexMultiplePositional


Test patch:
diff --git a/clap_derive/tests/author_version_about.rs b/clap_derive/tests/author_version_about.rs
index 051315d4..e9850f7c 100644
--- a/clap_derive/tests/author_version_about.rs
+++ b/clap_derive/tests/author_version_about.rs
@@ -35,7 +35,7 @@ fn use_env() {
 
     let output = get_long_help::<Opt>();
     assert!(output.starts_with("clap_derive"));
-    assert!(output.contains("Guillaume Pinot <texitoi@texitoi.eu>, Kevin K. <kbknapp@gmail.com>"));
+    assert!(output.contains("Guillaume Pinot <texitoi@texitoi.eu>, Clap Maintainers"));
     assert!(output.contains("Parse command line argument by defining a struct, derive crate"));
 }
 
diff --git a/tests/app_from_crate.rs b/tests/app_from_crate.rs
index 2129a0dd..91ab0e67 100644
--- a/tests/app_from_crate.rs
+++ b/tests/app_from_crate.rs
@@ -1,7 +1,7 @@
 use clap::{app_from_crate, ErrorKind};
 
 static EVERYTHING: &str = "clap {{version}}
-Kevin K. <kbknapp@gmail.com>
+Kevin K. <kbknapp@gmail.com>:Clap Maintainers
 A simple to use, efficient, and full-featured Command Line Argument Parser
 
 USAGE:
diff --git a/tests/cargo.rs b/tests/cargo.rs
index 9fe2234e..daf94d02 100644
--- a/tests/cargo.rs
+++ b/tests/cargo.rs
@@ -12,7 +12,7 @@ FLAGS:
 ";
 
 static AUTHORS_ONLY: &str = "prog 1
-Kevin K. <kbknapp@gmail.com>
+Kevin K. <kbknapp@gmail.com>:Clap Maintainers
 
 USAGE:
     prog
diff --git a/tests/help.rs b/tests/help.rs
index 2ab68747..d7f9f92d 100644
--- a/tests/help.rs
+++ b/tests/help.rs
@@ -1568,86 +1568,3 @@ fn issue_1487() {
             .required(true));
     assert!(utils::compare_output(app, "ctest -h", ISSUE_1487, false));
 }
-
-#[test]
-#[should_panic]
-fn help_required_but_not_given() {
-    App::new("myapp")
-        .setting(AppSettings::HelpRequired)
-        .arg(Arg::with_name("foo"))
-        .get_matches();
-}
-
-#[test]
-#[should_panic]
-fn help_required_but_not_given_settings_after_args() {
-    App::new("myapp")
-        .arg(Arg::with_name("foo"))
-        .setting(AppSettings::HelpRequired)
-        .get_matches();
-}
-
-#[test]
-#[should_panic]
-fn help_required_but_not_given_for_one_of_two_arguments() {
-    App::new("myapp")
-        .setting(AppSettings::HelpRequired)
-        .arg(Arg::with_name("foo"))
-        .arg(Arg::with_name("bar").help("It does bar stuff"))
-        .get_matches();
-}
-
-#[test]
-fn help_required_locally_but_not_given_for_subcommand() {
-    App::new("myapp")
-        .setting(AppSettings::HelpRequired)
-        .arg(Arg::with_name("foo").help("It does foo stuff"))
-        .subcommand(
-            App::new("bar")
-                .arg(Arg::with_name("create").help("creates bar"))
-                .arg(Arg::with_name("delete")),
-        )
-        .get_matches();
-}
-
-#[test]
-#[should_panic]
-fn help_required_globally_but_not_given_for_subcommand() {
-    App::new("myapp")
-        .global_setting(AppSettings::HelpRequired)
-        .arg(Arg::with_name("foo").help("It does foo stuff"))
-        .subcommand(
-            App::new("bar")
-                .arg(Arg::with_name("create").help("creates bar"))
-                .arg(Arg::with_name("delete")),
-        )
-        .get_matches();
-}
-
-#[test]
-fn help_required_and_given_for_subcommand() {
-    App::new("myapp")
-        .setting(AppSettings::HelpRequired)
-        .arg(Arg::with_name("foo").help("It does foo stuff"))
-        .subcommand(
-            App::new("bar")
-                .arg(Arg::with_name("create").help("creates bar"))
-                .arg(Arg::with_name("delete").help("deletes bar")),
-        )
-        .get_matches();
-}
-
-#[test]
-fn help_required_and_given() {
-    App::new("myapp")
-        .setting(AppSettings::HelpRequired)
-        .arg(Arg::with_name("foo").help("It does foo stuff"))
-        .get_matches();
-}
-
-#[test]
-fn help_required_and_no_args() {
-    App::new("myapp")
-        .setting(AppSettings::HelpRequired)
-        .get_matches();
-}