repo string | pull_number int64 | instance_id string | issue_numbers sequence | base_commit string | patch string | test_patch string | problem_statement string | hints_text string | created_at string | updated_at string | version string | environment_setup_commit string | FAIL_TO_PASS sequence | PASS_TO_PASS sequence | FAIL_TO_FAIL sequence | PASS_TO_FAIL sequence |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
clap-rs/clap | 2,635 | clap-rs__clap-2635 | [
"1694"
] | 476dd190b7f7a91926dc696f1cb80146c67aabd2 | diff --git a/clap_derive/src/attrs.rs b/clap_derive/src/attrs.rs
--- a/clap_derive/src/attrs.rs
+++ b/clap_derive/src/attrs.rs
@@ -339,35 +339,37 @@ impl Attrs {
VerbatimDocComment(ident) => self.verbatim_doc_comment = Some(ident),
- DefaultValue(ident, lit) => {
- ... | diff --git a/clap_derive/tests/arg_enum.rs b/clap_derive/tests/arg_enum.rs
--- a/clap_derive/tests/arg_enum.rs
+++ b/clap_derive/tests/arg_enum.rs
@@ -60,7 +60,7 @@ fn default_value() {
#[derive(Clap, PartialEq, Debug)]
struct Opt {
- #[clap(arg_enum, default_value)]
+ #[clap(arg_enum, default... | Specify defaults in terms of the underlying type rather than strings
I really like how the new clap v3 is shaping up! Now that structopt is integrated, it'd be great if defaults could be specified in terms of the default resulting value they produce rather than as a string. Other argument parsing libraries like Python'... | Could you provide a small example so we are on the same page? Thanks
e.g.
```rust
enum Switch {
Magic,
MoreMagic,
}
impl FromStr for Switch {
// ...
}
#[derive(Clap)]
struct Opts {
#[clap(default_value(Switch::MoreMagic))]
switch: Switch,
}
```
Currently you have to do e.g. `#... | 2021-07-28T15:29:45Z | 2021-08-13T18:54:25Z | 0.14 | a0ab35d678d797041aad20ff9e99ddaa52b84e24 | [
"app_name_in_long_version_from_enum",
"app_name_in_long_version_from_struct",
"app_name_in_short_version_from_enum",
"app_name_in_short_version_from_struct",
"app_name_in_long_help_from_enum",
"app_name_in_long_help_from_struct",
"app_name_in_short_help_from_struct",
"app_name_in_short_help_from_enum"... | [] | [] | [] |
clap-rs/clap | 2,633 | clap-rs__clap-2633 | [
"2632"
] | 35db529b36e384f191ac2902b8c4ccf2a655d8ab | diff --git a/clap_derive/src/derives/args.rs b/clap_derive/src/derives/args.rs
--- a/clap_derive/src/derives/args.rs
+++ b/clap_derive/src/derives/args.rs
@@ -231,7 +231,15 @@ pub fn gen_augment(
_ => quote!(),
};
- let value_name = attrs.value_name();
+ ... | diff --git a/clap_derive/tests/arguments.rs b/clap_derive/tests/arguments.rs
--- a/clap_derive/tests/arguments.rs
+++ b/clap_derive/tests/arguments.rs
@@ -86,7 +86,7 @@ fn arguments_safe() {
}
#[test]
-fn value_name() {
+fn auto_value_name() {
#[derive(Clap, PartialEq, Debug)]
struct Opt {
my_spe... | When setting `value_name`, argument parsing fails
### Please complete the following tasks
- [X] I have searched the [discussions](https://github.com/clap-rs/clap/discussions)
- [X] I have searched the existing issues
### Rust Version
rustc 1.53.0 (53cb7b09b 2021-06-17)
### Clap Version
5fbd764
### Mi... | @rami3l created this to split the conversation out
Oh, weird, `value_name` **appends**
This isn't documented
> Specifies the name for value of option or positional arguments inside of help documentation. This name is cosmetic only, the name is not used to access arguments. This setting can be very helpful when de... | 2021-07-28T14:49:03Z | 2021-07-30T13:32:53Z | 0.14 | a0ab35d678d797041aad20ff9e99ddaa52b84e24 | [
"explicit_value_name"
] | [
"arguments",
"optional_argument",
"argument_with_default",
"auto_value_name",
"required_argument",
"arguments_safe"
] | [] | [] |
clap-rs/clap | 2,611 | clap-rs__clap-2611 | [
"2608"
] | 610d56d1c63042359d6181c89572e894274f4ae7 | diff --git a/clap_derive/src/attrs.rs b/clap_derive/src/attrs.rs
--- a/clap_derive/src/attrs.rs
+++ b/clap_derive/src/attrs.rs
@@ -791,6 +791,10 @@ impl Attrs {
self.name.clone().translate(*self.casing)
}
+ pub fn value_name(&self) -> TokenStream {
+ self.name.clone().translate(CasingStyle::Sc... | diff --git a/clap_derive/tests/arguments.rs b/clap_derive/tests/arguments.rs
--- a/clap_derive/tests/arguments.rs
+++ b/clap_derive/tests/arguments.rs
@@ -13,6 +13,7 @@
// MIT/Apache 2.0 license.
use clap::Clap;
+use clap::IntoApp;
#[test]
fn required_argument() {
diff --git a/clap_derive/tests/arguments.rs b/c... | value name with clap_derive doesn't follow common practices
### Please complete the following tasks
- [X] I have searched the [discussions](https://github.com/clap-rs/clap/discussions)
- [X] I have searched the existing issues
### Rust Version
rustc 1.53.0 (53cb7b09b 2021-06-17)
### Clap Version
3.0.0-beta.2
### ... | 2021-07-21T16:59:25Z | 2021-07-28T13:53:13Z | 0.14 | a0ab35d678d797041aad20ff9e99ddaa52b84e24 | [
"value_name"
] | [
"optional_argument",
"argument_with_default",
"required_argument",
"arguments_safe",
"arguments"
] | [] | [] | |
clap-rs/clap | 2,609 | clap-rs__clap-2609 | [
"2580"
] | 8ff68080e65e70929df030fedf94f28c6f7fe06c | diff --git a/src/parse/validator.rs b/src/parse/validator.rs
--- a/src/parse/validator.rs
+++ b/src/parse/validator.rs
@@ -681,8 +681,11 @@ impl<'help, 'app, 'parser> Validator<'help, 'app, 'parser> {
let used: Vec<Id> = matcher
.arg_names()
.filter(|n| {
+ // Filter ou... | diff --git a/tests/default_vals.rs b/tests/default_vals.rs
--- a/tests/default_vals.rs
+++ b/tests/default_vals.rs
@@ -1,3 +1,4 @@
+mod utils;
use clap::{App, Arg, ErrorKind};
#[test]
diff --git a/tests/default_vals.rs b/tests/default_vals.rs
--- a/tests/default_vals.rs
+++ b/tests/default_vals.rs
@@ -588,6 +589,30... | Incorrect usage output if default_value is used
### Please complete the following tasks
- [X] I have searched the [discussions](https://github.com/clap-rs/clap/discussions)
- [X] I have searched the existing issues
### Rust Version
rustc 1.53.0 (53cb7b09b 2021-06-17)
### Clap Version
3.0.0-beta.2
### Minimal repr... | 2021-07-20T18:51:56Z | 2021-07-25T13:48:50Z | 0.14 | a0ab35d678d797041aad20ff9e99ddaa52b84e24 | [
"default_vals_donnot_show_in_smart_usage"
] | [
"build::app::settings::test::app_settings_fromstr",
"build::app::tests::app_send_sync",
"build::app::tests::global_setting",
"build::app::tests::global_settings",
"build::app::tests::global_version",
"build::arg::test::flag_display",
"build::arg::settings::test::arg_settings_fromstr",
"build::app::tes... | [] | [] | |
clap-rs/clap | 2,587 | clap-rs__clap-2587 | [
"2005"
] | 62588bd82c16e081469b195d005103319adda220 | diff --git a/clap_derive/src/attrs.rs b/clap_derive/src/attrs.rs
--- a/clap_derive/src/attrs.rs
+++ b/clap_derive/src/attrs.rs
@@ -25,7 +25,7 @@ use proc_macro_error::abort;
use quote::{quote, quote_spanned, ToTokens};
use syn::{
self, ext::IdentExt, spanned::Spanned, Attribute, Expr, Field, Ident, LitStr, MetaN... | diff --git a/clap_derive/tests/subcommands.rs b/clap_derive/tests/subcommands.rs
--- a/clap_derive/tests/subcommands.rs
+++ b/clap_derive/tests/subcommands.rs
@@ -290,52 +290,26 @@ fn external_subcommand_optional() {
assert_eq!(Opt::try_parse_from(&["test"]).unwrap(), Opt { sub: None });
}
-// #[test]
-// #[ign... | Use enum as subcommands in a subcommand
### Make sure you completed the following tasks
- [x] Searched the [discussions](https://github.com/clap-rs/clap/discussions)
- [x] Searched the closes issues
### Code
```rust
use clap::Clap;
#[derive(Clap)]
enum App {
Build,
Config(Config),
}
#[deriv... | OK, got it.
Some (modified) code from discussions that works:
```rust
#[derive(Clap)]
pub struct App {
#[clap(long = "verbose")]
verbose: bool,
// ...
#[clap(subcommand)]
subcommand: Subcommand,
}
#[derive(Clap)]
pub enum Subcommand {
Config(Config)
// ...
}
// THIS "SHIM" STRUCT I... | 2021-07-14T17:43:21Z | 2021-07-16T20:39:12Z | 0.14 | a0ab35d678d797041aad20ff9e99ddaa52b84e24 | [
"external_subcommand_optional",
"global_passed_down",
"external_subcommand_os_string",
"test_hyphenated_subcommands",
"test_fetch",
"test_add",
"test_null_commands",
"external_subcommand",
"test_no_parse",
"test_tuple_commands"
] | [] | [] | [] |
clap-rs/clap | 2,534 | clap-rs__clap-2534 | [
"2533"
] | 33c305ea6ff6cdda7796e57966374cb40633968f | diff --git a/src/output/help.rs b/src/output/help.rs
--- a/src/output/help.rs
+++ b/src/output/help.rs
@@ -858,10 +858,6 @@ impl<'help, 'app, 'parser, 'writer> Help<'help, 'app, 'parser, 'writer> {
}
if !custom_headings.is_empty() {
for heading in custom_headings {
- ... | diff --git a/tests/help.rs b/tests/help.rs
--- a/tests/help.rs
+++ b/tests/help.rs
@@ -1944,6 +1944,64 @@ fn multiple_custom_help_headers() {
));
}
+static CUSTOM_HELP_SECTION_HIDDEN_ARGS: &str = "blorp 1.4
+
+Will M.
+
+does stuff
+
+USAGE:
+ test --song <song> --song-volume <volume>
+
+FLAGS:
+ -h, --he... | Help heading is printed when all args are hidden
### Please complete the following tasks
- [X] I have searched the [discussions](https://github.com/clap-rs/clap/discussions)
- [X] I have searched the existing issues
### Rust Version
rustc 1.52.0 (88f19c6da 2021-05-03)
### Clap Version
master (585a7c955)
### Minim... | 2021-06-12T03:26:59Z | 2021-08-16T23:56:04Z | 0.14 | a0ab35d678d797041aad20ff9e99ddaa52b84e24 | [
"custom_help_headers_hidden_args"
] | [
"build::app::settings::test::app_settings_fromstr",
"build::app::tests::app_send_sync",
"build::app::tests::global_setting",
"build::app::tests::global_settings",
"build::app::tests::propagate_version",
"build::app::tests::issue_2090",
"build::arg::settings::test::arg_settings_fromstr",
"build::arg::t... | [] | [] | |
clap-rs/clap | 2,529 | clap-rs__clap-2529 | [
"2528"
] | e3bfa50e8f451b31a00d99147d608607521419a3 | diff --git a/clap_derive/src/derives/arg_enum.rs b/clap_derive/src/derives/arg_enum.rs
--- a/clap_derive/src/derives/arg_enum.rs
+++ b/clap_derive/src/derives/arg_enum.rs
@@ -118,7 +118,7 @@ fn gen_from_str(lits: &[(TokenStream, Ident)]) -> TokenStream {
match input {
#(val if func(val, ... | diff --git a/clap_derive/tests/arg_enum.rs b/clap_derive/tests/arg_enum.rs
--- a/clap_derive/tests/arg_enum.rs
+++ b/clap_derive/tests/arg_enum.rs
@@ -7,7 +7,7 @@
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to th... | Derived ArgEnum::from_str should not panic on invalid input
### Please complete the following tasks
- [X] I have searched the [discussions](https://github.com/clap-rs/clap/discussions)
- [X] I have searched the existing issues
### Rust Version
rustc 1.52.1
### Clap Version
clap 3.0.0-beta.2
### Minimal reproduci... | 2021-06-08T17:55:41Z | 2021-06-08T23:12:09Z | 0.13 | 947523f7f5c25579affa3f8c0499ff362d523611 | [
"from_str_invalid"
] | [
"alias",
"case_insensitive",
"casing_is_propogated_from_parent",
"case_insensitive_set_to_false",
"multiple_alias",
"casing_propogation_is_overridden",
"variant_with_defined_casing",
"basic",
"multi_word_is_renamed_kebab",
"option",
"vector"
] | [] | [] | |
clap-rs/clap | 2,358 | clap-rs__clap-2358 | [
"2181"
] | 90a74044ee03963f9d4c4453ce651dc907bc94d4 | "diff --git a/clap_derive/src/derives/clap.rs b/clap_derive/src/derives/clap.rs\n--- a/clap_derive/s(...TRUNCATED) | "diff --git /dev/null b/clap_derive/tests/app_name.rs\nnew file mode 100644\n--- /dev/null\n+++ b/cl(...TRUNCATED) | "clap_derive does not respect name attribute for enums\n### Code\r\n\r\n```rust\r\nuse clap::Clap;\r(...TRUNCATED) | @logansquirel This is a good one. | 2021-02-22T14:19:45Z | 2021-02-22T16:08:07Z | 0.13 | 947523f7f5c25579affa3f8c0499ff362d523611 | ["app_name_in_long_version_from_enum","app_name_in_short_version_from_enum","app_name_in_long_help_f(...TRUNCATED) | ["app_name_in_long_version_from_struct","app_name_in_short_version_from_struct","app_name_in_long_he(...TRUNCATED) | [] | [] |
clap-rs/clap | 2,329 | clap-rs__clap-2329 | [
"2308"
] | 3b59f5d3699134190d8d5f7fb052418edfd4999f | "diff --git a/src/parse/parser.rs b/src/parse/parser.rs\n--- a/src/parse/parser.rs\n+++ b/src/parse/(...TRUNCATED) | "diff --git a/tests/flags.rs b/tests/flags.rs\n--- a/tests/flags.rs\n+++ b/tests/flags.rs\n@@ -146,3(...TRUNCATED) | "Using >2 dashes shows 2 dashes in the help menu.\n### Make sure you completed the following tasks\r(...TRUNCATED) | 2021-02-06T11:30:11Z | 2021-02-06T16:50:46Z | 0.4 | 3b59f5d3699134190d8d5f7fb052418edfd4999f | [
"issue_2308_multiple_dashes"
] | ["build::app::tests::app_send_sync","build::app::settings::test::app_settings_fromstr","build::app::(...TRUNCATED) | [] | [] | |
clap-rs/clap | 2,253 | clap-rs__clap-2253 | [
"1385"
] | 76effbd8f9d76df99b87826a2e8ec1b9960851b2 | "diff --git a/src/build/app/mod.rs b/src/build/app/mod.rs\n--- a/src/build/app/mod.rs\n+++ b/src/bui(...TRUNCATED) | "diff --git a/tests/global_args.rs b/tests/global_args.rs\n--- a/tests/global_args.rs\n+++ b/tests/g(...TRUNCATED) | "Global args on subcommands do not get propagated to sub-subcommands\n<!--\r\nPlease use the followi(...TRUNCATED) | "When you say its a global arg, it means you can specify it in any subcommand, not that you actually(...TRUNCATED) | 2020-12-12T13:42:53Z | 2020-12-18T16:13:33Z | 0.4 | 3b59f5d3699134190d8d5f7fb052418edfd4999f | ["propagate_global_arg_in_subcommand_to_subsubcommand_1385","propagate_global_arg_in_subcommand_to_s(...TRUNCATED) | ["build::app::tests::app_send_sync","build::app::settings::test::app_settings_fromstr","build::app::(...TRUNCATED) | [] | [] |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 39