repo
string
pull_number
int64
instance_id
string
issue_numbers
list
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
list
PASS_TO_PASS
list
FAIL_TO_FAIL
list
PASS_TO_FAIL
list
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 --- a/clap_derive/src/derives/clap.rs +++ b/clap_derive/src/derives/clap.rs @@ -68,7 +68,7 @@ fn gen_for_struct( } fn gen_for_enum(name: &Ident, attrs: &[Attribute], e: &DataEnum) -> TokenStream { - let into_app = into_app::gen_for_en...
diff --git /dev/null b/clap_derive/tests/app_name.rs new file mode 100644 --- /dev/null +++ b/clap_derive/tests/app_name.rs @@ -0,0 +1,97 @@ +use clap::Clap; +use clap::IntoApp; +#[test] +fn app_name_in_short_help_from_struct() { + #[derive(Clap)] + #[clap(name = "my-app")] + struct MyApp {} + + let mut hel...
clap_derive does not respect name attribute for enums ### Code ```rust use clap::Clap; #[derive(Clap)] #[clap(name = "mybin", version = clap::crate_version!())] enum Opts {} fn main() { Opts::parse(); } ``` Full repository here: https://github.com/newAM/clap-issue ### Steps to reproduce the iss...
@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_from_enum", "app_name_in_short_help_from_enum" ]
[ "app_name_in_long_version_from_struct", "app_name_in_short_version_from_struct", "app_name_in_long_help_from_struct", "app_name_in_short_help_from_struct" ]
[]
[]
clap-rs/clap
2,329
clap-rs__clap-2329
[ "2308" ]
3b59f5d3699134190d8d5f7fb052418edfd4999f
diff --git a/src/parse/parser.rs b/src/parse/parser.rs --- a/src/parse/parser.rs +++ b/src/parse/parser.rs @@ -1007,7 +1007,7 @@ impl<'help, 'app> Parser<'help, 'app> { self.cur_idx.set(self.cur_idx.get() + 1); debug!("Parser::parse_long_arg: Does it contain '='..."); - let long_arg = full_ar...
diff --git a/tests/flags.rs b/tests/flags.rs --- a/tests/flags.rs +++ b/tests/flags.rs @@ -146,3 +146,24 @@ fn issue_1284_argument_in_flag_style() { true )); } + +#[test] +fn issue_2308_multiple_dashes() { + static MULTIPLE_DASHES: &str = + "error: Found argument '-----' which wasn't expected, ...
Using >2 dashes shows 2 dashes in the help menu. ### Make sure you completed the following tasks ### Code This can be seen with cargo. Just run `cargo -----`, ### Actual Behavior Summary it will say, `error: Found argument '--' which wasn't expected, or isn't valid in this context`, 2 dashes, even with m...
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::tests::global_setting", "build::app::tests::global_settings", "build::app::tests::global_version", "build::app::tests::issue_2090", "build::arg::test::flag_display", "build::arg::test::flag_display_mul...
[]
[]
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 --- a/src/build/app/mod.rs +++ b/src/build/app/mod.rs @@ -2261,6 +2261,26 @@ impl<'help> App<'help> { // Internally used only impl<'help> App<'help> { + fn get_used_global_args(&self, matcher: &ArgMatcher) -> Vec<Id> { + let global_args: Vec<_> = se...
diff --git a/tests/global_args.rs b/tests/global_args.rs --- a/tests/global_args.rs +++ b/tests/global_args.rs @@ -29,3 +29,59 @@ fn issue_1076() { let _ = app.try_get_matches_from_mut(vec!["myprog"]); let _ = app.try_get_matches_from_mut(vec!["myprog"]); } + +#[test] +fn propagate_global_arg_in_subcommand_t...
Global args on subcommands do not get propagated to sub-subcommands <!-- Please use the following template to assist with creating an issue and to ensure a speedy resolution. If an area is not applicable, feel free to delete the area or mark with `N/A` --> ### Rust Version ~~~ rustc 1.30.1 (1433507eb 2018-11-0...
When you say its a global arg, it means you can specify it in any subcommand, not that you actually get that value in the subcommand. ```rust &["foo", "sub1", "sub1a", "--arg1", "v1"] ``` @CreepySkeleton Do you agree? @pksunkara Speaking for my personal intuition, I would expect global args to be accessible fro...
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_subsubcommand_2053" ]
[ "build::app::tests::app_send_sync", "build::app::settings::test::app_settings_fromstr", "build::app::tests::global_setting", "build::app::tests::global_settings", "build::app::tests::global_version", "build::arg::settings::test::arg_settings_fromstr", "build::arg::test::flag_display", "build::arg::tes...
[]
[]
clap-rs/clap
2,190
clap-rs__clap-2190
[ "1476" ]
d51c0b5a55030f826b302441d6eb2864b2e91ff1
diff --git a/src/build/arg/mod.rs b/src/build/arg/mod.rs --- a/src/build/arg/mod.rs +++ b/src/build/arg/mod.rs @@ -2724,19 +2724,15 @@ impl<'help> Arg<'help> { /// from the environment, if available. If it is not present in the environment, then default /// rules will apply. /// - /// **NOTE:** If the...
diff --git a/tests/env.rs b/tests/env.rs --- a/tests/env.rs +++ b/tests/env.rs @@ -8,7 +8,11 @@ fn env() { env::set_var("CLP_TEST_ENV", "env"); let r = App::new("df") - .arg(Arg::from("[arg] 'some opt'").env("CLP_TEST_ENV")) + .arg( + Arg::from("[arg] 'some opt'") + ....
Enable Arg::env also for options which do not take value ### Affected Version of clap 2.33.0 ### Feature Request Summary It would nice if Arg::env would work also for argument that do not take value. In this case is_present will mean that either: * Argument is present on command line, or * There is environme...
We don't need to backport this 2.x, so we can remove `W: 2.x` label. Here's what I propose: * `Arg::env` no longer implies `takes_value(true)`. It's up to user to set it. * If `env("ENV")` IS set: * if `takes_value(true)` IS NOT set (the arg is a flag), than the flag is considered raised if `ENV` is defined. Its p...
2020-10-30T18:14:56Z
2020-11-06T21:59:37Z
0.4
3b59f5d3699134190d8d5f7fb052418edfd4999f
[ "env_no_takes_value" ]
[ "build::app::settings::test::app_settings_fromstr", "build::app::tests::app_send_sync", "build::app::tests::global_setting", "build::arg::settings::test::arg_settings_fromstr", "build::app::tests::global_settings", "build::arg::test::flag_display", "build::app::tests::issue_2090", "build::app::tests::...
[]
[]
clap-rs/clap
2,182
clap-rs__clap-2182
[ "1205" ]
fad3d9632ebde36004455084df2c9052afe40855
diff --git a/src/build/app/debug_asserts.rs b/src/build/app/debug_asserts.rs --- a/src/build/app/debug_asserts.rs +++ b/src/build/app/debug_asserts.rs @@ -219,14 +219,27 @@ pub(crate) fn assert_app(app: &App) { group.name, ); - // Args listed inside groups should exist for arg in...
diff --git a/tests/default_vals.rs b/tests/default_vals.rs --- a/tests/default_vals.rs +++ b/tests/default_vals.rs @@ -493,7 +493,6 @@ fn issue_1050_num_vals_and_defaults() { .arg( Arg::new("exit-code") .long("exit-code") - .required(true) .takes_va...
A required `ArgGroup` is satisfied by a default value ### Rust Version * `1.24.1` ### Affected Version of clap * `2.31.1` ### Expected Behavior Summary I'd expect that an `ArgGroup` with `required(true)` would fail unless the user explicitly passed an argument, even if one of the arguments sets a `defaul...
Got into a discussion about this on IRC with @anp, pasting log: tl;dr: I still feel that `.required(true)` on an `ArgGroup` shouldn't count default values as present, but adding a distinct `.required_explicit(true)` with that behavior is a possible alternative. ```IRC <anp> eternaleye: doesn't seem like a bug to...
2020-10-24T08:48:01Z
2020-10-24T12:18:28Z
0.4
3b59f5d3699134190d8d5f7fb052418edfd4999f
[ "required_args_with_default_values", "required_groups_with_default_values" ]
[ "build::app::tests::global_setting", "build::app::tests::app_send_sync", "build::app::settings::test::app_settings_fromstr", "build::app::tests::global_version", "build::app::tests::global_settings", "build::arg::test::flag_display", "build::arg::test::flag_display_multiple_aliases", "build::arg::test...
[]
[]
clap-rs/clap
2,166
clap-rs__clap-2166
[ "2059" ]
9d2ef79512121c7b79eecea150403eaa49f54c3a
diff --git a/src/output/help.rs b/src/output/help.rs --- a/src/output/help.rs +++ b/src/output/help.rs @@ -210,9 +210,27 @@ impl<'help, 'app, 'parser, 'writer> Help<'help, 'app, 'parser, 'writer> { debug!("Help::write_args: New Longest...{}", self.longest); } let btm = ord_m.e...
diff --git a/tests/help.rs b/tests/help.rs --- a/tests/help.rs +++ b/tests/help.rs @@ -35,13 +35,13 @@ FLAGS: -V, --version Prints version information OPTIONS: - -O, --Option <option3> specific vals [possible values: fast, slow] --long-option-2 <option2> tests long options with exclu...
Default alphabetical sorting of options in help message appears to be broken ### 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 std::net::SocketAddr; use std::net::IpAddr; use st...
2020-10-10T16:45:40Z
2020-10-10T19:16:44Z
0.4
3b59f5d3699134190d8d5f7fb052418edfd4999f
[ "arg_short_conflict_with_help", "issue_760", "option_usage_order", "multiple_custom_help_headers", "complex_help_output", "hidden_short_args_long_help", "hidden_long_args_short_help", "hidden_long_args", "hidden_short_args" ]
[ "build::app::tests::app_send_sync", "build::app::tests::global_setting", "build::app::tests::global_settings", "build::app::settings::test::app_settings_fromstr", "build::app::tests::global_version", "build::arg::test::flag_display", "build::arg::settings::test::arg_settings_fromstr", "build::arg::tes...
[]
[]
clap-rs/clap
2,161
clap-rs__clap-2161
[ "2022" ]
4f90f3e4bb09cc596aa10243fc1791fc574a5d0e
diff --git a/src/build/app/mod.rs b/src/build/app/mod.rs --- a/src/build/app/mod.rs +++ b/src/build/app/mod.rs @@ -214,18 +214,26 @@ impl<'help> App<'help> { self.get_arguments().filter(|a| a.is_positional()) } - /// Iterate through the *flags* that don't have custom heading. - pub fn get_flags_wi...
diff --git a/tests/opts.rs b/tests/opts.rs --- a/tests/opts.rs +++ b/tests/opts.rs @@ -510,3 +510,12 @@ fn long_eq_val_starts_with_eq() { assert_eq!("=value", matches.value_of("opt").unwrap()); } + +#[test] +fn issue_2022_get_flags_misuse() { + let app = App::new("test") + .help_heading("test") + ...
Obscure panic with heading and default value ### 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; fn main() { #[derive(Clap)] #[clap(help_heading = "HEAD")] stru...
Equivalent code is: ```rust fn main() { let result = App::new("opt") .help_heading("HEAD") .arg(Arg::new("size").long("b")) .arg(Arg::new("a").long("a").default_value("32")) .get_matches(); eprintln!("{:#?}", result); } ``` That is not failing though. Looks like ...
2020-10-09T18:25:00Z
2020-10-12T08:43:51Z
0.4
3b59f5d3699134190d8d5f7fb052418edfd4999f
[ "issue_2022_get_flags_misuse" ]
[ "build::arg::test::positiona_display_mult", "build::arg::test::option_display1", "build::arg::test::option_display3", "build::arg::test::flag_display_multiple_short_aliases", "build::arg::test::option_display_single_alias", "build::app::tests::global_settings", "build::app::tests::global_setting", "bu...
[]
[]
clap-rs/clap
2,154
clap-rs__clap-2154
[ "1284" ]
6ce1e4fda211a7373ce7c4167964e6ca073bdfc1
diff --git a/src/parse/errors.rs b/src/parse/errors.rs --- a/src/parse/errors.rs +++ b/src/parse/errors.rs @@ -798,26 +798,32 @@ impl Error { c.warning(arg.clone()); c.none("' which wasn't expected, or isn't valid in this context"); - if let Some(s) = did_you_mean { + if let Some((flag...
diff --git a/tests/flags.rs b/tests/flags.rs --- a/tests/flags.rs +++ b/tests/flags.rs @@ -1,5 +1,16 @@ +mod utils; use clap::{App, Arg}; +const USE_FLAG_AS_ARGUMENT: &str = + "error: Found argument '--another-flag' which wasn't expected, or isn't valid in this context + +If you tried to supply `--another-flag` a...
Suggest PATTERN when passing an invalid flag as a pattern ### Rust Version rustc 1.24.1 ### Affected Version of clap https://github.com/BurntSushi/ripgrep/blob/master/Cargo.lock#L47 ### Suggestion When passing a PATTERN which looks like a flag (starting with `--` or perhaps `-`) and when the parser exp...
This is what we do for subcommands, so adding it for args should be a quick fix! Thanks for bringing it to my attention as I've been out for a few weeks. I have a branch work on this: https://github.com/rharriso/clap/tree/maybe-suggest-positional-arguments
2020-10-06T12:08:17Z
2020-10-09T19:33:48Z
0.4
3b59f5d3699134190d8d5f7fb052418edfd4999f
[ "issue_1284_argument_in_flag_style", "req_group_with_conflict_usage_string", "req_group_with_conflict_usage_string_only_options", "issue_1073_suboptimal_flag_suggestion", "did_you_mean", "subcmd_did_you_mean_output_arg" ]
[ "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::app::tests::issue_2090", "build::arg::settings::test::arg_se...
[]
[]
clap-rs/clap
2,135
clap-rs__clap-2135
[ "1427" ]
49f857166fe7b2d8abf9ccf8d4d89be072fce550
diff --git a/src/output/help.rs b/src/output/help.rs --- a/src/output/help.rs +++ b/src/output/help.rs @@ -501,6 +501,13 @@ impl<'help, 'app, 'parser, 'writer> Help<'help, 'app, 'parser, 'writer> { .default_vals .iter() .map(|&pvs| pvs.to_string_lossy()) + ...
diff --git a/tests/help.rs b/tests/help.rs --- a/tests/help.rs +++ b/tests/help.rs @@ -472,6 +472,19 @@ FLAGS: OPTIONS: --arg <argument> Pass an argument to the program. [default: default-argument]"; +static ESCAPED_DEFAULT_VAL: &str = "default 0.1 + +USAGE: + default [OPTIONS] + +FLAGS: + -h, --he...
Escape or allow alt text for default values <!-- Please use the following template to assist with creating an issue and to ensure a speedy resolution. If an area is not applicable, feel free to delete the area or mark with `N/A` --> ### Rust Version rustc 1.33.0 (2aa4c46cf 2019-02-28) ### Affected Version of...
Can we first get on board with the precise list of escape characters we want to detect? Does it mean "any unprintable character" or just something like [this list](https://en.wikipedia.org/wiki/Escape_character#JavaScript)? I'm leaning very heavily to "just a small list of common ASCII escapes". I don't want to wander...
2020-09-16T10:17:53Z
2020-09-25T09:40:18Z
0.4
3b59f5d3699134190d8d5f7fb052418edfd4999f
[ "escaped_whitespace_values", "escaped_possible_values_output", "possible_values_output" ]
[ "build::app::tests::app_send_sync", "build::app::settings::test::app_settings_fromstr", "build::app::tests::global_setting", "build::app::tests::global_settings", "build::app::tests::global_version", "build::arg::settings::test::arg_settings_fromstr", "build::app::tests::issue_2090", "build::arg::test...
[]
[]
nushell/nushell
13,357
nushell__nushell-13357
[ "13137" ]
5417c89387b67c3192ae9043473b556cd669ee15
diff --git a/crates/nu-cli/src/syntax_highlight.rs b/crates/nu-cli/src/syntax_highlight.rs --- a/crates/nu-cli/src/syntax_highlight.rs +++ b/crates/nu-cli/src/syntax_highlight.rs @@ -429,6 +429,14 @@ fn find_matching_block_end_in_expr( ) }), + Expr::Collect(_, expr) => find_ma...
diff --git a/crates/nu-cmd-lang/src/example_support.rs b/crates/nu-cmd-lang/src/example_support.rs --- a/crates/nu-cmd-lang/src/example_support.rs +++ b/crates/nu-cmd-lang/src/example_support.rs @@ -124,7 +124,10 @@ pub fn eval_block( nu_engine::eval_block::<WithoutDebug>(engine_state, &mut stack, &block, input)...
Inconsistent `$in` behavior in `each` closure ### Describe the bug ```ls | each {$in.name; $in.name}``` Will list the names of X files X times over, resulting in a table of X^2 rows. ```ls | each {$in.name}``` only lists each file once, resulting in X rows, as expected. ### How to reproduce ``` # create rand...
I don't see the inconsistency but maybe I'm missing the point. I think it's the semicolon that's throwing you off. That changes what the command is doing. You are telling it to list the files twice by using the semicolon. If you want the name twice on the same line, one way to do that would be to use string interpolati...
2024-07-12T01:31:40Z
2024-07-22T07:20:53Z
1.77
5417c89387b67c3192ae9043473b556cd669ee15
[ "core_commands::const_::test::test_command_type", "core_commands::let_::test::test_command_type", "core_commands::for_::test::test_examples", "core_commands::const_::test::test_examples", "core_commands::let_::test::test_examples", "core_commands::mut_::test::test_command_type", "core_commands::mut_::te...
[ "input_types::call_with_list_test", "input_types::test_type_annotations::case_05_input_output", "input_types::test_type_annotations::case_08_input_output", "input_types::test_type_annotations::case_03_input_output", "multi_test_parse_int", "input_types::test_type_annotations::case_19_vardecl", "input_ty...
[]
[]
nushell/nushell
12,901
nushell__nushell-12901
[ "7937" ]
580c60bb821af25f838edafd8461bb206d3419f3
diff --git a/crates/nu-command/src/system/run_external.rs b/crates/nu-command/src/system/run_external.rs --- a/crates/nu-command/src/system/run_external.rs +++ b/crates/nu-command/src/system/run_external.rs @@ -530,6 +530,9 @@ impl ExternalCommand { } /// Spawn a command without shelling out to an external ...
diff --git a/tests/shell/environment/env.rs b/tests/shell/environment/env.rs --- a/tests/shell/environment/env.rs +++ b/tests/shell/environment/env.rs @@ -126,6 +126,15 @@ fn passes_with_env_env_var_to_external_process() { assert_eq!(actual.out, "foo"); } +#[test] +fn hides_environment_from_child() { + let a...
neither hide nor hide-env seems to hide environment variables from externals ### Describe the bug I'm trying to hide an environment variable from externals, specifically cargo. ### How to reproduce 1. hide CARGO_TARGET_DIR 2. hide-env CARGO_TARGET_DIR 3. $env.CARGO_TARGET_DIR produces the error it should 4. ^env ...
Any updates? I think I've narrowed it down to this line returning `None`. Now to figure out what to do about it. https://github.com/nushell/nushell/blob/f4bd78b86d441cd53fb6ff30d3a6423735a423cc/crates/nu-protocol/src/engine/stack.rs#L326-L327 @fdncred What is the output of your `overlay list` at the time you're callin...
2024-05-18T03:25:41Z
2024-06-23T01:44:59Z
1.77
5417c89387b67c3192ae9043473b556cd669ee15
[ "shell::environment::env::hides_environment_from_child" ]
[ "const_::const_binary_operator::case_03", "const_::const_binary_operator::case_02", "const_::const_binary_operator::case_04", "const_::const_binary_operator::case_05", "const_::const_binary", "const_::const_binary_operator::case_06", "const_::const_binary_operator::case_07", "const_::const_in_scope", ...
[]
[ "plugins::stream::echo_interactivity_on_slow_pipelines" ]
nushell/nushell
11,169
nushell__nushell-11169
[ "11158" ]
112306aab57c7e0d262bc0659fbfe79318d5bf46
diff --git a/crates/nu-parser/src/parse_keywords.rs b/crates/nu-parser/src/parse_keywords.rs --- a/crates/nu-parser/src/parse_keywords.rs +++ b/crates/nu-parser/src/parse_keywords.rs @@ -40,6 +40,8 @@ use crate::{ /// These parser keywords can be aliased pub const ALIASABLE_PARSER_KEYWORDS: &[&[u8]] = &[b"overlay hid...
diff --git a/tests/parsing/mod.rs b/tests/parsing/mod.rs --- a/tests/parsing/mod.rs +++ b/tests/parsing/mod.rs @@ -304,6 +304,21 @@ fn parse_function_signature(#[case] phrase: &str) { assert!(actual.err.is_empty()); } +#[rstest] +#[case("def test [ in ] {}")] +#[case("def test [ in: string ] {}")] +#[case("def ...
Naming a command parameter `in` breaks ### Describe the bug If I try to define a parameter named "in", nu lets me, but the parameter gets silently overwritten with the pipe input. ### How to reproduce ``` ❯ def something [in: string] { ❯ $in + " something" ❯ } ❯ something "foo" Error: nu::shell::type_mismat...
that should probably be forbidden just as we can't do ```nushell let in = "foo" ``` Agreed, having `let in = blah` or `def something [in: string] {}` should probably be disallowed and error message shown. @fdncred `let` already has it: ```Nushell ~> let in = 0 Error: nu::parser::name_is_builtin_var × `in` ...
2023-11-27T17:10:39Z
2023-12-01T18:30:19Z
0.87
112306aab57c7e0d262bc0659fbfe79318d5bf46
[ "parsing::parse_function_signature_name_is_builtin_var::case_6", "parsing::parse_function_signature_name_is_builtin_var::case_4", "parsing::parse_function_signature_name_is_builtin_var::case_3", "parsing::parse_function_signature_name_is_builtin_var::case_7", "parsing::parse_function_signature_name_is_built...
[ "tests::test_bits::bits_and_list", "tests::test_bits::bits_rotate_left_negative", "tests::test_bits::bits_rotate_right", "tests::test_bits::bits_and_negative", "tests::test_bits::bits_rotate_right_negative", "tests::test_bits::bits_or", "tests::test_bits::bits_or_negative", "tests::test_bits::bits_rot...
[]
[]
nushell/nushell
10,405
nushell__nushell-10405
[ "9702" ]
bc7736bc9965d2df2e406f0e4fe9f4fe0d8c29f7
diff --git a/crates/nu-parser/src/parser.rs b/crates/nu-parser/src/parser.rs --- a/crates/nu-parser/src/parser.rs +++ b/crates/nu-parser/src/parser.rs @@ -3083,10 +3083,22 @@ pub fn parse_var_with_opt_type( if bytes.ends_with(b":") { // We end with colon, so the next span should be the type if *s...
diff --git a/crates/nu-parser/tests/test_parser.rs b/crates/nu-parser/tests/test_parser.rs --- a/crates/nu-parser/tests/test_parser.rs +++ b/crates/nu-parser/tests/test_parser.rs @@ -1354,6 +1354,38 @@ mod input_types { } } + #[derive(Clone)] + pub struct Def; + + impl Command for Def { + ...
cannot specify fields and columns in record and table i/o type annotations ### Describe the bug i wanted to write some interesting commands to play with the new features from the input/output type annotations. we can use `table` and `record` but the parser is not happy when we try to specify the types of columns and ...
I see what you're saying. I haven't tried but I wonder if lists work. It looks like the latest changes may not follow @1Kinoti's PRs enabled this type of thing for parameters. records https://github.com/nushell/nushell/pull/8914 lists https://github.com/nushell/nushell/pull/8529 tables https://github.com/nushell...
2023-09-17T20:49:17Z
2023-09-25T18:49:57Z
0.84
bc7736bc9965d2df2e406f0e4fe9f4fe0d8c29f7
[ "input_types::test_type_annotations::case_05_input_output", "input_types::test_type_annotations::case_06_input_output", "input_types::test_type_annotations::case_07_input_output", "input_types::test_type_annotations::case_16_vardecl", "input_types::test_type_annotations::case_17_vardecl", "input_types::te...
[ "input_types::call_non_custom_types_test", "input_types::test_type_annotations::case_03_input_output", "input_types::test_type_annotations::case_08_input_output", "input_types::test_type_annotations::case_01_input_output", "input_types::test_type_annotations::case_02_input_output", "input_types::call_with...
[]
[]
nushell/nushell
10,395
nushell__nushell-10395
[ "9072" ]
d68c3ec89a8efa304246467f80140c59467ba94f
diff --git a/crates/nu-parser/src/parser.rs b/crates/nu-parser/src/parser.rs --- a/crates/nu-parser/src/parser.rs +++ b/crates/nu-parser/src/parser.rs @@ -734,22 +734,23 @@ fn calculate_end_span( // keywords, they get to set this by being present let positionals_between = kw_pos - positional...
diff --git a/tests/repl/test_parser.rs b/tests/repl/test_parser.rs --- a/tests/repl/test_parser.rs +++ b/tests/repl/test_parser.rs @@ -189,7 +189,31 @@ fn assignment_with_no_var() -> TestResult { "mut = 'foo' | $in; $x | describe", ]; - let expected = "valid variable"; + let expecteds = [ + ...
Syntax-hightlight panics with index out of bounds due to custom function with many arguments ### Describe the bug The interactive shell panics during typing when calling a custom function with many arguments: (stacktrace from `RUST_BACKTRACE=full nu` -> reproduction steps) ``` thread 'main' panicked at 'index out...
can definitely reproduce this :+1: i tried with all integer arguments and `a 0 0 0 ...` => same crash
2023-09-16T19:11:50Z
2024-09-28T08:40:37Z
1.79
d68c3ec89a8efa304246467f80140c59467ba94f
[ "repl::test_parser::assignment_with_no_var", "repl::test_parser::too_few_arguments" ]
[ "const_::const_binary_operator::case_05", "const_::const_binary_operator::case_11", "const_::const_binary_operator::case_01", "const_::const_binary_operator::case_13", "const_::const_binary_operator::case_04", "const_::const_binary_operator::case_12", "const_::const_datetime", "const_::const_binary_op...
[]
[]
sharkdp/fd
1,394
sharkdp__fd-1394
[ "1393" ]
93cdb2628e89dd5831eee22b8df697aea00eca3b
diff --git a/src/cli.rs b/src/cli.rs --- a/src/cli.rs +++ b/src/cli.rs @@ -26,7 +26,7 @@ use crate::filter::SizeFilter; max_term_width = 98, args_override_self = true, group(ArgGroup::new("execs").args(&["exec", "exec_batch", "list_details"]).conflicts_with_all(&[ - "max_results", "has_results...
diff --git a/tests/tests.rs b/tests/tests.rs --- a/tests/tests.rs +++ b/tests/tests.rs @@ -2384,6 +2384,11 @@ fn test_max_results() { }; assert_just_one_result_with_option("--max-results=1"); assert_just_one_result_with_option("-1"); + + // check that --max-results & -1 conflic with --exec + te.ass...
[BUG] unintended behavior when using "-1" ### Checks - [X] I have read the troubleshooting section and still think this is a bug. ### Describe the bug you encountered: Thanks for fd, it comes in handy! Attempts to use the shorthand `-1` alias instead of `--max-results` with exec or batch exec are not prevented, a...
Hi, I can take this. I reproduced this bug and saw it doesn't reproduce in version 8.3.1.
2023-10-05T12:11:40Z
2023-10-05T16:27:44Z
8.7
93cdb2628e89dd5831eee22b8df697aea00eca3b
[ "test_max_results" ]
[ "exec::input::path_tests::basename_dir", "exec::input::path_tests::dirname_dir", "exec::input::path_tests::basename_simple", "exec::input::path_tests::basename_utf8_1", "exec::input::path_tests::remove_ext_dir", "exec::input::path_tests::dirname_root", "exec::input::path_tests::dirname_simple", "exec:...
[]
[]
sharkdp/fd
1,162
sharkdp__fd-1162
[ "1160" ]
cbd11d8a45dc80392c5f1be9679051085e6a3376
diff --git a/src/cli.rs b/src/cli.rs --- a/src/cli.rs +++ b/src/cli.rs @@ -462,7 +462,7 @@ pub struct Opts { /// Set number of threads to use for searching & executing (default: number /// of available CPU cores) - #[arg(long, short = 'j', value_name = "num", hide_short_help = true, value_parser = 1..)] ...
diff --git a/tests/tests.rs b/tests/tests.rs --- a/tests/tests.rs +++ b/tests/tests.rs @@ -2066,6 +2066,14 @@ fn test_list_details() { te.assert_success_and_get_output(".", &["--list-details"]); } +#[test] +fn test_single_and_multithreaded_execution() { + let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES); +...
Panic when using `-j` flag After installing the latest version of `fd-find` (8.5.0), I am getting the following error when I rust fd in signle-thread mode: ``` $ fd -j 1 thread 'main' panicked at 'Mismatch between definition and access of `threads`. Could not downcast to TypeId { t: 18349839772473174998 }, need to...
2022-11-02T12:32:44Z
2022-11-02T12:46:37Z
8.5
cbd11d8a45dc80392c5f1be9679051085e6a3376
[ "test_single_and_multithreaded_execution" ]
[ "exec::input::path_tests::basename_empty", "exec::input::path_tests::basename_utf8_1", "exec::input::path_tests::basename_simple", "exec::input::path_tests::basename_utf8_0", "exec::input::path_tests::dirname_utf8_1", "exec::input::path_tests::hidden", "exec::input::path_tests::dirname_dir", "exec::in...
[]
[]
sharkdp/fd
1,121
sharkdp__fd-1121
[ "898" ]
ee2396b57a2590a9e534e407d45fa454b32df799
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,9 @@ ## Bugfixes - Fixed differences between piped / non-piped output. This changes `fd`s behavior back to what we - had before 8.3.0, i.e. there will be no leading `./` prefixes, unless the `--print0`/`-0` option - is used....
diff --git a/tests/tests.rs b/tests/tests.rs --- a/tests/tests.rs +++ b/tests/tests.rs @@ -1327,6 +1327,16 @@ fn test_exec() { ./one/two/three/directory_foo", ); + te.assert_output( + &["foo", "--strip-cwd-prefix", "--exec", "echo", "{}"], + "a.foo + one/b...
[BUG] `--strip-cwd-prefix` does nothing Sorry for not using the official bug template, it always returned error code 400 on my end, and acted pretty buggy in general. ## Bug description ## I use a variant of the following line to find pdf files and sort them by date: ``` fd --strip-cwd-prefix -e pdf -X ls -t...
> Sorry for not using the official bug template, it always returned error code 400 on my end, and acted pretty buggy in general. @tmccombs I heard this from others as well. I'm afraid we might have to disable the new template for some time. > ## Expected behavior > > `fd` should always remove the leading `./` ...
2022-09-27T20:15:12Z
2023-05-03T18:31:12Z
8.4
ee2396b57a2590a9e534e407d45fa454b32df799
[ "test_exec_batch", "test_exec" ]
[ "exec::input::path_tests::basename_empty", "app::verify_app", "exec::input::path_tests::basename_dir", "exec::input::path_tests::hidden", "exec::input::path_tests::basename_utf8_1", "exec::input::path_tests::basename_simple", "exec::input::path_tests::dirname_utf8_0", "exec::input::path_tests::dirname...
[]
[]
sharkdp/fd
1,079
sharkdp__fd-1079
[ "1072" ]
218d475cb21763deaf0ecc8d46078b8f289d03a7
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ ## Bugfixes +- fd returns an error when current working directory does not exist while a search path is specified, see #1072 (@vijfhoek) + ## Changes diff --git a/src/main.rs b/src/main.rs --- a/src/main.rs +++ b/sr...
diff --git a/tests/testenv/mod.rs b/tests/testenv/mod.rs --- a/tests/testenv/mod.rs +++ b/tests/testenv/mod.rs @@ -185,6 +185,11 @@ impl TestEnv { self.temp_dir.path().to_path_buf() } + /// Get the path of the fd executable. + pub fn test_exe(&self) -> &PathBuf { + &self.fd_exe + } + ...
fd does not want to work when cwd is non existent **What version of `fd` are you using?** `fd 8.3.1` `fish, version 3.3.1` ```sh $ cd /mnt/path/to/some/external/drive # Unmount the drive # Remount the drive at the same space (may not be necessary) fdfind someFolder /home/zykino/some/path/ [fd error]: Could no...
2022-08-01T21:23:02Z
2022-08-10T18:01:21Z
8.4
ee2396b57a2590a9e534e407d45fa454b32df799
[ "test_invalid_cwd" ]
[ "exec::input::path_tests::basename_empty", "exec::input::path_tests::basename_dir", "exec::input::path_tests::hidden", "exec::input::path_tests::dirname_simple", "exec::input::path_tests::remove_ext_simple", "app::verify_app", "exec::input::path_tests::dirname_dir", "exec::input::path_tests::remove_ex...
[]
[]
sharkdp/fd
986
sharkdp__fd-986
[ "840" ]
3e201de9b06e4587781eaf4fe7e755d4f9d8c6df
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ ## Changes - +- Changed `-u` flag to be equivalent to `-HI`. Multiple `-u` flags still allowed but do nothing, see #840 (@jacksontheel) ## Other diff --git a/doc/fd.1 b/doc/fd.1 --- a/doc/fd.1 +++ b/doc/fd.1 @@ -5...
diff --git a/tests/tests.rs b/tests/tests.rs --- a/tests/tests.rs +++ b/tests/tests.rs @@ -656,18 +656,6 @@ fn test_no_ignore_aliases() { te.assert_output( &["-u", "foo"], - "./a.foo - ./fdignored.foo - ./gitignored.foo - ./one/b.foo - ./one/two/c.foo - ./one/tw...
Make `-u` idempotent (always search all files/dirs) `fd -u` is an alias for `fd -I`and `fd -uu`is an alias for `fd -IH`. The former is unnecessary given that it's an alias to another one-letter flag (I imagine it's there for historical reasons?) and the latter is cumbersome if someone wanted to use the long form (`--un...
I worry about backwards incompatibility with this change. I expect many people have aliases and/or scripts already using `-u` which would change behaviour. The main reason for `-u` to exist is compatibility with `ripgrep`. It uses `-u` and `-uu` in the same way that `fd` does. `ripgrep` indeed has `-uuu` in addition (...
2022-03-22T03:21:33Z
2022-05-20T03:43:04Z
8.3
3e201de9b06e4587781eaf4fe7e755d4f9d8c6df
[ "test_no_ignore_aliases" ]
[ "exec::input::path_tests::basename_empty", "exec::input::path_tests::basename_simple", "app::verify_app", "exec::input::path_tests::basename_utf8_0", "exec::input::path_tests::basename_dir", "exec::input::path_tests::dirname_simple", "exec::input::path_tests::basename_utf8_1", "exec::input::path_tests...
[]
[]
sharkdp/fd
866
sharkdp__fd-866
[ "410" ]
7b5b3ec47b98984121e2665c7bad5274cb8db796
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ - Add new `--no-ignore-parent` flag, see #787 (@will459) +- Add new `--batch-size` flag, see #410 (@devonhollowood) + ## Bugfixes - Set default path separator to `/` in MSYS, see #537 and #730 (@aswild) diff --git ...
diff --git a/tests/tests.rs b/tests/tests.rs --- a/tests/tests.rs +++ b/tests/tests.rs @@ -1418,6 +1418,48 @@ fn test_exec_batch() { } } +#[test] +fn test_exec_batch_with_limit() { + // TODO Test for windows + if cfg!(windows) { + return; + } + + let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FI...
-X should batch the number of passed files to the maximum supported by the shell It appears that if you run `getconf ARG_MAX` it returns the maximum length that the command string can be. Possibly include a command to artificially limit the number of arguments as well? ``` $ fd -IH . -tf -X wc -l [fd error]: Prob...
Thank you for reporting this. That was a known limitation when we first implemented `--exec-batch`, but we should definitely try to fix this. Thank you for the information about `getconf ARG_MAX`. Looks like this should work on all POSIX systems. We will have to check how to get that information on Windows. Note tha...
2021-10-20T08:11:32Z
2021-10-22T06:05:14Z
8.2
7b5b3ec47b98984121e2665c7bad5274cb8db796
[ "test_exec_batch_with_limit" ]
[ "exec::input::path_tests::hidden", "exec::input::path_tests::remove_ext_dir", "exec::input::path_tests::dirname_utf8_1", "exec::input::path_tests::basename_utf8_0", "exec::input::path_tests::dirname_root", "exec::input::path_tests::basename_empty", "exec::input::path_tests::basename_utf8_1", "exec::in...
[]
[]
sharkdp/fd
813
sharkdp__fd-813
[ "303" ]
c06c9952b61f35a7881b399cd21d0a4f821e7055
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Features +- Add new `-q, --quiet` flag, see #303 (@Asha20) + ## Bugfixes - Set default path separator to `/` in MSYS, see #537 and #730 (@aswild) diff --git a/doc/fd.1 b/doc/fd.1 --- a/doc/fd.1 +++ b/doc/fd.1 @@ -...
diff --git a/tests/tests.rs b/tests/tests.rs --- a/tests/tests.rs +++ b/tests/tests.rs @@ -1425,6 +1425,19 @@ fn test_exec_with_separator() { ); } +/// Non-zero exit code (--quiet) +#[test] +fn test_quiet() { + let dirs = &[]; + let files = &["a.foo", "b.foo"]; + let te = TestEnv::new(dirs, files); + +...
Thoughts on non-zero exit code for no matches? `grep` returns a non-zero exit code when no matches are found, making it easy to include in shell scripts and if conditions directly without having to shell out to `test` to analyze the results. What are your thoughts on having `fd` do the same so that `fd not-exists` a...
Thank you for the feedback! Interesting thought. However, I'm not sure that it's a good idea to implement it this way. `find` always returns 0 if it finished the search without any errors, even if there are no results. The idea is that you can use the exit code to tell whether or not you can rely on the search r...
2021-08-08T17:23:28Z
2021-11-16T18:59:04Z
8.2
7b5b3ec47b98984121e2665c7bad5274cb8db796
[ "test_quiet" ]
[ "exec::input::path_tests::basename_simple", "exec::input::path_tests::basename_empty", "exec::input::path_tests::dirname_utf8_0", "exec::input::path_tests::dirname_dir", "exec::input::path_tests::basename_dir", "exec::input::path_tests::basename_utf8_1", "exec::input::path_tests::basename_utf8_0", "ex...
[]
[]
sharkdp/fd
658
sharkdp__fd-658
[ "535" ]
a851570b15bbca91f1f4ef230c6d8939f2459ecc
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Features - Improved the usability of the time-based options, see #624 and #645 (@gorogoroumaru) +- Add new `--prune` flag, see #535 (@reima) ## Bugfixes diff --git a/contrib/completion/_fd b/contrib/completion/_fd...
diff --git a/tests/tests.rs b/tests/tests.rs --- a/tests/tests.rs +++ b/tests/tests.rs @@ -758,6 +758,40 @@ fn test_exact_depth() { ); } +/// Pruning (--prune) +#[test] +fn test_prune() { + let dirs = &["foo/bar", "bar/foo", "baz"]; + let files = &[ + "foo/foo.file", + "foo/bar/foo.file", + ...
`-prune` options Is it possible to add an option `-prune`, to not explore sub-directories, when the current directory has been matched ? (like `find -prune`)
Thank you for your feedback. Can you please give us some examples of actual (non-hypothetical) use cases for this? @sharkdp Yes of course :) I'm developing a package for sublime text, and I'm using your tool https://github.com/Mister7F/Sublime-DirectoryFilter I don't want to display a directory if one of the paren...
2020-10-03T18:39:31Z
2020-12-06T18:58:23Z
8.1
a851570b15bbca91f1f4ef230c6d8939f2459ecc
[ "test_prune" ]
[ "exec::input::path_tests::basename_dir", "exec::input::path_tests::remove_ext_dir", "exec::input::path_tests::basename_empty", "exec::input::path_tests::hidden", "exec::input::path_tests::dirname_utf8_0", "exec::input::path_tests::dirname_utf8_1", "exec::input::path_tests::dirname_root", "exec::input:...
[]
[]
sharkdp/fd
569
sharkdp__fd-569
[ "404" ]
2bab4a22494e3f10da0b708da7a1eebaa483b727
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ This can be useful to speed up searches in cases where you know that there are only N results. Using this option is also (slightly) faster than piping to `head -n <count>` where `fd` can only exit when it finds the...
diff --git a/tests/tests.rs b/tests/tests.rs --- a/tests/tests.rs +++ b/tests/tests.rs @@ -669,6 +669,40 @@ fn test_max_depth() { ); } +/// Minimum depth (--min-depth) +#[test] +fn test_min_depth() { + let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES); + + te.assert_output( + &["--min-depth", "3"]...
Add --min-depth option We have `--max-depth` option, but there is no `--min-depth` counterpart. It could be used exactly like it's been used with `find`.
Thank you for the feedback. Please see my comment in #390. Thank you for fast reply. My usecase is pretty simple, I use `fd` to generate input for shell functions, which help to apply some action (edit, cd, select) to the target. I found it handy to have two modes of such functions, the first one applies only to fi...
2020-04-15T14:20:19Z
2020-04-15T15:02:45Z
7.5
2bab4a22494e3f10da0b708da7a1eebaa483b727
[ "test_exact_depth", "test_min_depth" ]
[ "exec::input::path_tests::basename_empty", "exec::input::path_tests::basename_dir", "exec::input::path_tests::basename_simple", "exec::input::path_tests::remove_ext_empty", "exec::input::path_tests::remove_ext_simple", "exec::input::path_tests::remove_ext_dir", "exec::input::path_tests::basename_utf8_1"...
[]
[]
sharkdp/fd
558
sharkdp__fd-558
[ "295" ]
e44f2f854084c1e69f334ce1a99188f8b960ed4f
diff --git a/src/exec/mod.rs b/src/exec/mod.rs --- a/src/exec/mod.rs +++ b/src/exec/mod.rs @@ -3,7 +3,7 @@ mod input; mod job; mod token; -use std::borrow::Cow; +use std::ffi::OsString; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; use std::sync::{Arc, Mutex}; diff --git a/src/exec/mod.rs b...
diff --git a/src/exec/input.rs b/src/exec/input.rs --- a/src/exec/input.rs +++ b/src/exec/input.rs @@ -1,70 +1,40 @@ -use std::path::MAIN_SEPARATOR; +use std::ffi::{OsStr, OsString}; +use std::path::{Path, PathBuf}; -/// Removes the parent component of the path -pub fn basename(path: &str) -> &str { - let mut inde...
fd outputs � for filenames containing extended ascii Bit of an edge case, obviously. If you have filenames that are not valid utf-8, fd will output a � rather than preserving the actual byte array. This breaks --exec. Find works as expected, here.
Thank you for taking the time to report this.
2020-04-04T10:53:08Z
2020-04-04T16:46:13Z
7.5
2bab4a22494e3f10da0b708da7a1eebaa483b727
[ "exec::input::path_tests::basename_dir", "exec::input::path_tests::basename_simple", "exec::input::path_tests::dirname_root", "exec::input::path_tests::basename_utf8_1", "exec::input::path_tests::basename_empty", "exec::input::path_tests::dirname_utf8_0", "exec::input::path_tests::dirname_dir", "exec:...
[]
[]
[]
sharkdp/fd
555
sharkdp__fd-555
[ "476" ]
ee673c92d375d9e5a6c126480a0383bbe3042b96
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Features +- Added `--max-results=<count>` option to limit the number of search results, see #472 and #476 + This can be useful to speed up searches in cases where you know that there are only N results. + Using thi...
diff --git a/tests/testenv/mod.rs b/tests/testenv/mod.rs --- a/tests/testenv/mod.rs +++ b/tests/testenv/mod.rs @@ -192,19 +192,13 @@ impl TestEnv { PathBuf::from(components.next().expect("root directory").as_os_str()) } - /// Assert that calling *fd* with the specified arguments produces the expected...
Feature request: limit the number of find result When used with emacs helm, fd process is created after every char inputting. I want to limit the number of the find result, because the extra results have no use and just cost power. If there are too many results (more than 100 for me), I will find again until the res...
Would ```bash fd … | head -n 30 ``` work for you? If you want colorized output, you can use ```bash fd --color=always … | head -n 30 ``` see also my answer in #472. Good idea. It works on macOS. But on windows, there is no 'head' command. I would have to install msys2 to use it. I'd like to close this in fa...
2020-04-02T16:52:32Z
2020-04-02T18:37:14Z
7.5
2bab4a22494e3f10da0b708da7a1eebaa483b727
[ "test_max_results" ]
[ "exec::input::path_tests::basename_dir", "exec::input::path_tests::basename_empty", "exec::input::path_tests::basename_utf8_0", "exec::input::path_tests::basename_utf8_1", "exec::input::path_tests::dirname_simple", "exec::input::path_tests::dirname_empty", "exec::input::path_tests::basename_simple", "...
[]
[]
sharkdp/fd
497
sharkdp__fd-497
[ "357" ]
0f2429cabcb591df74fc2ab3e32b3ac967264f6d
diff --git a/src/fshelper/mod.rs b/src/fshelper/mod.rs --- a/src/fshelper/mod.rs +++ b/src/fshelper/mod.rs @@ -13,7 +13,7 @@ use std::io; use std::os::unix::fs::PermissionsExt; use std::path::{Path, PathBuf}; -use ignore::DirEntry; +use crate::walk; pub fn path_absolute_form(path: &Path) -> io::Result<PathBuf> {...
diff --git a/tests/testenv/mod.rs b/tests/testenv/mod.rs --- a/tests/testenv/mod.rs +++ b/tests/testenv/mod.rs @@ -162,6 +162,25 @@ impl TestEnv { } } + /// Create a broken symlink at the given path in the temp_dir. + pub fn create_broken_symlink<P: AsRef<Path>>( + &mut self, + link_...
`fd -L` omits broken symlinks It appears that `fd -L` completely omits any broken symlinks. Instead it should fall back to treating a broken symlink as though `-L` was not specified, which matches the observed `find` behavior. Example: ``` > touch a > ln -s b c > ln -s a d > exa a c@ d@ > find -L . . ./...
Thank you very much for reporting this. Notice that you can use `--show-errors` to see what's happening to `c`: ``` ▶ fd -L --show-errors [fd error]: ./c: No such file or directory (os error 2) a d ``` I guess it's debatable what the result should actually be. After all, you tell `fd` to follow symlinks, an...
2019-10-09T14:52:57Z
2023-04-03T19:21:32Z
7.4
0f2429cabcb591df74fc2ab3e32b3ac967264f6d
[ "test_follow_broken_symlink" ]
[ "exec::input::path_tests::basename_dir", "exec::input::path_tests::basename_empty", "exec::input::path_tests::basename_simple", "exec::input::path_tests::dirname_root", "exec::input::path_tests::dirname_empty", "exec::input::path_tests::hidden", "exec::input::path_tests::dirname_utf8_1", "exec::input:...
[]
[]
tokio-rs/tokio
6,967
tokio-rs__tokio-6967
[ "4719" ]
d4178cf34924d14fca4ecf551c97b8953376f25a
diff --git a/tokio/src/io/async_fd.rs b/tokio/src/io/async_fd.rs --- a/tokio/src/io/async_fd.rs +++ b/tokio/src/io/async_fd.rs @@ -872,6 +872,56 @@ impl<T: AsRawFd> AsyncFd<T> { .async_io(interest, || f(self.inner.as_mut().unwrap())) .await } + + /// Tries to read or write from the fil...
diff --git a/tokio/tests/io_async_fd.rs b/tokio/tests/io_async_fd.rs --- a/tokio/tests/io_async_fd.rs +++ b/tokio/tests/io_async_fd.rs @@ -302,7 +302,7 @@ async fn reregister() { #[tokio::test] #[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri. -async fn try_io() { +async fn guard_try_io() { let (a, mu...
Add `AsyncFd::try_io` **Is your feature request related to a problem? Please describe.** I have a Unix socket where I want to call `libc::sendmsg` on the file descriptor directly. Right now, I have to use ```rust let guard = async_fd.writable().await; sendmsg(...); guard.clear_ready(); ``` which is error pron...
This seems like a good idea. I'd like to give this a try @jyn514 we have unix socket types, why not use those for your use case? @Noah-Kennedy I have a trait that abstracts over different socket types. Ah ok
2024-11-11T09:39:11Z
2024-11-19T16:55:55Z
1.41
d4178cf34924d14fca4ecf551c97b8953376f25a
[ "driver_shutdown_then_clear_readiness", "driver_shutdown_wakes_currently_pending", "clear_ready_matching_clears_ready", "await_error_readiness_invalid_address", "clear_ready_matching_clears_ready_mut", "driver_shutdown_wakes_poll", "driver_shutdown_wakes_future_pending", "drop_closes", "driver_shutd...
[]
[]
[]
clap-rs/clap
2,085
clap-rs__clap-2085
[ "1094" ]
be27f41f8354bfbdf0e4eb43236759b799e7816a
diff --git a/src/output/help.rs b/src/output/help.rs --- a/src/output/help.rs +++ b/src/output/help.rs @@ -353,7 +353,10 @@ impl<'help, 'app, 'parser, 'writer> Help<'help, 'app, 'parser, 'writer> { && h_w > (self.term_w - taken); debug!("Help::val: Has switch..."); - if arg.has_switch() {...
diff --git a/tests/help.rs b/tests/help.rs --- a/tests/help.rs +++ b/tests/help.rs @@ -111,10 +111,10 @@ USAGE: clap-test FLAGS: - -h, --help + -h, --help Prints help information - -V, --version + -V, --version Prints version information diff --git a/tests/...
-h, --help generate trailing spaces <!-- Issuehunt Badges --> [<img alt="Issuehunt badges" src="https://img.shields.io/badge/IssueHunt-%2410%20Rewarded-%237E24E3.svg" />](https://issuehunt.io/r/clap-rs/clap/issues/1094) <!-- /Issuehunt Badges --> ### Rust Version rustc 1.21.0 (3b72af97e 2017-10-09) ### Affected...
This is partly an implementation issue that doesn't have a good work around. The help generation is segmented off where each "section" is written in isolation. Without greater coupling (or a larger refactor), the section that writes the spaces between the flags/values and the actual help line can't look ahead to see if...
2020-08-20T12:57:56Z
2022-07-25T10:32:33Z
0.4
3b59f5d3699134190d8d5f7fb052418edfd4999f
[ "after_and_before_long_help_output", "issue_1642_long_help_spacing", "long_about", "show_long_about_issue_897", "hidden_long_args", "hidden_short_args_long_help" ]
[ "build::app::tests::app_send_sync", "build::app::settings::test::app_settings_fromstr", "build::app::tests::global_setting", "build::app::tests::global_settings", "build::app::tests::global_version", "build::arg::settings::test::arg_settings_fromstr", "build::arg::test::flag_display", "build::arg::tes...
[ "ui" ]
[]
clap-rs/clap
2,075
clap-rs__clap-2075
[ "1464" ]
ddd55e57dc4b0205e02c121f1116704bd1b51956
diff --git a/src/parse/validator.rs b/src/parse/validator.rs --- a/src/parse/validator.rs +++ b/src/parse/validator.rs @@ -168,16 +168,51 @@ impl<'help, 'app, 'parser> Validator<'help, 'app, 'parser> { Ok(()) } + fn build_conflict_err_usage( + &self, + matcher: &ArgMatcher, + ret...
diff --git a/tests/conflicts.rs b/tests/conflicts.rs --- a/tests/conflicts.rs +++ b/tests/conflicts.rs @@ -16,6 +16,13 @@ USAGE: For more information try --help"; +static CONFLICT_ERR_THREE: &str = "error: The argument '--two' cannot be used with '--one' + +USAGE: + three_conflicting_arguments --one + +For more...
Error message for conflicted args outputs conflicting USAGE ### Rust Version `rustc 1.34.1 (fc50f328b 2019-04-24)` ### Affected Version of clap `2.33.0` ### Bug or Feature Request Summary There are 2 conflicting args: `a` and `b`. When both are issued, USAGE outputs the invalid command again. ### Expe...
In fact, after reading the code, this behavior was actually already expected and **almost** tested! This test: https://github.com/clap-rs/clap/blob/784524f7eb193e35f81082cc69454c8c21b948f7/tests/conflicts.rs#L80-L83 and this one: https://github.com/clap-rs/clap/blob/784524f7eb193e35f81082cc69454c8c21b948f7/test...
2020-08-15T09:56:03Z
2020-08-16T20:29:30Z
0.4
3b59f5d3699134190d8d5f7fb052418edfd4999f
[ "two_conflicting_arguments", "three_conflicting_arguments", "conflict_output_three_conflicting", "conflict_output_rev_with_required", "conflict_output_with_required", "conflict_output", "conflict_output_rev" ]
[ "build::app::tests::global_setting", "build::app::tests::app_send_sync", "build::app::tests::global_settings", "build::arg::settings::test::arg_settings_fromstr", "build::arg::test::flag_display", "build::arg::test::flag_display_multiple_aliases", "build::arg::test::flag_display_multiple_short_aliases",...
[]
[]
clap-rs/clap
1,975
clap-rs__clap-1975
[ "1815", "1815" ]
81457178fa7e055775867ca659b37798b5ae9584
diff --git a/clap_derive/examples/basic.rs b/clap_derive/examples/basic.rs --- a/clap_derive/examples/basic.rs +++ b/clap_derive/examples/basic.rs @@ -30,7 +30,7 @@ struct Opt { // the long option will be translated by default to kebab case, // i.e. `--nb-cars`. /// Number of cars - #[clap(short = "c"...
diff --git a/clap_derive/tests/argument_naming.rs b/clap_derive/tests/argument_naming.rs --- a/clap_derive/tests/argument_naming.rs +++ b/clap_derive/tests/argument_naming.rs @@ -99,7 +99,7 @@ fn test_standalone_short_generates_kebab_case() { fn test_custom_short_overwrites_default_name() { #[derive(Clap, Debug, ...
clap_derive: Arg::short does not accept "..." anymore, it needs char `Arg::short` in clap 2.x is defined as `.short("...")` while in clap 3.0 it's going to take `char`. All the examples/tests for the derive use the obsoleted `"..."` form, which is supported by [this hack](https://github.com/clap-rs/clap/blob/8145717...
Is this still an issue? On the `master` branch, all usages of `.short()` appear to be taking in a single character. This works fine with current master: ```rust #[derive(Clap, Debug)] struct Opt { /// "c" is a string literal, not 'c' char #[clap(short = "c", long)] nb_cars: Option<i32>, } ``` ...
2020-06-17T00:49:50Z
2020-06-27T01:32:43Z
0.4
3b59f5d3699134190d8d5f7fb052418edfd4999f
[ "test_standalone_long_uses_previous_defined_casing", "test_standalone_short_uses_previous_defined_custom_name", "test_standalone_short_generates_kebab_case", "test_standalone_short_ignores_afterwards_defined_custom_name", "test_multi_word_enum_variant_is_renamed", "test_rename_all_is_propagation_can_be_ov...
[]
[]
[]
clap-rs/clap
1,958
clap-rs__clap-1958
[ "1955" ]
2da492e4dc1eedf4f7d666ecb38158d2d8c6528f
diff --git a/src/build/app/mod.rs b/src/build/app/mod.rs --- a/src/build/app/mod.rs +++ b/src/build/app/mod.rs @@ -94,7 +94,7 @@ pub struct App<'b> { pub(crate) subcommands: Vec<App<'b>>, pub(crate) replacers: HashMap<&'b str, &'b [&'b str]>, pub(crate) groups: Vec<ArgGroup<'b>>, - pub(crate) help_hea...
diff --git a/tests/help.rs b/tests/help.rs --- a/tests/help.rs +++ b/tests/help.rs @@ -1476,7 +1476,7 @@ Will M. does stuff USAGE: - test [OPTIONS] --fake <some>:<val> --birthday-song <song> + test [OPTIONS] --fake <some>:<val> --birthday-song <song> --birthday-song-volume <volume> FLAGS: -h, --help ...
help_heading doesn't seem to work ### Make sure you completed the following tasks - [x] Searched the [discussions](https://github.com/clap-rs/clap/discussions) - [x] Searched the closes issues Initially reported as https://github.com/clap-rs/clap/discussions/1954 ### Code ```rust use clap::{App, Arg}; ...
2020-06-01T04:43:16Z
2020-06-01T10:14:18Z
0.4
3b59f5d3699134190d8d5f7fb052418edfd4999f
[ "build::arg::test::option_display_multiple_short_aliases", "build::arg::test::flag_display", "build::app::tests::global_version", "build::arg::test::option_display_multiple_aliases", "build::arg::test::flag_display_single_short_alias", "build::app::settings::test::app_settings_fromstr", "build::arg::set...
[]
[]
[]
clap-rs/clap
1,710
clap-rs__clap-1710
[ "1655" ]
c192f5effbb9655964630952e530255462174f44
diff --git a/src/parse/errors.rs b/src/parse/errors.rs --- a/src/parse/errors.rs +++ b/src/parse/errors.rs @@ -628,7 +628,7 @@ impl Error { cause: format!("The subcommand '{}' wasn't recognized", s), message: format!( "{} The subcommand '{}' wasn't recognized\n\t\ - ...
diff --git a/src/parse/features/suggestions.rs b/src/parse/features/suggestions.rs --- a/src/parse/features/suggestions.rs +++ b/src/parse/features/suggestions.rs @@ -102,6 +103,12 @@ mod test { assert_eq!(did_you_mean("tst", p_vals.iter()), Some("test")); } + #[test] + fn possible_values_match() ...
Offer suggestions for InferSubcommands Imagine we have this app ```rust use clap::*; fn main() { let m = clap::App::new("foo") .global_setting(AppSettings::InferSubcommands) .subcommand(App::new("test")) .subcommand(App::new("temp")); println!("{:?}", m.get_matches()); } ``...
I would like to give this a try. I think `suggestions::did_you_mean` now needs to be: ```rust pub fn did_you_mean<T, I>(v: &str, possible_values: I) -> Vec<String> where T: AsRef<str>, I: IntoIterator<Item = T>, { ``` from ```rust pub fn did_you_mean<T, I>(v: &str, possible_values: I) -> Option<String...
2020-03-01T09:09:12Z
2020-03-02T02:02:42Z
0.9
c192f5effbb9655964630952e530255462174f44
[ "subcmd_did_you_mean_output_ambiguous" ]
[ "build::arg::settings::test::arg_settings_fromstr", "build::app::settings::test::app_settings_fromstr", "build::arg::test::flag_display", "build::arg::test::flag_display_multiple_aliases", "build::arg::test::flag_display_single_alias", "build::arg::test::option_display1", "build::arg::test::option_displ...
[]
[]
sharkdp/bat
1,518
sharkdp__bat-1518
[ "1503" ]
3af35492320077b2abf7cc70117ea02aa24389a3
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -98,6 +98,7 @@ dependencies = [ "git2", "globset", "lazy_static", + "nix", "path_abs", "predicates", "semver", diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -213,12 +214,12 @@ dependencies = [ [[package]...
diff --git a/src/assets.rs b/src/assets.rs --- a/src/assets.rs +++ b/src/assets.rs @@ -329,7 +329,7 @@ mod tests { let input = Input::ordinary_file(file_path.as_os_str()); let dummy_stdin: &[u8] = &[]; - let mut opened_input = input.open(dummy_stdin).unwrap(); + let mut...
Can not run bat with input and output attached to /dev/null **Describe the bug you encountered:** ``` ▶ bat > /dev/null < /dev/null [bat error]: The output file is also an input! ``` **What did you expect to happen instead?** This is kind of a weird edge case, but running `bat` like this is actually useful ...
I looked into the `cat` source code again and I found that we missed a detail when this feature was sketched out for the first time. `cat` always checks, that the output is a "regular file", according to the filetype encoded in the `st_mode` field: ```c out_isreg = S_ISREG (stat_buf.st_mode) != 0; // ... /*...
2021-01-14T19:34:00Z
2021-02-28T22:04:49Z
0.17
3af35492320077b2abf7cc70117ea02aa24389a3
[ "less::test_parse_less_version_487", "config::default_config_should_include_all_lines", "config::default_config_should_highlight_no_lines", "input::basic", "input::utf16le", "less::test_parse_less_version_529", "less::test_parse_less_version_551", "less::test_parse_less_version_wrong_program", "line...
[]
[]
[]
sharkdp/bat
1,276
sharkdp__bat-1276
[ "1163" ]
33128d75f22a7c029df17b1ee595865933551469
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ## Features - Adjust pager configuration to comply with `--wrap=never`, see #1255 (@gahag) +- Added a new `--style` value, `rule`, which adds a simple horizontal ruled line between files, see #1276 (@tommilligan) ## Bu...
diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -570,6 +570,18 @@ fn empty_file_leads_to_empty_output_with_grid_enabled() { .stdout(""); } +#[test] +fn empty_file_leads_to_empty_output_with_rule_enabled() { + bat() ...
Alternative to `grid` for style which only draws a line between files I'm not a fan of having my `cat`-alike draw a full-blown table, but I would like to have some visible "end of file, beginning of next file" separation. Unfortunately, `--style=header,grid` still draws the horizontal lines as if they were part of a...
Thank you for the feedback. Sounds good to me. Maybe we could also change the `grid` style whenever the sidebar is not visible? Instead of introducing a new style? > Maybe we could also change the grid style whenever the sidebar is not visible? Instead of introducing a new style? I considered that, but I proposed...
2020-10-06T16:29:46Z
2020-11-23T18:09:48Z
0.16
33128d75f22a7c029df17b1ee595865933551469
[ "empty_file_leads_to_empty_output_with_rule_enabled", "header_padding_rule", "grid_overrides_rule", "header_rule", "header_numbers_rule", "grid_rule", "changes_rule", "changes_header_rule", "changes_grid_rule", "changes_grid_header_numbers_rule", "changes_grid_header_rule", "grid_header_rule",...
[ "config::default_config_should_highlight_no_lines", "less::test_parse_less_version_487", "less::test_parse_less_version_529", "line_range::test_parse_partial_min", "line_range::test_parse_full", "line_range::test_parse_partial_max", "less::test_parse_less_version_wrong_program", "line_range::test_rang...
[]
[]
BurntSushi/ripgrep
2,626
BurntSushi__ripgrep-2626
[ "1966", "2635" ]
7099e174acbcbd940f57e4ab4913fee4040c826e
diff --git a/.cargo/config.toml b/.cargo/config.toml --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -6,3 +6,16 @@ rustflags = ["-C", "target-feature=+crt-static"] [target.i686-pc-windows-msvc] rustflags = ["-C", "target-feature=+crt-static"] + +# Do the same for MUSL targets. At the time of writing (2023-10-23...
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: include: - build: pinned os: ubuntu-latest - rust: 1.72.1 + rust: 1.74.0 - build: stable os: ubuntu-la...
`rg --unknown-switch` panics on broken pipe error #### What version of ripgrep are you using? ```console $ ./target/debug/rg --version ripgrep 13.0.0 (rev 9b01a8f9ae) -SIMD -AVX (compiled) +SIMD +AVX (runtime) ``` #### How did you install ripgrep? Compiled from source. ```console $ git rev-parse HEAD ...
I discovered this in my own project after trying to match ripgrep's panic free printing of `--help` text from clap: https://github.com/artichoke/artichoke/issues/1314.
2023-10-12T15:22:03Z
2024-06-23T17:16:03Z
13.0
7099e174acbcbd940f57e4ab4913fee4040c826e
[ "gitignore::tests::parse_excludes_file4" ]
[ "default_types::tests::default_types_are_sorted", "gitignore::tests::cs1", "gitignore::tests::cs2", "gitignore::tests::ig10", "gitignore::tests::case_insensitive", "gitignore::tests::cs3", "gitignore::tests::ig1", "gitignore::tests::cs4", "gitignore::tests::ig13", "gitignore::tests::ig14", "giti...
[]
[]
BurntSushi/ripgrep
2,610
BurntSushi__ripgrep-2610
[ "2483" ]
86ef6833085428c21ef1fb7f2de8e5e7f54f1f72
diff --git a/.gitignore b/.gitignore --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ target /termcolor/Cargo.lock /wincolor/Cargo.lock /deployment +/.idea # Snapcraft files stage diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -19,9 +19,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e...
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -193,6 +193,10 @@ jobs: shell: bash run: ci/test-complete + - name: Print hostname detected by grep-cli crate + shell: bash + run: ${{ env.CARGO }} test --manife...
Add configurable hyperlinks This PR adds hyperlinks to search results in terminals which support them: ![image](https://user-images.githubusercontent.com/7913492/229365208-8e89dbb0-53d1-4e82-b6ed-3d27004dd830.png) Compared to the previous PR (#2322), it adds a `--hyperlink-format PATTERN` command line option whic...
Works well for me. One minor thing I noticed, is that the last colon ist embedded in the link label. Visually it would be more pleasant to exclude that, but opinions on that might differ. Thanks for implementing this. And one more minor thing. The column seems to be off by one. I would assume it to be zero-based. Thank...
2023-09-21T17:18:23Z
2023-09-26T21:13:54Z
13.0
7099e174acbcbd940f57e4ab4913fee4040c826e
[ "escape::tests::backslash", "escape::tests::carriage", "escape::tests::empty", "escape::tests::nl", "escape::tests::invalid_utf8", "escape::tests::nothing_hex0", "escape::tests::nothing_hex1", "escape::tests::nothing_hex2", "escape::tests::nothing_simple", "escape::tests::nul", "escape::tests::t...
[]
[]
[]
clap-rs/clap
3,775
clap-rs__clap-3775
[ "3294" ]
20ed49a535d14afac1972dd3cc3003c97bcc744f
diff --git a/src/builder/action.rs b/src/builder/action.rs --- a/src/builder/action.rs +++ b/src/builder/action.rs @@ -70,6 +70,81 @@ pub enum ArgAction { /// assert_eq!(matches.get_many::<String>("flag").unwrap_or_default().count(), 0); /// ``` IncOccurrence, + /// When encountered, act as if `"true"...
diff --git /dev/null b/tests/builder/action.rs new file mode 100644 --- /dev/null +++ b/tests/builder/action.rs @@ -0,0 +1,347 @@ +#![allow(clippy::bool_assert_comparison)] + +use clap::builder::ArgAction; +use clap::Arg; +use clap::Command; + +#[test] +fn set_true() { + let cmd = + Command::new("test").arg(A...
default_value_if should work with flags that don't take a value ### 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 ### Clap Version 3.0.7 ### Describe your use case I want to have various ...
So there are ways around this in the builder API but this was reported against the derive API. I have been considering re-doing flags so that they set a value, rather than relying on them being preset or not which would resolve this (and simplify several other APIs).
2022-06-01T02:26:17Z
2022-06-01T12:07:30Z
3.1
20ed49a535d14afac1972dd3cc3003c97bcc744f
[ "builder::app_settings::test::app_settings_fromstr", "builder::arg::test::flag_display_multiple_aliases", "builder::arg::test::flag_display", "builder::arg::test::flag_display_single_alias", "builder::arg::test::flag_display_multiple_short_aliases", "builder::arg::test::flag_display_single_short_alias", ...
[]
[]
[]
clap-rs/clap
3,732
clap-rs__clap-3732
[ "3621" ]
740bb39f50883b5af97b62e041618d5433220245
diff --git a/.clippy.toml b/.clippy.toml --- a/.clippy.toml +++ b/.clippy.toml @@ -1,1 +1,1 @@ -msrv = "1.54.0" # MSRV +msrv = "1.56.0" # MSRV diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,7 +78,7 @@ jobs: build: [msrv, w...
diff --git a/.github/workflows/rust-next.yml b/.github/workflows/rust-next.yml --- a/.github/workflows/rust-next.yml +++ b/.github/workflows/rust-next.yml @@ -92,9 +92,9 @@ jobs: strategy: matrix: rust: - - 1.54.0 # MSRV + - 1.56.0 # MSRV - stable - continue-on-error: ${...
Add an option to not panic on value*of() of non valid arguments ### Please complete the following tasks - [X] I have searched the [discussions](https://github.com/clap-rs/clap/discussions) - [X] I have searched the [open](https://github.com/clap-rs/clap/issues) and [rejected](https://github.com/clap-rs/clap/issues?q=i...
It'd help if you explained why you don't want arguments validated. > Make so the cargo feature re-enable the former behavior. What does the `cargo` feature have to do with this request? The use case is the same as cargo's, the `cargo` feature is already there to accommodate the needs of cargo. > The use case is t...
2022-05-17T21:47:36Z
2022-05-18T00:25:21Z
3.1
20ed49a535d14afac1972dd3cc3003c97bcc744f
[ "generator::utils::tests::test_flags", "generator::utils::tests::test_all_subcommands", "generator::utils::tests::test_subcommands", "generator::utils::tests::test_shorts", "generator::utils::tests::test_flag_subcommand", "generator::utils::tests::test_find_subcommand_with_path", "register_minimal", "...
[]
[]
[]
clap-rs/clap
3,700
clap-rs__clap-3700
[ "2695" ]
55e791e80ed4167cb11d968546aabb96f6760029
diff --git a/src/build/arg.rs b/src/build/arg.rs --- a/src/build/arg.rs +++ b/src/build/arg.rs @@ -5287,7 +5287,10 @@ where write(&delim, false)?; } } - if (num_val_names == 1 && mult_val) || (arg.is_positional() && mult_occ) { + ...
diff --git a/tests/builder/help.rs b/tests/builder/help.rs --- a/tests/builder/help.rs +++ b/tests/builder/help.rs @@ -2552,6 +2552,63 @@ OPTIONS: ); } +#[test] +fn too_few_value_names_is_dotted() { + let cmd = Command::new("test").arg( + Arg::new("foo") + .long("foo") + .require...
Help me catch mismatches in number of values and value names ### 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 ### Clap Version 3.0.0-beta.2 ### Describe your use case The two main use cases I have ...
> 1 value name repeated repeated for each value That is a case of N:KN where number of values is a multiple of value names. (This is not supported in help message except when N = 1) Good point about that generalization of the 1:N case. Not sure if it ever shows up but if we have usage support for it, I'm assuming s...
2022-05-06T18:56:10Z
2022-05-06T19:15:50Z
3.1
20ed49a535d14afac1972dd3cc3003c97bcc744f
[ "build::arg::test::positional_display_multiple_values", "build::arg::test::positional_display_val_names_req", "build::usage_parser::test::create_option_usage_both_equals1", "help::too_many_value_names_panics - should panic", "indices::indices_mult_opts", "posix_compatible::mult_option_require_delim_overri...
[ "build::arg::test::option_display_multiple_aliases", "build::arg::test::positional_display_multiple_occurrences", "build::arg_settings::test::arg_settings_fromstr", "build::arg_group::test::arg_group_send_sync", "build::arg::test::flag_display_single_short_alias", "build::app_settings::test::app_settings_...
[ "app_settings::dont_collapse_args", "cargo::crate_name", "command::command", "cargo::crate_authors", "conflicts::conflict_output_with_required", "app_settings::require_eq", "app_settings::subcommand_required_else_help_error_message", "arg_aliases_short::invisible_short_arg_aliases_help_output", "con...
[]
clap-rs/clap
3,684
clap-rs__clap-3684
[ "2861" ]
17ec7757891a38965e8492f7a0a48e674a9536eb
diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -64,7 +64,7 @@ default = [ "suggestions", ] debug = ["clap_derive/debug", "backtrace"] # Enables debug messages -unstable-doc = ["derive", "cargo", "wrap_help", "yaml", "env", "unicode", "regex", "unstable-replace", "unstable-multicall", "un...
diff --git a/tests/builder/subcommands.rs b/tests/builder/subcommands.rs --- a/tests/builder/subcommands.rs +++ b/tests/builder/subcommands.rs @@ -494,7 +494,6 @@ For more information try --help ); } -#[cfg(feature = "unstable-multicall")] #[test] fn busybox_like_multicall() { fn applet_commands() -> [Co...
Stabilise `AppSettings::Multicall` Tracking Issue Original request: https://github.com/clap-rs/clap/issues/1120 Original PR: https://github.com/clap-rs/clap/pull/2817 Feature flag: `unstable-multicall` Known issues: - [x] https://github.com/clap-rs/clap/issues/2862 - [x] https://github.com/clap-rs/clap/iss...
Can you please fill up the known issues that are unresolved from the pr? > Can you please fill up the known issues that are unresolved from the pr? Working on it. *Note: I had assumed #2817 was merged when preparing to write this. I've intentionally not posted it on #2817 after finding out because I don't think we ...
2022-05-03T21:54:09Z
2022-05-20T17:42:56Z
3.1
20ed49a535d14afac1972dd3cc3003c97bcc744f
[ "app_settings::missing_positional_no_hyphen", "default_vals::default_if_arg_present_no_default_user_override", "default_vals::no_default_if_arg_present_with_value_no_default", "conflicts::flag_conflict_with_all", "groups::group_empty", "flags::lots_o_flags_combined", "flags::lots_o_flags_sep", "ignore...
[ "builder::arg::test::option_display_multiple_occurrences", "builder::arg::test::flag_display_multiple_aliases", "builder::arg_group::test::test_yaml", "builder::arg_group::test::test_from", "builder::arg_settings::test::arg_settings_fromstr", "builder::arg::test::option_display2", "builder::app_settings...
[ "app_settings::require_eq", "cargo::crate_authors", "cargo::crate_name", "command::command", "conflicts::conflict_output_rev", "conflicts::conflict_output_rev_with_required", "derive_order::derive_order_no_next_order", "derive_order::derive_order_next_order", "groups::req_group_with_conflict_usage_s...
[]
clap-rs/clap
3,670
clap-rs__clap-3670
[ "3669" ]
3ca1b7709408f8bb3ec6b48ac2b4854aabe643b7
diff --git a/src/build/command.rs b/src/build/command.rs --- a/src/build/command.rs +++ b/src/build/command.rs @@ -4008,15 +4008,19 @@ impl<'help> App<'help> { /// Call this on the top-level [`Command`] when done building and before reading state for /// cases like completions, custom help output, etc. p...
diff --git a/clap_complete/tests/snapshots/sub_subcommands.bash b/clap_complete/tests/snapshots/sub_subcommands.bash --- a/clap_complete/tests/snapshots/sub_subcommands.bash +++ b/clap_complete/tests/snapshots/sub_subcommands.bash @@ -73,7 +73,7 @@ _my-app() { return 0 ;; my__app__som...
Clap 3.1.13 fails to build by unwrapping a None value ### Please complete the following tasks - [X] I have searched the [discussions](https://github.com/clap-rs/clap/discussions) - [X] I have searched the [open](https://github.com/clap-rs/clap/issues) and [rejected](https://github.com/clap-rs/clap/issues?q=is%3Aissue+...
A minimal reproduction: ```rust use clap::{arg, Command}; fn main() { let mut cmd = Command::new("ctest").subcommand( Command::new("subcmd").subcommand( Command::new("multi") .about("tests subcommands") .author("Kevin K. <kbknapp@gmail.com>") ...
2022-05-01T00:17:19Z
2022-05-03T13:53:20Z
3.1
20ed49a535d14afac1972dd3cc3003c97bcc744f
[ "build::tests::issue_2090", "build::usage_parser::test::create_positional_usage0", "conflicts::two_conflicting_arguments", "grouped_values::grouped_value_short_flag_delimiter", "multiple_values::positional_min_less", "opts::issue_2022_get_flags_misuse", "opts::issue_1105_empty_value_long_equals", "mul...
[ "build::app_settings::test::app_settings_fromstr", "build::arg::test::flag_display", "build::arg::test::flag_display_multiple_aliases", "build::arg::test::flag_display_multiple_short_aliases", "build::arg::test::flag_display_single_alias", "build::arg::test::flag_display_single_short_alias", "build::arg...
[ "cargo::crate_description", "app_settings::issue_1093_allow_ext_sc", "arg_aliases_short::invisible_short_arg_aliases_help_output", "arg_aliases::invisible_arg_aliases_help_output", "cargo::crate_name", "conflicts::conflict_output", "app_settings::dont_collapse_args", "app_from_crate::app_from_crate", ...
[]
clap-rs/clap
3,521
clap-rs__clap-3521
[ "3514" ]
28162d49cd6a407bc503b128a74883f6228189b4
diff --git a/src/build/arg.rs b/src/build/arg.rs --- a/src/build/arg.rs +++ b/src/build/arg.rs @@ -4633,6 +4633,12 @@ impl<'help> Arg<'help> { self.num_vals } + /// Get the delimiter between multiple values + #[inline] + pub fn get_value_delimiter(&self) -> Option<char> { + self.val_deli...
diff --git a/tests/builder/default_vals.rs b/tests/builder/default_vals.rs --- a/tests/builder/default_vals.rs +++ b/tests/builder/default_vals.rs @@ -648,15 +648,47 @@ fn default_values_are_possible_values() { #[cfg(debug_assertions)] #[test] -#[should_panic = "Argument `arg`'s default_value=value failed validatio...
[3.1] Derive parsing FromStr args into a vector regression from 3.0 ### Please complete the following tasks - [X] I have searched the [discussions](https://github.com/clap-rs/clap/discussions) - [X] I have searched the [open](https://github.com/clap-rs/clap/issues) and [rejected](https://github.com/clap-rs/clap/issues...
The error message > thread 'main' panicked at 'Argument `values`'s default_value=a,b,a failed validation: ', /home/epage/src/personal/clap/src/build/debug_asserts.rs:690:21 > note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace This regression was introduced in #3423 because delimited valu...
2022-02-28T15:22:13Z
2022-02-28T15:55:22Z
3.1
20ed49a535d14afac1972dd3cc3003c97bcc744f
[ "build::arg::test::positional_display_multiple_values", "build::arg_group::test::test_yaml", "build::usage_parser::test::create_option_usage2", "build::usage_parser::test::create_option_usage3", "build::usage_parser::test::create_option_usage_long9", "app_settings::allow_missing_positional", "app_settin...
[ "build::app_settings::test::app_settings_fromstr", "build::arg::test::flag_display", "build::arg::test::flag_display_multiple_aliases", "build::arg::test::flag_display_multiple_short_aliases", "build::arg::test::flag_display_single_alias", "build::arg::test::flag_display_single_short_alias", "build::arg...
[ "app_from_crate::app_from_crate", "command::command", "app_settings::require_eq", "cargo::crate_name", "cargo::crate_version", "app_settings::arg_required_else_help_error_message", "arg_aliases::invisible_arg_aliases_help_output", "app_settings::dont_collapse_args", "default_vals::default_vals_donno...
[]
clap-rs/clap
3,453
clap-rs__clap-3453
[ "3335" ]
cb06496a0d4adbd1b328ad790777de2345da5e51
diff --git a/clap_complete/src/shells/zsh.rs b/clap_complete/src/shells/zsh.rs --- a/clap_complete/src/shells/zsh.rs +++ b/clap_complete/src/shells/zsh.rs @@ -545,7 +545,7 @@ fn write_flags_of(p: &App, p_global: Option<&App>) -> String { let mut ret = vec![]; for f in utils::flags(p) { - debug!("writ...
diff --git a/tests/builder/help.rs b/tests/builder/help.rs --- a/tests/builder/help.rs +++ b/tests/builder/help.rs @@ -2727,7 +2727,7 @@ fn disable_help_flag_affects_help_subcommand() { .find_subcommand("help") .unwrap() .get_arguments() - .map(|a| a.get_name()) + .map(|a| a.get...
`name` implies a user-facing meaning, causing confusion Maintainer's notes: - The root cause was [confusion over `name` vs `value_name` and impact on the rest of the API](https://github.com/clap-rs/clap/issues/3335#issuecomment-1020308017) - We should look into renaming `Arg::name` to `Arg::id` - We should also reso...
```rust use clap::Parser; #[derive(Debug, Parser)] pub struct Example { #[clap(short = 'S', long, conflicts_with = "version")] pub staged: bool, #[clap(name = "OBJ_ID")] pub object_id: String, #[clap(name = "VERSION")] pub version: Option<String>, } fn main() { println!("...
2022-02-11T20:13:32Z
2022-02-11T20:28:43Z
3.0
cb06496a0d4adbd1b328ad790777de2345da5e51
[ "build::app_tests::app_send_sync", "build::app_tests::global_setting", "build::app_tests::propagate_version", "build::app_tests::issue_2090", "build::arg::test::flag_display", "build::arg::test::flag_display_multiple_short_aliases", "build::arg::test::flag_display_multiple_aliases", "build::arg::test:...
[]
[]
[]
clap-rs/clap
3,423
clap-rs__clap-3423
[ "3202" ]
edf9d057c4df1a5cbd35fc18580fc535d1f7cd75
diff --git a/src/build/arg/debug_asserts.rs b/src/build/arg/debug_asserts.rs --- a/src/build/arg/debug_asserts.rs +++ b/src/build/arg/debug_asserts.rs @@ -44,6 +44,20 @@ pub(crate) fn assert_arg(arg: &Arg) { } assert_arg_flags(arg); + + assert_defaults(arg, "default_value", arg.default_vals.iter().copied...
diff --git a/tests/builder/default_missing_vals.rs b/tests/builder/default_missing_vals.rs --- a/tests/builder/default_missing_vals.rs +++ b/tests/builder/default_missing_vals.rs @@ -155,3 +155,33 @@ fn default_missing_value_flag_value() { false ); } + +#[cfg(debug_assertions)] +#[test] +#[should_panic =...
default_value may not be included in possible_values and only checked in a runtime ### 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 ### Clap Version 3.0.0-rc.7 ### Describe your use case A configur...
It would help if you included a fully working code sample and the current runtime error output. I have some guesses as to which errors you are seeing but I'd have to recreate a working sample to verify. This is needed to triage this for how important it is for resolving. ```rust use clap::Parser; #[derive(Parser)...
2022-02-08T20:42:52Z
2022-02-08T21:01:46Z
3.0
cb06496a0d4adbd1b328ad790777de2345da5e51
[ "build::arg::test::positional_display_val_names", "build::arg_group::test::arg_group_send_sync", "parse::matches::arg_matches::tests::test_default_osvalues", "build::usage_parser::test::create_option_usage_long4", "build::usage_parser::test::create_option_usage_long_equals1", "build::usage_parser::test::c...
[ "build::app::settings::test::app_settings_fromstr", "build::app::tests::app_send_sync", "build::app::tests::global_settings", "build::app::tests::global_setting", "build::app::tests::propagate_version", "build::app::tests::issue_2090", "build::arg::settings::test::arg_settings_fromstr", "build::arg::t...
[ "arg_aliases::visible_arg_aliases_help_output", "cargo::crate_name", "app_settings::subcommand_required_else_help_error_message", "display_order::very_large_display_order", "app_settings::issue_1093_allow_ext_sc", "arg_aliases_short::visible_short_arg_aliases_help_output", "conflicts::conflict_output_re...
[]
clap-rs/clap
3,421
clap-rs__clap-3421
[ "1264" ]
15f01789d2a6b8952a01a8a3881b94aed4a44f4c
diff --git a/src/parse/arg_matcher.rs b/src/parse/arg_matcher.rs --- a/src/parse/arg_matcher.rs +++ b/src/parse/arg_matcher.rs @@ -101,10 +101,6 @@ impl ArgMatcher { self.0.args.contains_key(arg) } - pub(crate) fn is_empty(&self) -> bool { - self.0.args.is_empty() - } - pub(crate) fn a...
diff --git a/tests/builder/app_settings.rs b/tests/builder/app_settings.rs --- a/tests/builder/app_settings.rs +++ b/tests/builder/app_settings.rs @@ -259,6 +259,21 @@ fn arg_required_else_help_over_reqs() { ); } +#[test] +fn arg_required_else_help_with_default() { + let result = App::new("arg_required") + ...
ArgRequiredElseHelp is ignored if there are *any* default values ### Rust Version rustc 1.25.0 (84203cac6 2018-03-25) ### Affected Version of clap 2.31.2 ### Expected Behavior Summary If `ArgRequiredElseHelp` is enabled, you should see the help menu if an option is not provided correctly. ### Actual B...
I think perhaps https://github.com/kbknapp/clap-rs/blob/master/src/app/validator.rs#L63 should use `!reqs_validated` instead of `matcher.is_empty()`. I dropped a PR in https://github.com/kbknapp/clap-rs/pull/1265; all tests pass still and the issue appears fixed. I'm not familiar enough to know if this is the best a...
2022-02-08T19:00:02Z
2022-02-08T20:23:38Z
3.0
cb06496a0d4adbd1b328ad790777de2345da5e51
[ "arg_settings::setting", "groups::unique_group_name - should panic", "conflicts::three_conflicting_arguments", "app_settings::arg_required_else_help_with_default", "conflicts::flag_conflict_with_all", "multiple_occurrences::multiple_occurrences_of_positional", "opts::require_equals_min_values_zero", "...
[ "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::arg::regex::tests::test_try_from_with_invalid_string", "build::app::tests::issue_2090", "bu...
[ "app_settings::subcommand_required_else_help_error_message", "flags::issue_1284_argument_in_flag_style", "cargo::crate_name", "conflicts::conflict_output", "arg_aliases_short::invisible_short_arg_aliases_help_output", "app_settings::single_arg_help_with_long_format_setting", "conflicts::conflict_output_...
[]
clap-rs/clap
3,420
clap-rs__clap-3420
[ "3076" ]
135b15467eda2394b017f2a7d25cda1417c0feec
diff --git a/src/build/app/mod.rs b/src/build/app/mod.rs --- a/src/build/app/mod.rs +++ b/src/build/app/mod.rs @@ -3286,32 +3286,10 @@ impl<'help> App<'help> { args } - pub(crate) fn unroll_requirements_for_arg( - &self, - arg: &Id, - matcher: Option<&ArgMatcher>, - ) -> Vec<I...
diff --git a/tests/builder/conflicts.rs b/tests/builder/conflicts.rs --- a/tests/builder/conflicts.rs +++ b/tests/builder/conflicts.rs @@ -425,3 +425,68 @@ fn conflicts_with_alongside_default() { assert_eq!(m.value_of("opt"), Some("default")); assert!(m.is_present("flag")); } + +#[test] +fn group_in_conflict...
Require rules ignore a defaulted value ### - [x] I have searched the [discussions](https://github.com/clap-rs/clap/discussions) - [x] I have searched the existing issues ### Description This consolidates: - https://github.com/clap-rs/clap/issues/2714 - https://github.com/clap-rs/clap/issues/1586 - https:/...
2022-02-08T18:27:21Z
2022-02-09T19:35:13Z
3.0
cb06496a0d4adbd1b328ad790777de2345da5e51
[ "build::usage_parser::test::create_option_usage_both_equals2", "app_settings::leading_double_hyphen_trailingvararg", "default_vals::default_if_arg_present_with_value_no_default", "grouped_values::grouped_value_long_flag_delimiter", "app_settings::issue_1066_allow_leading_hyphen_and_unknown_args_option", "...
[ "build::app::settings::test::app_settings_fromstr", "build::app::tests::app_send_sync", "build::app::tests::global_settings", "build::app::tests::propagate_version", "build::app::tests::global_setting", "build::app::tests::issue_2090", "build::arg::regex::tests::test_try_from_with_invalid_string", "bu...
[ "cargo::crate_description", "double_require::help_text", "app_settings::require_eq", "flag_subcommands::flag_subcommand_long_normal_usage_string", "app_settings::dont_collapse_args", "conflicts::conflict_output", "arg_aliases::invisible_arg_aliases_help_output", "derive_order::prefer_user_help_in_subc...
[]
clap-rs/clap
3,402
clap-rs__clap-3402
[ "3227" ]
5c3868ea4cb8063731d8526e8e97414942a987ae
diff --git a/examples/keyvalue-derive.md b/examples/keyvalue-derive.md --- a/examples/keyvalue-derive.md +++ b/examples/keyvalue-derive.md @@ -18,13 +18,13 @@ Args { defines: [("Foo", 10), ("Alice", 30)] } $ keyvalue-derive -D Foo ? failed -error: Invalid value for '-D <DEFINES>': invalid KEY=value: no `=` found in...
diff --git a/tests/builder/subcommands.rs b/tests/builder/subcommands.rs --- a/tests/builder/subcommands.rs +++ b/tests/builder/subcommands.rs @@ -511,7 +511,7 @@ fn subcommand_not_recognized() { assert!(utils::compare_output( app, "fake help", - "error: The subcommand 'help' wasn't recog...
Is it possible to not show usage string in post validation errors? Maintainer's notes: - If we move error formatting to display time, we can provide all of the information the user needs that the user can build the error as they need (see also #2628) -- ### Discussed in https://github.com/clap-rs/clap/discussions/32...
I assume you are specifically referring to errors reported by `App::error`? `App::error` was added in https://github.com/clap-rs/clap/pull/2890. In it, I did not have any specific errors in mind to be targeting as a similar use case and saw usage being reported in errors and included it. I do not see any comment...
2022-02-04T18:27:08Z
2022-02-07T21:37:31Z
3.0
cb06496a0d4adbd1b328ad790777de2345da5e51
[ "app_settings::args_negate_subcommands_one_level", "default_vals::osstr_positional_user_override", "delimiters::opt_s_default_no_delim", "double_require::valid_cases", "flag_subcommands::flag_subcommand_short_with_aliases_vis_and_hidden", "default_vals::opt_without_value_fail", "conflicts::arg_conflicts...
[ "build::app::settings::test::app_settings_fromstr", "build::app::tests::propagate_version", "build::arg::test::option_display_single_alias", "build::arg::test::option_display_multiple_occurrences", "build::arg::test::option_display3", "build::app::tests::issue_2090", "build::app::tests::app_send_sync", ...
[ "cargo::crate_description", "arg_aliases::visible_arg_aliases_help_output", "conflicts::conflict_output_with_required", "derive_order::derive_order_subcommand_propagate_with_explicit_display_order", "groups::req_group_with_conflict_usage_string", "error::app_error", "derive_order::prefer_user_help_in_su...
[]
clap-rs/clap
3,394
clap-rs__clap-3394
[ "3320" ]
d4cfceedabb908068473650410924ff2a522d5d1
diff --git a/src/parse/errors.rs b/src/parse/errors.rs --- a/src/parse/errors.rs +++ b/src/parse/errors.rs @@ -605,13 +605,37 @@ impl Error { Self::for_app(app, c, ErrorKind::ArgumentConflict, others) } - pub(crate) fn empty_value(app: &App, arg: &Arg, usage: String) -> Self { + pub(crate) fn empt...
diff --git a/tests/builder/possible_values.rs b/tests/builder/possible_values.rs --- a/tests/builder/possible_values.rs +++ b/tests/builder/possible_values.rs @@ -265,6 +265,33 @@ fn escaped_possible_values_output() { )); } +#[test] +fn missing_possible_value_error() { + assert!(utils::compare_output( + ...
Show possible values when an arguments value is missing ### 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 ### Clap Version v3.0.6 ### Describe your use case Many CLIs allow using the argument withou...
Maybe we should also have the unknown value error point people to this Today: ```console $ git-stack --color lklk Finished dev [unoptimized + debuginfo] target(s) in 0.04s Running `/home/epage/src/personal/git-stack/target/debug/git-stack --color lklk` error: Invalid value for '--color <WHEN>': Unknown...
2022-02-02T20:31:49Z
2022-02-02T20:49:39Z
3.0
cb06496a0d4adbd1b328ad790777de2345da5e51
[ "default_vals::default_if_arg_present_with_value_no_default_fail", "flag_subcommands::flag_subcommand_long_infer_exact_match", "groups::group_multi_value_single_arg", "help::prefer_user_help_short_1112", "multiple_values::option_exact_exact_not_mult", "app_settings::infer_subcommands_fail_no_args", "mul...
[ "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::regex::tests::test_try_from_with_invalid_string", "bu...
[ "error::app_error", "display_order::very_large_display_order", "groups::req_group_usage_string", "flag_subcommands::flag_subcommand_short_normal_usage_string", "cargo::crate_description", "double_require::help_text", "help::complex_help_output", "derive_order::derive_order", "app_settings::nested_he...
[]
clap-rs/clap
3,391
clap-rs__clap-3391
[ "1549" ]
7c79e76f2f55b1aab083fa201a86bbc8c8c35711
diff --git a/src/parse/errors.rs b/src/parse/errors.rs --- a/src/parse/errors.rs +++ b/src/parse/errors.rs @@ -642,7 +642,7 @@ impl Error { let suffix = suggestions::did_you_mean(&bad_val, good_vals.iter()).pop(); let arg = arg.to_string(); - let mut sorted: Vec<String> = good_vals + l...
diff --git a/tests/builder/possible_values.rs b/tests/builder/possible_values.rs --- a/tests/builder/possible_values.rs +++ b/tests/builder/possible_values.rs @@ -4,7 +4,7 @@ use clap::{App, Arg, ErrorKind, PossibleValue}; #[cfg(feature = "suggestions")] static PV_ERROR: &str = "error: \"slo\" isn't a valid value f...
Option not to reorder possible values for an argument ### Affected Version of clap 2.33.0 ### Bug or Feature Request Summary I have a list of possible *numeric* values for a given argument, but clap reorders them in alphabetical (non-numeric) order. ### Expected Behavior Summary Being able to tell clap n...
Actually, it looks like `--help` displays options as ordered in the input list, but when passing an invalid argument value, the list of possible values displayed is reordered. So it is only an issue in the latter situation for me.
2022-02-02T19:59:27Z
2022-02-02T20:11:22Z
3.0
cb06496a0d4adbd1b328ad790777de2345da5e51
[ "possible_values::escaped_possible_values_output", "possible_values::possible_values_hidden_output", "possible_values::possible_values_alias_output", "possible_values::possible_values_output" ]
[ "build::app::tests::app_send_sync", "build::app::tests::global_setting", "build::app::tests::global_settings", "build::arg::test::flag_display", "build::app::tests::propagate_version", "build::arg::test::flag_display_multiple_aliases", "build::arg::test::flag_display_multiple_short_aliases", "build::a...
[]
[]
clap-rs/clap
3,334
clap-rs__clap-3334
[ "3330" ]
afd0342a9b092eb5bf3d4ce165b8a6a5c5f8328b
diff --git a/src/parse/arg_matcher.rs b/src/parse/arg_matcher.rs --- a/src/parse/arg_matcher.rs +++ b/src/parse/arg_matcher.rs @@ -135,7 +135,7 @@ impl ArgMatcher { let id = &arg.id; debug!("ArgMatcher::inc_occurrence_of_arg: id={:?}", id); let ma = self.entry(id).or_insert(MatchedArg::new())...
diff --git a/src/parse/matches/matched_arg.rs b/src/parse/matches/matched_arg.rs --- a/src/parse/matches/matched_arg.rs +++ b/src/parse/matches/matched_arg.rs @@ -142,13 +142,13 @@ impl Default for MatchedArg { } } -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Partia...
Conflicting args both present ### 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.58.1 (db9d1b20b 2022-01-20) ### Clap Version 3.0.10 ### Minimal reproducible co...
So not dug into the debug output (which should have some useful stuff because I had to debug and rewrite conflicts right before release) or the code but my guess is that the core of the issue is using a flag. For an arg, we track presence, occurrences, and values. A lot of these rules only work on a value but flags...
2022-01-24T16:36:56Z
2022-01-24T16:51:28Z
3.0
cb06496a0d4adbd1b328ad790777de2345da5e51
[ "build::arg::tests::arg_send_sync", "app_settings::missing_positional_no_hyphen", "app_settings::propagate_vals_down", "app_settings::no_auto_version_mut_arg", "arg_settings::unset_setting", "app_settings::unset_global_setting", "app_settings::missing_positional_hyphen_far_back", "conflicts::arg_confl...
[ "build::app::settings::test::app_settings_fromstr", "build::app::tests::issue_2090", "build::arg::test::flag_display", "build::arg::test::option_display2", "build::arg::test::option_display_multiple_aliases", "build::arg::test::option_display_multiple_occurrences", "build::app::tests::propagate_version"...
[ "app_settings::arg_required_else_help_error_message", "arg_aliases::invisible_arg_aliases_help_output", "cargo::crate_description", "app_settings::skip_possible_values", "double_require::no_duplicate_error", "default_vals::default_vals_donnot_show_in_smart_usage", "conflicts::conflict_output_with_requir...
[]
BurntSushi/ripgrep
2,209
BurntSushi__ripgrep-2209
[ "2208" ]
4dc6c73c5a9203c5a8a89ce2161feca542329812
diff --git a/crates/printer/src/util.rs b/crates/printer/src/util.rs --- a/crates/printer/src/util.rs +++ b/crates/printer/src/util.rs @@ -82,26 +82,26 @@ impl<M: Matcher> Replacer<M> { dst.clear(); matches.clear(); - matcher - .replace_with_captures_at( - ...
diff --git a/tests/regression.rs b/tests/regression.rs --- a/tests/regression.rs +++ b/tests/regression.rs @@ -1044,3 +1044,77 @@ rgtest!(r1891, |dir: Dir, mut cmd: TestCommand| { // happen when each match needs to be detected. eqnice!("1:\n2:\n2:\n", cmd.args(&["-won", "", "test"]).stdout()); }); + +// See:...
Adding --replace to a --multiline search can expand what content is matched #### What version of ripgrep are you using? ``` ripgrep 13.0.0 -SIMD -AVX (compiled) +SIMD +AVX (runtime) ``` #### How did you install ripgrep? `apt`: ``` ripgrep: Installed: 13.0.0-2 Candidate: 13.0.0-2 Version table:...
I believe this is a duplicate of #2095.
2022-05-11T18:30:12Z
2022-06-10T18:11:34Z
13.0
7099e174acbcbd940f57e4ab4913fee4040c826e
[ "regression::r2208", "regression::r2095" ]
[ "config::tests::error", "config::tests::basic", "feature::f1155_auto_hybrid_regex", "binary::before_match2_explicit", "binary::after_match1_explicit_count", "binary::after_match1_explicit", "feature::context_sep", "binary::before_match1_explicit", "binary::after_match1_explicit_text", "feature::f1...
[]
[]
BurntSushi/ripgrep
1,294
BurntSushi__ripgrep-1294
[ "1293" ]
392682d35296bda5c0d0cccf43bae55be3d084df
diff --git a/complete/_rg b/complete/_rg --- a/complete/_rg +++ b/complete/_rg @@ -104,6 +104,10 @@ _rg() { '*'{-g+,--glob=}'[include/exclude files matching specified glob]:glob' '*--iglob=[include/exclude files matching specified case-insensitive glob]:glob' + + '(glob-case-insensitive)' # File-glob cas...
diff --git a/tests/misc.rs b/tests/misc.rs --- a/tests/misc.rs +++ b/tests/misc.rs @@ -341,6 +341,14 @@ rgtest!(glob_case_sensitive, |dir: Dir, mut cmd: TestCommand| { eqnice!("file2.html:Sherlock\n", cmd.stdout()); }); +rgtest!(glob_always_case_insensitive, |dir: Dir, mut cmd: TestCommand| { + dir.create("s...
For to --iglob even if -g #### What version of ripgrep are you using? ripgrep 11.0.1 -SIMD -AVX (compiled) +SIMD +AVX (runtime) #### How did you install ripgrep? brew install #### What operating system are you using ripgrep on? Mac OSx lastest #### Describe your question, feature request, or bug. ...
You can't. I suppose we could add a flag, `--glob-case-insensitive`, that is like `--ignore-file-case-insensitive`, and then you could put that in an alias or a config file. can you please add --ignore-file-case-insensitive, so that I can put the same in the config file appreciate your help `--ignore-file-case-insensi...
2019-06-06T17:39:55Z
2019-08-01T21:09:00Z
11.0
392682d35296bda5c0d0cccf43bae55be3d084df
[ "misc::glob_always_case_insensitive" ]
[ "config::tests::error", "config::tests::basic", "feature::f1155_auto_hybrid_regex", "feature::f1207_auto_encoding", "binary::before_match2_explicit", "binary::after_match1_explicit_count", "binary::after_match1_explicit_text", "binary::after_match1_stdin", "binary::after_match1_explicit", "binary:...
[]
[]
BurntSushi/ripgrep
954
BurntSushi__ripgrep-954
[ "948" ]
223d7d9846bff4a9aaf6ba84f5662a1ee7ffa900
diff --git a/src/main.rs b/src/main.rs --- a/src/main.rs +++ b/src/main.rs @@ -60,7 +60,7 @@ fn main() { Ok(_) => process::exit(0), Err(err) => { eprintln!("{}", err); - process::exit(1); + process::exit(2); } } }
diff --git a/tests/tests.rs b/tests/tests.rs --- a/tests/tests.rs +++ b/tests/tests.rs @@ -2191,3 +2191,33 @@ fn type_list() { // This can change over time, so just make sure we print something. assert!(!lines.is_empty()); } + +// See: https://github.com/BurntSushi/ripgrep/issues/948 +sherlock!( + exit_co...
use different exit codes for "no match" and "error" #### What version of ripgrep are you using? 0.8.1 #### How did you install ripgrep? Homebrew #### What operating system are you using ripgrep on? macOS 10.13.5 #### Describe your question, feature request, or bug. Hi! I am using ripgrep from wi...
> I've noticed that when I don't find anyhting in a search, ripgrep terminates with a non-zero exit code This is intended behavior. ripgrep continues this very long held tradition from grep, and I don't see myself changing it or providing a flag to change it. One place where ripgrep could probably use some improv...
2018-06-18T07:34:30Z
2018-06-19T12:54:14Z
0.8
223d7d9846bff4a9aaf6ba84f5662a1ee7ffa900
[ "exit_code_error" ]
[ "decoder::tests::peeker_empty", "config::tests::basic", "decoder::tests::peeker_four", "config::tests::error", "decoder::tests::peeker_one_at_a_time", "decoder::tests::peeker_one", "decoder::tests::peeker_two", "decoder::tests::trans_simple_auto", "decoder::tests::peeker_three", "decoder::tests::t...
[]
[]
BurntSushi/ripgrep
727
BurntSushi__ripgrep-727
[ "709" ]
b6177f0459044a7e3fb882ecda9c80e44e4d95de
diff --git a/src/args.rs b/src/args.rs --- a/src/args.rs +++ b/src/args.rs @@ -11,7 +11,7 @@ use std::sync::atomic::{AtomicBool, Ordering}; use clap; use encoding_rs::Encoding; use env_logger; -use grep::{Grep, GrepBuilder}; +use grep::{Grep, GrepBuilder, Error as GrepError}; use log; use num_cpus; use regex; dif...
diff --git a/tests/tests.rs b/tests/tests.rs --- a/tests/tests.rs +++ b/tests/tests.rs @@ -1599,6 +1599,16 @@ sherlock!(feature_419_zero_as_shortcut_for_null, "Sherlock", ".", assert_eq!(lines, "sherlock\x002\n"); }); +// See: https://github.com/BurntSushi/ripgrep/issues/709 +clean!(suggest_fixed_strings_for_in...
Suggest --fixed-strings on invalid regexps ``` $ rg "foo(" Error parsing regex near 'foo(' at character offset 3: Unclosed parenthesis. ``` I think ripgrep should suggest the `--fixed-strings` argument if there's a regex syntax error.
Hmmmm... I think I'd be OK with that. I can pick this one up next. One question though: Do we still want the error generated by the `regex` lib to be propagated all the way to the command line? Or are OK with replacing that with a generic error such as: "*Syntax error encountered while parsing provided regex. Please...
2018-01-01T15:57:18Z
2018-01-01T17:12:02Z
0.7
b6177f0459044a7e3fb882ecda9c80e44e4d95de
[ "suggest_fixed_strings_for_invalid_regex" ]
[ "decoder::tests::peeker_empty", "decoder::tests::peeker_four", "decoder::tests::peeker_one", "decoder::tests::peeker_one_at_a_time", "decoder::tests::peeker_two", "decoder::tests::peeker_three", "decoder::tests::trans_simple_auto", "decoder::tests::trans_simple_chinese", "decoder::tests::trans_simpl...
[]
[]
BurntSushi/ripgrep
723
BurntSushi__ripgrep-723
[ "544" ]
5e73075ef5300fdec03f6c4685750788108b00f4
diff --git a/complete/_rg b/complete/_rg --- a/complete/_rg +++ b/complete/_rg @@ -45,6 +45,7 @@ _rg() { '--ignore-file=[specify additional ignore file]:file:_files' '(-v --invert-match)'{-v,--invert-match}'[invert matching]' '(-n -N --line-number --no-line-number)'{-n,--line-number}'[show line numbers]'...
diff --git a/tests/tests.rs b/tests/tests.rs --- a/tests/tests.rs +++ b/tests/tests.rs @@ -103,6 +103,22 @@ sherlock!(line_numbers, |wd: WorkDir, mut cmd: Command| { assert_eq!(lines, expected); }); +sherlock!(line_number_width, |wd: WorkDir, mut cmd: Command| { + cmd.arg("-n"); + cmd.arg("--line-number-w...
Fixed width line numbers It would be nice to be able to see the indentation level of searched text line up. One way to do this would be to have fixed width line numbers in search results. This could be accomplished through an option flag and left-padding with either spaces or zeroes when the flag is active. As this ...
I think this has been suggested before, but you can't determine the correct padding without reading the entire file first (which isn't going to happen), and not having the correct padding seems like a bummer to me. Yes, for Solution 1 one would have to first find all the matches then figure out the padding, which would...
2017-12-30T15:35:13Z
2018-01-01T14:10:21Z
0.7
b6177f0459044a7e3fb882ecda9c80e44e4d95de
[ "line_number_width" ]
[ "decoder::tests::peeker_one", "decoder::tests::peeker_empty", "decoder::tests::peeker_four", "decoder::tests::peeker_one_at_a_time", "decoder::tests::peeker_three", "decoder::tests::peeker_two", "decoder::tests::trans_simple_big5_hkscs", "decoder::tests::trans_simple_chinese", "decoder::tests::trans...
[]
[]
tokio-rs/tracing
2,335
tokio-rs__tracing-2335
[ "2330" ]
330dacfa71c9ad664bbb73f6898aaaa5caa70fb6
diff --git a/tracing-attributes/src/attr.rs b/tracing-attributes/src/attr.rs --- a/tracing-attributes/src/attr.rs +++ b/tracing-attributes/src/attr.rs @@ -6,6 +6,14 @@ use quote::{quote, quote_spanned, ToTokens}; use syn::ext::IdentExt as _; use syn::parse::{Parse, ParseStream}; +/// Arguments to `#[instrument(err(...
diff --git a/tracing-attributes/tests/err.rs b/tracing-attributes/tests/err.rs --- a/tracing-attributes/tests/err.rs +++ b/tracing-attributes/tests/err.rs @@ -252,3 +252,72 @@ fn test_err_custom_target() { }); handle.assert_finished(); } + +#[instrument(err(level = "info"))] +fn err_info() -> Result<u8, TryF...
Configurable log level for `#[instrument(err)]` ## Feature Request I'd like to be able to specify the log level that `Err` returns are printed at. ### Crates `tracing::instrument` ### Motivation Currently it's hardcoded as `error`, but I have some functions that I'd like to instrument where returning an...
This is similar to the discussion #2328, which is about configuring the log level for the event generated by the `ret` argument to the attribute. As I mentioned in a comment on that discussion (https://github.com/tokio-rs/tracing/discussions/2328#discussioncomment-3755652), I think it definitely makes sense to make the...
2022-10-04T10:28:17Z
2022-10-10T21:51:59Z
0.2
0e3577f6f3995b92accee21e0737c25ef0f1953c
[ "impl_trait_return_type", "test_err_dbg", "test_early_return", "test", "test_async", "test_err_display_default", "test_mut", "test_mut_async", "test_err_custom_target", "test_impl_type", "test_dbg", "test_warn", "test_ret_and_ok", "test_ret_and_err", "test_custom_target" ]
[]
[]
[]
tokio-rs/tracing
2,090
tokio-rs__tracing-2090
[ "1831" ]
465f10adc1b744c2e7446ebe2a6f49d5f408df0f
diff --git a/tracing-attributes/src/expand.rs b/tracing-attributes/src/expand.rs --- a/tracing-attributes/src/expand.rs +++ b/tracing-attributes/src/expand.rs @@ -217,7 +217,7 @@ fn gen_block<B: ToTokens>( let mk_fut = match (err_event, ret_event) { (Some(err_event), Some(ret_event)) => quote_span...
diff --git a/tracing-attributes/tests/async_fn.rs b/tracing-attributes/tests/async_fn.rs --- a/tracing-attributes/tests/async_fn.rs +++ b/tracing-attributes/tests/async_fn.rs @@ -1,5 +1,6 @@ use tracing_mock::*; +use std::convert::Infallible; use std::{future::Future, pin::Pin, sync::Arc}; use tracing::collect::wi...
`#[instrument]` on a fn returning `Pin<Box<dyn Future>>` leads to bogus `unused_braces` lint ## Bug Report ### Version 0.1.29 ### Description When using a fn that returns a `Pin<Box<dyn Future>>` and uses an `async move` block, I get a bogus `unused_braces` lint. ```rust use std::future::Future; use st...
Huh, that's weird! I wonder what it is about the `#[instrument]` codegen that's incorrectly triggering that lint --- it should still always be generating an `async move` block... Looking at the expanded source, I highlighted the redundant braces that I think rustc is pointing at: Mind you, the expanded output might ...
2022-04-25T03:56:01Z
2022-04-25T23:04:14Z
0.2
0e3577f6f3995b92accee21e0737c25ef0f1953c
[ "async_fn_only_enters_for_polls", "async_fn_nested", "out_of_scope_fields", "async_fn_with_async_trait", "async_fn_with_async_trait_and_fields_expressions", "manual_impl_future", "manual_box_pin", "async_fn_with_async_trait_and_fields_expressions_with_generic_parameter" ]
[]
[]
[]
tokio-rs/tracing
2,027
tokio-rs__tracing-2027
[ "1708" ]
f58019e1a67cc98e87ad15bf42269fddbc271e36
diff --git a/tracing-subscriber/src/subscribe/mod.rs b/tracing-subscriber/src/subscribe/mod.rs --- a/tracing-subscriber/src/subscribe/mod.rs +++ b/tracing-subscriber/src/subscribe/mod.rs @@ -269,9 +269,111 @@ //! The [`Subscribe::boxed`] method is provided to make boxing a subscriber //! more convenient, but [`Box::n...
diff --git a/tracing-subscriber/tests/subscriber_filters/main.rs b/tracing-subscriber/tests/subscriber_filters/main.rs --- a/tracing-subscriber/tests/subscriber_filters/main.rs +++ b/tracing-subscriber/tests/subscriber_filters/main.rs @@ -5,9 +5,10 @@ use self::support::*; mod filter_scopes; mod targets; mod trees; ...
Unable to create a `Registry` with a dynamic number of `Layer`s ## Feature Request ### Crates Probably at least `tracing-subscriber`, maybe also others (`tracing-core`?). ### Motivation I would like to use a dynamic number of layers with a `Registry` in order to configure (at startup-time) the set of output...
> Edit: Maybe something like `impl Layer for Vec<Box<dyn Layer>>` could work? Then such a `Vec` could be added to the registry with `SubscriberExt::with()`. There was previously a discussion on discord about something like this, where I suggested that the user implement a type like ```rust pub struct DynLayerList<...
2022-03-25T23:26:01Z
2022-03-29T23:54:53Z
0.2
0e3577f6f3995b92accee21e0737c25ef0f1953c
[ "field::delimited::test::delimited_visitor", "field::delimited::test::delimited_new_visitor", "filter::targets::tests::expect_parse_valid", "filter::targets::tests::parse_numeric_level_directives", "filter::targets::tests::parse_level_directives", "filter::targets::tests::parse_ralith", "filter::targets...
[]
[]
[]
tokio-rs/tracing
1,853
tokio-rs__tracing-1853
[ "1857" ]
9d8d366b15e282ee7767c52e68df299673151587
diff --git a/.github/workflows/check_msrv.yml b/.github/workflows/check_msrv.yml --- a/.github/workflows/check_msrv.yml +++ b/.github/workflows/check_msrv.yml @@ -43,7 +43,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: check - args: --all --exclude=tracing-appender + args: --al...
diff --git a/.github/workflows/check_msrv.yml b/.github/workflows/check_msrv.yml --- a/.github/workflows/check_msrv.yml +++ b/.github/workflows/check_msrv.yml @@ -61,3 +61,20 @@ jobs: with: command: check args: --lib=tracing-appender + + # TODO: remove this once tracing's MSRV is bumped. + ch...
opentelemetry 0.17 support ## Feature Request ### Crates `tracing-opentelemetry` ### Motivation `opentelemetry` 0.17 is released, and it's nice to align the version numbers so that the types are compatible and structs can be passed between crates. ### Proposal Make a new release of `tracing-openteleme...
2022-01-22T17:55:07Z
2022-01-30T04:44:29Z
0.2
0e3577f6f3995b92accee21e0737c25ef0f1953c
[ "subscriber::tests::span_kind", "tracer::tests::assigns_default_trace_id_if_missing", "subscriber::tests::span_status_code", "subscriber::tests::includes_timings", "subscriber::tests::dynamic_span_names", "tracer::tests::sampled_context", "subscriber::tests::trace_id_from_existing_context", "subscribe...
[]
[]
[]
tokio-rs/tracing
1,619
tokio-rs__tracing-1619
[ "1618" ]
7dda7f5e90a649aee36eaa51c11b59f62470d456
diff --git a/tracing-subscriber/src/filter/layer_filters.rs b/tracing-subscriber/src/filter/layer_filters.rs --- a/tracing-subscriber/src/filter/layer_filters.rs +++ b/tracing-subscriber/src/filter/layer_filters.rs @@ -386,7 +386,7 @@ where id if id == TypeId::of::<MagicPlfDowncastMarker>() => { ...
diff --git /dev/null b/tracing-subscriber/tests/layer_filters/downcast_raw.rs new file mode 100644 --- /dev/null +++ b/tracing-subscriber/tests/layer_filters/downcast_raw.rs @@ -0,0 +1,68 @@ +use tracing::Subscriber; +use tracing_subscriber::filter::Targets; +use tracing_subscriber::prelude::*; +use tracing_subscriber:...
tracing_subscriber::Layer::downcast_raw not called when filtered ## Bug Report ### Version ``` tracing-downcast-bug v0.1.0 (/Users/bryan/personal/x-ray-test/tracing-downcast-bug) ├── tracing v0.1.28 (*) └── tracing-subscriber v0.2.24 (*) ``` ### Platform ``` Darwin Bryans-MacBook-Pro.local 20.6.0 Darwi...
2021-10-05T19:37:40Z
2021-10-06T11:54:08Z
0.1
df9666bdeb8da3e120af15e3c86f4655cb6b29de
[ "record_after_created", "downcast_raw::forward_downcast_raw_to_layer" ]
[ "field::delimited::test::delimited_visitor", "field::delimited::test::delimited_new_visitor", "filter::targets::tests::parse_level_directives", "filter::targets::tests::expect_parse_valid", "filter::targets::tests::parse_numeric_level_directives", "filter::targets::tests::parse_ralith", "filter::targets...
[]
[]
tokio-rs/tracing
1,523
tokio-rs__tracing-1523
[ "1348" ]
ac4a8dd27c0b28c36b9cf77cdc52b595168d1c5f
diff --git a/tracing-subscriber/CHANGELOG.md b/tracing-subscriber/CHANGELOG.md --- a/tracing-subscriber/CHANGELOG.md +++ b/tracing-subscriber/CHANGELOG.md @@ -1,3 +1,12 @@ +# Unreleased + +### Deprecated + +- **registry**: `SpanRef::parent_id`, which cannot properly support per-layer + filtering. Use `.parent().map(Sp...
diff --git a/tracing-subscriber/src/filter/layer_filters.rs b/tracing-subscriber/src/filter/layer_filters.rs --- a/tracing-subscriber/src/filter/layer_filters.rs +++ b/tracing-subscriber/src/filter/layer_filters.rs @@ -373,50 +1045,407 @@ where // === impl FilterId === impl FilterId { + const fn disabled() -> Se...
Subscriber/layer tree ## Feature Request Maybe more of an idea than a feature request… Instead of stack of layers with registry on the bottom, use a tree with registry in the root. ### Crates Possibly to `tracing-subscriber`. ### Motivation The motivation is two-fold. First, I find the model where ...
What you describe _is_ the long-term goal of `tracing-subscriber`: filters _should_ be able that can applied to arbitrary subtrees of layers. > I wonder if this has been considered and turned down for some reason, or if it would be worth trying out. I'm willing to draft some code and then show it to discuss if it ma...
2021-08-26T20:05:33Z
2021-09-14T18:40:32Z
0.1
df9666bdeb8da3e120af15e3c86f4655cb6b29de
[ "field::delimited::test::delimited_visitor", "field::delimited::test::delimited_new_visitor", "fmt::fmt_layer::test::synthesize_span_active", "fmt::fmt_layer::test::synthesize_span_close", "fmt::fmt_layer::test::is_lookup_span", "fmt::fmt_layer::test::fmt_layer_downcasts_to_parts", "fmt::fmt_layer::test...
[ "prefixed_event_macros", "prefixed_span_macros", "borrow_val_events", "borrow_val_spans", "callsite_macro_api", "debug", "debug_root", "debug_span_root", "debug_span", "debug_span_with_parent", "debug_with_parent", "error", "error_root", "error_span_root", "error_span", "error_span_wit...
[ "debug_shorthand", "borrowed_field", "both_shorthands", "display_shorthand", "event_with_message", "dotted_field_name", "event_without_message", "explicit_child_at_levels", "explicit_child", "message_without_delims", "moved_field", "nonzeroi32_event_without_message", "one_with_everything", ...
[]
tokio-rs/tracing
1,297
tokio-rs__tracing-1297
[ "1296", "1296" ]
ba57971f2c424b89338e39a5443575fd78b09bb6
diff --git a/tracing-attributes/src/lib.rs b/tracing-attributes/src/lib.rs --- a/tracing-attributes/src/lib.rs +++ b/tracing-attributes/src/lib.rs @@ -264,39 +264,45 @@ pub fn instrument( // the future instead of the wrapper if let Some(internal_fun) = get_async_trait_info(&input.block, input.sig.asyncness.is...
diff --git a/tracing-attributes/tests/async_fn.rs b/tracing-attributes/tests/async_fn.rs --- a/tracing-attributes/tests/async_fn.rs +++ b/tracing-attributes/tests/async_fn.rs @@ -4,6 +4,7 @@ mod support; use support::*; +use std::{future::Future, pin::Pin, sync::Arc}; use tracing::collect::with_default; use traci...
tracing-attributes 0.1.14 causes variables to be out of scope when they're in scope ## Bug Report <!-- Thank you for reporting an issue. Please fill in as much of the template below as you're able. --> ### Version ``` │ │ └── tracing v0.1.25 │ │ ├── tracing-attributes v0.1.14 (proc-macro) │ ...
cc @nightmared, it looks like this may have been introduced in #1228? I'll take a look soon. Hmm yes, I can reproduce this: ```rust impl TestImpl { #[instrument] fn fun(&self) -> Pin<Box<dyn std::future::Future<Output = ()> + Send>> { let val = self.clone(); Box::pin(as...
2021-03-11T18:41:30Z
2021-03-11T19:17:49Z
0.2
0e3577f6f3995b92accee21e0737c25ef0f1953c
[ "async_fn_nested", "async_fn_with_async_trait_and_fields_expressions_with_generic_parameter", "async_fn_with_async_trait", "async_fn_with_async_trait_and_fields_expressions", "async_fn_only_enters_for_polls" ]
[]
[]
[]
tokio-rs/tracing
1,291
tokio-rs__tracing-1291
[ "1219" ]
4ad1e62a2dd9f3e97a06ead14285993a9df99ea5
diff --git a/tracing-attributes/src/lib.rs b/tracing-attributes/src/lib.rs --- a/tracing-attributes/src/lib.rs +++ b/tracing-attributes/src/lib.rs @@ -74,7 +74,6 @@ patterns_in_fns_without_body, private_in_public, unconditional_recursion, - unused, unused_allocation, unused_comparisons, ...
diff --git a/tracing-attributes/Cargo.toml b/tracing-attributes/Cargo.toml --- a/tracing-attributes/Cargo.toml +++ b/tracing-attributes/Cargo.toml @@ -39,15 +39,14 @@ async-await = [] [dependencies] proc-macro2 = "1" -syn = { version = "1", default-features = false, features = ["full", "parsing", "printing", "visit...
#[instrument] - Future-proofing async-trait support in tracing-attributes Not a bug **yet**, but `async-trait` is working towards changing the way they wrap an async function in a trait impl (see https://github.com/dtolnay/async-trait/pull/143 for more details). More specifically, they are moving away from a design wh...
Hmm. IMO, I think instrumenting the outer function and _not_ the returned future is almost never the behavior that users will want, and doing that by default seems like it would be very surprising. In particular, when `#[async_trait]` is being used, there is never any actual code in the outer function, so entering the ...
2021-03-10T20:17:08Z
2021-03-10T20:44:20Z
0.1
df9666bdeb8da3e120af15e3c86f4655cb6b29de
[ "async_fn_with_async_trait" ]
[ "async_fn_only_enters_for_polls", "async_fn_nested", "async_fn_with_async_trait_and_fields_expressions", "async_fn_with_async_trait_and_fields_expressions_with_generic_parameter", "destructure_nested_tuples", "destructure_structs", "destructure_refs", "destructure_everything", "destructure_tuple_str...
[]
[]
tokio-rs/tracing
1,252
tokio-rs__tracing-1252
[ "79" ]
d8a46edafd0a51ee20e1d0e38e42274c7ca270ee
diff --git a/tracing/src/span.rs b/tracing/src/span.rs --- a/tracing/src/span.rs +++ b/tracing/src/span.rs @@ -322,6 +322,8 @@ use core::{ cmp, fmt, hash::{Hash, Hasher}, marker::PhantomData, + mem, + ops::Deref, }; /// Trait implemented by types which have a span `Id`. diff --git a/tracing/src...
diff --git a/tracing/src/span.rs b/tracing/src/span.rs --- a/tracing/src/span.rs +++ b/tracing/src/span.rs @@ -1301,4 +1494,6 @@ mod test { trait AssertSync: Sync {} impl AssertSync for Span {} + impl AssertSync for Entered<'_> {} + impl AssertSync for EnteredSpan {} } diff --git a/tracing/tests/span...
trace: Non-contextual span enter/leave I am currently instrumenting [`tokio-tower`](https://github.com/tower-rs/tokio-tower), and am running into a use-case that I don't think `tokio-trace` really supports. I want to trace the full path of a given request through the system, so the request is given its own `Span`. That...
As an addendum to this, it'd be great if it were possible to get a `Span` _back_ from the guard when you leave it. When the guard is owned, this should be mostly free, and would make it easier in the setting above to return the `Span` to the user if they gave it to us in the first place in case they want to operate on ...
2021-02-19T08:47:42Z
2021-02-19T22:08:00Z
0.2
0e3577f6f3995b92accee21e0737c25ef0f1953c
[ "event_macros_dont_infinite_loop", "prefixed_event_macros", "prefixed_span_macros", "borrow_val_events", "borrow_val_spans", "error", "event_with_parent", "event_root", "callsite_macro_api", "debug_span_root", "debug_with_parent", "error_span_root", "error_span", "debug_span", "field_sho...
[]
[]
[]
tokio-rs/tracing
1,236
tokio-rs__tracing-1236
[ "1227" ]
4609f22aff1ad88b81e749e2536761d6ee364d1f
diff --git a/tracing-attributes/src/lib.rs b/tracing-attributes/src/lib.rs --- a/tracing-attributes/src/lib.rs +++ b/tracing-attributes/src/lib.rs @@ -654,7 +654,8 @@ fn gen_body( quote_spanned!(block.span()=> let __tracing_attr_span = #span; let __tracing_attr_guard = __tracing_attr_...
diff --git a/tracing-attributes/tests/err.rs b/tracing-attributes/tests/err.rs --- a/tracing-attributes/tests/err.rs +++ b/tracing-attributes/tests/err.rs @@ -116,3 +116,34 @@ fn test_mut_async() { }); handle.assert_finished(); } + +#[test] +fn impl_trait_return_type() { + // Reproduces https://github.com...
impl Trait not allowed after updating tracing-attributes:0.1.12 ## Bug Report Hey :wave: thanks for taking the time to look at the following issue :blush: ### Version The versions are: `tracing = 0.1.23` `tracing-attributes = 0.1.12` `tracing-core = 0.1.17` Here's the [`Cargo.lock`](https://github.com/r...
Thanks for the report! I think the issue is due to PR #1006, which changed `#[instrument(err)]` to handle early error returns by wrapping the function body in a closure that's immediately invoked. You'll notice here that we annotate that closure with the function's return type: https://github.com/tokio-rs/tracing/b...
2021-02-11T19:23:22Z
2021-02-11T20:24:50Z
0.1
df9666bdeb8da3e120af15e3c86f4655cb6b29de
[ "test_async", "test_mut_async", "test_mut", "test" ]
[ "impl_trait_return_type", "skip", "override_everything", "fields", "methods", "generics" ]
[]
[]
tokio-rs/tracing
1,233
tokio-rs__tracing-1233
[ "1227" ]
881091a1dd5d3126faeabbca9e3779f1d16c3cce
diff --git a/tracing-attributes/src/lib.rs b/tracing-attributes/src/lib.rs --- a/tracing-attributes/src/lib.rs +++ b/tracing-attributes/src/lib.rs @@ -469,7 +469,8 @@ fn gen_body( quote_spanned!(block.span()=> let __tracing_attr_span = #span; let __tracing_attr_guard = __tracing_attr_...
diff --git a/tracing-attributes/tests/err.rs b/tracing-attributes/tests/err.rs --- a/tracing-attributes/tests/err.rs +++ b/tracing-attributes/tests/err.rs @@ -137,3 +137,34 @@ fn test_mut_async() { }); handle.assert_finished(); } + +#[test] +fn impl_trait_return_type() { + // Reproduces https://github.com...
impl Trait not allowed after updating tracing-attributes:0.1.12 ## Bug Report Hey :wave: thanks for taking the time to look at the following issue :blush: ### Version The versions are: `tracing = 0.1.23` `tracing-attributes = 0.1.12` `tracing-core = 0.1.17` Here's the [`Cargo.lock`](https://github.com/r...
Thanks for the report! I think the issue is due to PR #1006, which changed `#[instrument(err)]` to handle early error returns by wrapping the function body in a closure that's immediately invoked. You'll notice here that we annotate that closure with the function's return type: https://github.com/tokio-rs/tracing/b...
2021-02-09T23:59:01Z
2021-02-10T23:36:09Z
0.2
0e3577f6f3995b92accee21e0737c25ef0f1953c
[ "test", "test_mut", "test_early_return", "test_async", "test_mut_async" ]
[ "impl_trait_return_type", "generics", "fields", "methods", "skip", "override_everything" ]
[]
[]
tokio-rs/tracing
1,228
tokio-rs__tracing-1228
[ "1219" ]
fe59f7720342b3d313fe11bd3c7490b0e10aef2c
diff --git a/tracing-attributes/src/lib.rs b/tracing-attributes/src/lib.rs --- a/tracing-attributes/src/lib.rs +++ b/tracing-attributes/src/lib.rs @@ -74,7 +74,6 @@ patterns_in_fns_without_body, private_in_public, unconditional_recursion, - unused, unused_allocation, unused_comparisons, ...
diff --git a/tracing-attributes/Cargo.toml b/tracing-attributes/Cargo.toml --- a/tracing-attributes/Cargo.toml +++ b/tracing-attributes/Cargo.toml @@ -34,15 +34,14 @@ proc-macro = true [dependencies] proc-macro2 = "1" -syn = { version = "1", default-features = false, features = ["full", "parsing", "printing", "visi...
#[instrument] - Future-proofing async-trait support in tracing-attributes Not a bug **yet**, but `async-trait` is working towards changing the way they wrap an async function in a trait impl (see https://github.com/dtolnay/async-trait/pull/143 for more details). More specifically, they are moving away from a design wh...
Hmm. IMO, I think instrumenting the outer function and _not_ the returned future is almost never the behavior that users will want, and doing that by default seems like it would be very surprising. In particular, when `#[async_trait]` is being used, there is never any actual code in the outer function, so entering the ...
2021-02-06T21:29:50Z
2021-03-10T20:30:17Z
0.2
0e3577f6f3995b92accee21e0737c25ef0f1953c
[ "async_fn_with_async_trait", "src/lib.rs - instrument (line 228)" ]
[ "async_fn_only_enters_for_polls", "async_fn_nested", "async_fn_with_async_trait_and_fields_expressions", "async_fn_with_async_trait_and_fields_expressions_with_generic_parameter", "destructure_nested_tuples", "destructure_refs", "destructure_everything", "destructure_tuple_structs", "destructure_str...
[]
[]
tokio-rs/tracing
1,017
tokio-rs__tracing-1017
[ "861" ]
cb1dd95b8a67c3c69450882e8f8818546330a8ff
diff --git a/tracing-core/Cargo.toml b/tracing-core/Cargo.toml --- a/tracing-core/Cargo.toml +++ b/tracing-core/Cargo.toml @@ -27,7 +27,8 @@ edition = "2018" [features] default = ["std"] -std = ["lazy_static"] +alloc = [] +std = ["lazy_static", "alloc"] [badges] maintenance = { status = "actively-developed" } d...
diff --git a/tracing-core/src/dispatcher.rs b/tracing-core/src/dispatcher.rs --- a/tracing-core/src/dispatcher.rs +++ b/tracing-core/src/dispatcher.rs @@ -783,13 +945,13 @@ mod test { #[test] fn dispatch_is() { - let dispatcher = Dispatch::new(NoSubscriber); + let dispatcher = Dispatch::from_s...
core: avoid scoped dispatch overhead when scoped dispatchers are not in use Currently, the global default dispatcher is essentially implemented as a layer on top of the scoped default dispatcher. This means that using the global default dispatcher still pays some of the overhead of the scoped default dispatcher. In p...
2020-10-06T00:17:02Z
2020-10-07T21:34:06Z
0.2
0e3577f6f3995b92accee21e0737c25ef0f1953c
[ "callsite::tests::linked_list_empty", "callsite::tests::linked_list_push", "callsite::tests::linked_list_push_several", "callsite::tests::linked_list_repeated", "dispatcher::test::default_dispatch", "dispatcher::test::default_no_subscriber", "dispatcher::test::dispatch_downcasts", "dispatcher::test::d...
[]
[]
[]
serde-rs/serde
2,709
serde-rs__serde-2709
[ "2708" ]
5b24f88e73caa9c607527b5b4696fc34263cd238
diff --git a/serde/build.rs b/serde/build.rs --- a/serde/build.rs +++ b/serde/build.rs @@ -64,6 +64,12 @@ fn main() { if minor < 64 { println!("cargo:rustc-cfg=no_core_cstr"); } + + // Support for core::num::Saturating and std::num::Saturating stabilized in Rust 1.74 + // https://blog.rust-lang...
diff --git a/test_suite/tests/test_de.rs b/test_suite/tests/test_de.rs --- a/test_suite/tests/test_de.rs +++ b/test_suite/tests/test_de.rs @@ -23,7 +23,7 @@ use std::iter; use std::net; use std::num::{ NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize, NonZeroU128, - NonZeroU16, NonZero...
Impl Serialize/Deserialize for std::num::Saturating<T> It would be nice if we could get ``` use std::num::Saturating; impl Deserialize for Saturating<T: Deserialize> { ... } impl Serialize for Saturating<T: Serialize> { ... } ``` so that it is possible to handle wrapped types, that already support those tra...
Edit: I mixed up `Wrapping` and `Saturating`. However, I still want to link to the implementations for [Serialize](https://github.com/serde-rs/serde/blob/89139e2c11c9e975753ebe82745071acb47ecb03/serde/src/ser/impls.rs#L1016-L1027) and [Deserialize](https://github.com/serde-rs/serde/blob/89139e2c11c9e975753ebe82745071ac...
2024-03-04T18:04:22Z
2024-04-16T21:23:09Z
1.19
5b24f88e73caa9c607527b5b4696fc34263cd238
[ "test_btreemap", "test_array", "test_btreeset", "test_cstr", "test_enum_other", "test_box", "test_bool", "test_bound", "test_enum_map", "test_char", "test_atomics", "test_arc", "test_arc_weak_some", "test_cstring", "test_boxed_path", "test_boxed_slice", "test_arc_dst", "test_arc_we...
[]
[]
[]
clap-rs/clap
3,311
clap-rs__clap-3311
[ "3310" ]
4b60440d91c02a472e31e66117c34b0fc9e6d09a
diff --git a/src/build/app/mod.rs b/src/build/app/mod.rs --- a/src/build/app/mod.rs +++ b/src/build/app/mod.rs @@ -2932,7 +2932,7 @@ impl<'help> App<'help> { help_subcmd.long_version = None; help_subcmd = help_subcmd .setting(AppSettings::DisableHelpFlag) - .uns...
diff --git a/tests/builder/help.rs b/tests/builder/help.rs --- a/tests/builder/help.rs +++ b/tests/builder/help.rs @@ -2734,3 +2734,28 @@ fn disable_help_flag_affects_help_subcommand() { args ); } + +#[test] +fn dont_propagate_version_to_help_subcommand() { + let app = clap::App::new("test") + ...
debug_assert fails with PropagateVersion in 3.0.8/3.0.9, but get_matches does not ### 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.57.0 (f1edd0429 2021-11-29) ### Clap Versi...
2022-01-18T20:40:23Z
2022-01-18T20:58:38Z
3.0
cb06496a0d4adbd1b328ad790777de2345da5e51
[ "app_settings::delim_values_trailingvararg_with_delim", "app_settings::stop_delim_values_only_pos_follows", "default_vals::default_if_arg_present_no_arg_with_default", "default_vals::default_if_arg_present_with_default", "delimiters::opt_s_no_space_mult_no_delim", "global_args::issue_1076", "groups::gro...
[ "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::regex::tests::test_try_from_with_invalid_string", "bu...
[ "app_settings::arg_required_else_help_error_message", "app_settings::skip_possible_values", "app_settings::single_arg_help_with_long_format_setting", "app_settings::require_eq", "help::arg_short_conflict_with_help", "cargo::crate_version", "app_settings::subcommand_required_else_help_error_message", "...
[]
clap-rs/clap
3,225
clap-rs__clap-3225
[ "3217" ]
a0ab35d678d797041aad20ff9e99ddaa52b84e24
diff --git a/src/build/app/mod.rs b/src/build/app/mod.rs --- a/src/build/app/mod.rs +++ b/src/build/app/mod.rs @@ -2601,6 +2601,7 @@ impl<'help> App<'help> { self._derive_display_order(); let mut pos_counter = 1; + let self_override = self.is_set(AppSettings::AllArgsOverrideSelf);...
diff --git a/src/parse/matches/matched_arg.rs b/src/parse/matches/matched_arg.rs --- a/src/parse/matches/matched_arg.rs +++ b/src/parse/matches/matched_arg.rs @@ -158,47 +155,6 @@ pub(crate) enum ValueType { mod tests { use super::*; - #[test] - fn test_vals_override() { - let mut m = MatchedArg::n...
Flags that take multiple value cannot be partially overridden ### 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.56.0 (09c42c458 2021-10-18) ### Clap Version 3.0.0...
Thanks for reporting this! Alright, got a local reproduction of the before/after. For easily switching between structopt and clap3, I used this code ```rust //use clap::StructOpt; use structopt::StructOpt; /// Simple program to greet a person #[derive(StructOpt, Debug)] struct Args { /// Number of times...
2021-12-27T21:33:04Z
2022-01-01T15:47:17Z
0.14
a0ab35d678d797041aad20ff9e99ddaa52b84e24
[ "default_vals::default_if_arg_present_with_value_no_default", "flag_subcommands::flag_subcommand_short_conflict_with_arg_alias - should panic", "flag_subcommands::flag_subcommand_short_with_aliases_hyphen - should panic", "help::disable_help_flag_affects_help_subcommand", "multiple_values::option_short_min_...
[ "build::arg::regex::tests::from_str", "build::app::tests::propagate_version", "build::arg::test::flag_display_multiple_aliases", "build::arg::test::option_display_multiple_aliases", "build::arg::test::flag_display_single_short_alias", "build::app::settings::test::app_settings_fromstr", "build::arg::test...
[ "app_from_crate::app_from_crate", "conflicts::conflict_output", "arg_aliases_short::invisible_short_arg_aliases_help_output", "conflicts::conflict_output_with_required", "app_settings::nested_help_subcommand_with_global_setting", "app_settings::single_arg_help_with_long_format_setting", "derive_order::n...
[]
clap-rs/clap
3,212
clap-rs__clap-3212
[ "3197" ]
a37f2908c8856dad3007e5bc8399fe89643af5a0
diff --git a/examples/tutorial_builder/README.md b/examples/tutorial_builder/README.md --- a/examples/tutorial_builder/README.md +++ b/examples/tutorial_builder/README.md @@ -476,7 +476,7 @@ $ 04_03_relations --major --minor error: The argument '--major' cannot be used with '--minor' USAGE: - 04_03_relations[EXE...
diff --git a/tests/builder/conflicts.rs b/tests/builder/conflicts.rs --- a/tests/builder/conflicts.rs +++ b/tests/builder/conflicts.rs @@ -2,7 +2,7 @@ use crate::utils; use clap::{arg, App, Arg, ArgGroup, ErrorKind}; -static CONFLICT_ERR: &str = "error: The argument '-F' cannot be used with '--flag' +static CONFLI...
Internal error when using `conflicts_with` with `ArgGroup` ### 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.57.0 (f1edd0429 2021-11-29) ### Clap Version 3.0.0-rc.7 ### Min...
Backported this to clap2 and it works ```rust use clap::{App, Arg, ArgGroup}; fn main() { let m = App::new("demoapp") .arg( Arg::with_name("foo") .long("foo") .conflicts_with("argument-group"), ) .arg(Arg::with_name("bar").long("bar")) ...
2021-12-23T19:52:38Z
2022-01-01T05:56:44Z
0.14
a0ab35d678d797041aad20ff9e99ddaa52b84e24
[ "build::arg::test::flag_display", "conflicts::two_conflicting_arguments", "conflicts::three_conflicting_arguments", "help::subcommand_long_help", "conflicts::arg_conflicts_with_group", "help::arg_help_heading_applied", "skip::skip_enum" ]
[ "build::arg::settings::test::arg_settings_fromstr", "build::arg::test::option_display3", "build::arg::test::flag_display_multiple_aliases", "build::app::tests::global_setting", "build::app::tests::propagate_version", "build::app::tests::app_send_sync", "build::arg::test::flag_display_single_alias", "b...
[ "cargo::crate_version", "conflicts::conflict_output_three_conflicting", "derive_order::derive_order_subcommand_propagate_with_explicit_display_order", "help::after_and_before_help_output", "derive_order::prefer_user_help_in_subcommand_with_derive_order", "flag_subcommands::flag_subcommand_short_normal_usa...
[]
clap-rs/clap
3,196
clap-rs__clap-3196
[ "3193" ]
27893cfd9a4dec68c54720dd540ab217112d6f54
diff --git a/src/parse/parser.rs b/src/parse/parser.rs --- a/src/parse/parser.rs +++ b/src/parse/parser.rs @@ -1072,11 +1072,12 @@ impl<'help, 'app> Parser<'help, 'app> { || v.is_set(ArgSettings::HiddenShortHelp) }; + // Subcommands aren't checked because we prefer short help for them...
diff --git a/tests/builder/help.rs b/tests/builder/help.rs --- a/tests/builder/help.rs +++ b/tests/builder/help.rs @@ -597,14 +597,11 @@ USAGE: about-in-subcommands-list [SUBCOMMAND] OPTIONS: - -h, --help - Print help information + -h, --help Print help information SUBCOMMANDS: - help ...
Next-line help is always used despite no long-help being shown (despite `long_about` being set on a subcommand) ### Discussed in https://github.com/clap-rs/clap/discussions/3178 ### clap version `master` ### rust version `rustc 1.59.0-nightly (404c8471a 2021-12-14)` ### Minimal Reproducible Code ```r...
@pksunkara wanted to check in in case you had any extra context on - why subcommands give precedence to `about` on `--help`, unlike args - why `next_line_help` is being used by subcommands even if we don't show `long_about` If curious, you can see my [comment in the discussion](https://github.com/clap-rs/clap/dis...
2021-12-17T15:38:19Z
2021-12-17T15:54:05Z
0.14
a0ab35d678d797041aad20ff9e99ddaa52b84e24
[ "build::arg::regex::tests::test_try_from_with_valid_string", "build::usage_parser::test::create_option_usage1", "output::help::test::display_width_handles_emojis", "output::help::test::display_width_handles_non_ascii", "flag_subcommands::flag_subcommand_long_with_aliases", "global_args::global_arg_availab...
[ "build::app::settings::test::app_settings_fromstr", "build::app::tests::app_send_sync", "build::app::tests::global_settings", "build::app::tests::global_setting", "build::app::tests::issue_2090", "build::app::tests::propagate_version", "build::arg::regex::tests::test_try_from_with_invalid_string", "bu...
[ "app_settings::nested_help_subcommand_with_global_setting", "app_settings::skip_possible_values", "error::app_error", "app_settings::require_eq", "derive_order::derive_order", "groups::req_group_with_conflict_usage_string", "help::after_and_before_long_help_output", "cargo::crate_name", "default_val...
[]
clap-rs/clap
3,179
clap-rs__clap-3179
[ "3096" ]
56ed9981da3a28205efa03a0e4f162359bab1dfe
diff --git a/examples/demo.md b/examples/demo.md --- a/examples/demo.md +++ b/examples/demo.md @@ -6,7 +6,6 @@ Used to validate README.md's content ```bash $ demo --help clap [..] - A simple to use, efficient, and full-featured Command Line Argument Parser USAGE: diff --git a/examples/derive_ref/custom_bool.md b...
diff --git a/tests/builder/app_from_crate.rs b/tests/builder/app_from_crate.rs --- a/tests/builder/app_from_crate.rs +++ b/tests/builder/app_from_crate.rs @@ -3,7 +3,6 @@ use clap::{app_from_crate, ErrorKind}; static EVERYTHING: &str = "clap {{version}} - A simple to use, efficient, and full-featured Command Line ...
Too much whitespace in output ### 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.55.0 (c8dfcfe04 2021-09-06) ### Clap Version 3.0.0-rc.0 ### Minimal reproducibl...
This is intentional IIRC because of https://github.com/clap-rs/clap/issues/1432 Thanks for the context; I had assumed it was done for a reason but hadn't looked yet. I still think this is worth having as an issue as it is a regression. We are balancing competing needs and maybe we can find a third way (without just...
2021-12-15T16:37:16Z
2021-12-15T16:47:52Z
0.14
a0ab35d678d797041aad20ff9e99ddaa52b84e24
[ "build::arg::regex::tests::from_str", "groups::group_multiple_args_error", "indices::indices_mult_flags_opt_combined", "posix_compatible::mult_option_overrides_itself", "doc_comments_help::empty_line_in_doc_comment_is_double_linefeed" ]
[ "build::app::settings::test::app_settings_fromstr", "build::app::tests::app_send_sync", "build::app::tests::global_settings", "build::app::tests::global_setting", "build::app::tests::propagate_version", "build::app::tests::issue_2090", "build::arg::test::flag_display", "build::arg::settings::test::arg...
[ "app_settings::dont_collapse_args", "derive_order::derive_order_subcommand_propagate", "app_from_crate::app_from_crate", "app_settings::subcommand_required_else_help_error_message", "display_order::very_large_display_order", "conflicts::conflict_output_three_conflicting", "derive_order::derive_order_sub...
[]
clap-rs/clap
3,169
clap-rs__clap-3169
[ "2724" ]
fa439d4f272e55c116e8a272f31efa35cf1e8e0a
diff --git a/src/build/app/mod.rs b/src/build/app/mod.rs --- a/src/build/app/mod.rs +++ b/src/build/app/mod.rs @@ -2839,7 +2839,11 @@ impl<'help> App<'help> { { debug!("App::_check_help_and_version: Building help subcommand"); self.subcommands.push( - App::new("help").a...
diff --git a/clap_generate/tests/completions/bash.rs b/clap_generate/tests/completions/bash.rs --- a/clap_generate/tests/completions/bash.rs +++ b/clap_generate/tests/completions/bash.rs @@ -72,7 +72,7 @@ static BASH: &str = r#"_myapp() { return 0 ;; myapp__help) - opts="-h...
global_setting DisableVersionFlag and DisableHelpFlag don't remove auto completion for subcommands fully ### 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.54.0 (a178d03...
For ```rust use clap::{AppSettings, IntoApp, Parser}; use clap_generate::generators; fn main() { // App::parse(); clap_generate::generate::<_, _>( generators::Fish, &mut App::into_app(), "command", &mut std::io::stdout(), ); } #[derive(Parser)] #[clap(glob...
2021-12-13T22:02:00Z
2021-12-13T22:17:39Z
0.14
a0ab35d678d797041aad20ff9e99ddaa52b84e24
[ "completions::fig::fig_with_special_commands", "completions::fig::fig", "completions::fig::fig_with_sub_subcommands", "help::disable_help_flag_affects_help_subcommand" ]
[ "generate_completions", "fig_with_value_hints", "completions::fig::fig_with_aliases", "completions::fig::fig_with_special_help", "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_from_crate::app_from_crate", "error::app_error", "groups::group_usage_use_val_name", "app_settings::nested_help_subcommand_with_global_setting", "help::args_with_last_usage", "app_settings::subcommand_required_else_help_error_message", "flag_subcommands::flag_subcommand_long_normal_usage_string", ...
[]
clap-rs/clap
2,930
clap-rs__clap-2930
[ "2928" ]
3f933e17433cea57382b71af2f7c2a57c00ec72a
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 @@ -812,6 +812,11 @@ impl Attrs { } } + pub fn help_heading(&self) -> TokenStream { + let help_heading = self.help_heading.as_ref().into_iter(); + quote!( #(#he...
diff --git a/clap_derive/tests/help.rs b/clap_derive/tests/help.rs --- a/clap_derive/tests/help.rs +++ b/clap_derive/tests/help.rs @@ -159,3 +159,27 @@ fn app_help_heading_flattened() { .unwrap(); assert_eq!(should_be_in_sub_c.get_help_heading(), Some("SUB C")); } + +#[test] +fn flatten_field_with_help_h...
Can't set help_heading on flattened arguments in `clap_derive` ### 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.55.0 (c8dfcfe04 2021-09-06) ### Clap Version master ### Min...
In fixing this, we'll be introducing a different bug, if both the field and flattened-struct provide `help_heading`, the flattened-struct will win. We can't fix this without overcomplicating the interface. I do think allowing to set help_heading when flattening is worth it enough to have that bug. In general, I'd re...
2021-10-23T16:17:21Z
2021-10-25T13:16:25Z
0.14
a0ab35d678d797041aad20ff9e99ddaa52b84e24
[ "flatten_field_with_help_heading" ]
[ "app_help_heading_flattened", "arg_help_heading_applied", "app_help_heading_applied" ]
[]
[]
clap-rs/clap
2,895
clap-rs__clap-2895
[ "2803" ]
6eacd8a7476e352d590c1bfae4b983e9eafae2b3
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 @@ -198,13 +198,18 @@ pub fn gen_augment( | Kind::ExternalSubcommand => None, Kind::Flatten => { let ty = &field.ty; + ...
diff --git a/clap_derive/tests/help.rs b/clap_derive/tests/help.rs --- a/clap_derive/tests/help.rs +++ b/clap_derive/tests/help.rs @@ -1,4 +1,4 @@ -use clap::{Args, IntoApp, Parser}; +use clap::{Args, IntoApp, Parser, Subcommand}; #[test] fn arg_help_heading_applied() { diff --git a/clap_derive/tests/help.rs b/clap...
Don't leak `help_heading` when flattening ### 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.55.0 (c8dfcfe04 2021-09-06) ### Clap Version v3.0.0-beta.4 ### Mini...
I'm assuming we'd need to add a `get_heading_help` and have the derive get it and then restore it afterwards. Oddly enough I ran into exactly this at work the other day. > I'm assuming we'd need to add a get_heading_help and have the derive get it and then restore it afterwards. Yeah that's the best way I can thi...
2021-10-16T15:20:50Z
2021-10-18T21:16:50Z
0.14
a0ab35d678d797041aad20ff9e99ddaa52b84e24
[ "app_help_heading_flattened" ]
[ "app_help_heading_applied", "arg_help_heading_applied" ]
[]
[]
clap-rs/clap
2,882
clap-rs__clap-2882
[ "2785" ]
f9208ae4e3c2e1f7eac6de20456f42f45b9d3b8d
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 @@ -106,6 +106,7 @@ pub struct Attrs { author: Option<Method>, version: Option<Method>, verbatim_doc_comment: Option<Ident>, + help_heading: Option<Method>, is_enum: bool...
diff --git /dev/null b/clap_derive/tests/help.rs new file mode 100644 --- /dev/null +++ b/clap_derive/tests/help.rs @@ -0,0 +1,99 @@ +use clap::{Args, IntoApp, Parser}; + +#[test] +fn arg_help_heading_applied() { + #[derive(Debug, Clone, Parser)] + struct CliOptions { + #[clap(long)] + #[clap(help_h...
Section headings don't match contents ### 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.55.0 (c8dfcfe04 2021-09-06) ### Clap Version master ### Minimal reprodu...
Thanks for digging into this more than needed. Always appreciate the extra info. This was broken by #2531. `App::help_heading` is required to be called before adding args but in #2531, we switched to calling app methods after args. My proposal is still the same, we revert #2531 and instead move setting of help/about...
2021-10-15T14:09:21Z
2021-10-16T16:24:16Z
0.14
a0ab35d678d797041aad20ff9e99ddaa52b84e24
[ "app_help_heading_applied", "app_help_heading_flattened" ]
[ "arg_help_heading_applied" ]
[]
[]
clap-rs/clap
2,867
clap-rs__clap-2867
[ "2807" ]
1f17d9e8ba5b64baca9e2d49c1b097b167bf4df6
diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -385,15 +385,13 @@ ARGS: INPUT The input file to use USAGE: - MyApp [FLAGS] [OPTIONS] <INPUT> [SUBCOMMAND] - -FLAGS: - -h, --help Print help information - -v Sets the level of verbosity - -V, --version Pr...
diff --git a/clap_derive/tests/non_literal_attributes.rs b/clap_derive/tests/non_literal_attributes.rs --- a/clap_derive/tests/non_literal_attributes.rs +++ b/clap_derive/tests/non_literal_attributes.rs @@ -19,7 +19,7 @@ pub const DISPLAY_ORDER: usize = 2; // Check if the global settings compile #[derive(Parser, De...
Default help grouping is confusing and unwanted ### Rust Version 1.55.0 ### Affected Version of clap v3.0.0-beta.4 ### Expected Behavior Summary Args would be in a shared group by default ### Actual Behavior Summary Args are split up by their type (flags, arguments, positional) ### Context `U...
I agree with this being v4. I have a few opinions on this and especially modernizing the help message formats but don't want to focus on it for v3. > I have a few opinions on this and especially modernizing the help message formats Please share these thoughts somewhere so we can all be ruminating on them. In think...
2021-10-12T21:30:34Z
2021-10-14T00:18:41Z
0.14
a0ab35d678d797041aad20ff9e99ddaa52b84e24
[ "help_message" ]
[ "test_multi_args_fail", "test_bool", "test_multi_args", "test_parse_hex_function_path", "test_slice", "build::arg::test::option_display2", "build::app::tests::propagate_version", "build::arg::test::flag_display_single_short_alias", "build::arg::settings::test::arg_settings_fromstr", "build::app::s...
[ "app_from_crate", "nested_help_subcommand_with_global_setting", "use_long_format_for_help_subcommand_with_setting", "require_eq", "single_arg_help_with_long_format_setting", "skip_possible_values", "subcommand_required_else_help_error_message", "dont_collapse_args", "issue_1093_allow_ext_sc", "arg...
[]
clap-rs/clap
2,804
clap-rs__clap-2804
[ "2784" ]
edd0124af07459d0dbde75c07a733dcadfff2a47
diff --git a/src/build/arg/debug_asserts.rs b/src/build/arg/debug_asserts.rs --- a/src/build/arg/debug_asserts.rs +++ b/src/build/arg/debug_asserts.rs @@ -35,15 +35,6 @@ pub(crate) fn assert_arg(arg: &Arg) { ); } - // Positionals should not have multiple_occurrences - if arg.is_positional() { - ...
diff --git a/tests/multiple_values.rs b/tests/multiple_values.rs --- a/tests/multiple_values.rs +++ b/tests/multiple_values.rs @@ -1319,3 +1319,64 @@ fn number_of_values_preferred_over_value_names() { ["val1", "val2", "val3", "val4"] ); } + +#[test] +fn values_per_occurrence_named() { + let mut a = Ap...
Cannot use multiple values with multiple occurrences with positional arguments ### 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.55.0 (c8dfcfe04 2021-09-06) ### Clap Version ...
I'd be curious to simply remove that check in the positional validation section and see if this just magically works, as it looks like something we're just actively preventing than a real bug. At least previously, once it gets to actually parsing values, clap doesn't really know or care if something came from a positio...
2021-10-04T17:12:51Z
2021-10-09T19:43:24Z
0.14
a0ab35d678d797041aad20ff9e99ddaa52b84e24
[ "values_per_occurrence_positional" ]
[ "build::arg::test::flag_display_multiple_aliases", "build::app::settings::test::app_settings_fromstr", "build::app::tests::propagate_version", "build::app::tests::app_send_sync", "build::app::tests::global_settings", "build::app::tests::issue_2090", "build::app::tests::global_setting", "build::arg::te...
[]
[]
clap-rs/clap
2,796
clap-rs__clap-2796
[ "2789" ]
236cf584cfeccdae995d19a25245d261e00c32e3
diff --git a/src/parse/parser.rs b/src/parse/parser.rs --- a/src/parse/parser.rs +++ b/src/parse/parser.rs @@ -463,7 +463,10 @@ impl<'help, 'app> Parser<'help, 'app> { let sc_name = self.possible_subcommand(&arg_os, valid_arg_found); debug!("Parser::get_matches_with: sc={:?}", ...
diff --git a/tests/help.rs b/tests/help.rs --- a/tests/help.rs +++ b/tests/help.rs @@ -2638,3 +2638,34 @@ USAGE: true )); } + +#[test] +fn override_help_subcommand() { + let app = App::new("bar") + .subcommand(App::new("help").arg(Arg::new("arg").takes_value(true))) + .subcommand(App::ne...
Cannot override the help subcommand ### 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 1.54.0 ### Clap Version master ### Minimal reproducible code ```rust use clap::Clap; #[...
> outputs a help message for the builtin Help subcommand: That is wrong. You are seeing an error. What's happening is that our parser is treating `help` as a command with subcommands during parsing instead of looking at what the user gave.
2021-09-28T01:18:57Z
2021-10-04T14:01:09Z
0.14
a0ab35d678d797041aad20ff9e99ddaa52b84e24
[ "help_required_and_given", "help_required_and_no_args", "help_required_and_given_for_subcommand", "help_required_but_not_given - should panic", "custom_heading_pos", "custom_headers_headers", "args_with_last_usage", "help_required_but_not_given_for_one_of_two_arguments - should panic", "after_and_be...
[ "build::arg::regex::tests::test_try_from_with_invalid_string", "build::arg::settings::test::arg_settings_fromstr", "build::arg::test::flag_display_multiple_short_aliases", "build::arg::test::flag_display_multiple_aliases", "build::arg::test::flag_display", "build::app::tests::global_settings", "build::a...
[]
[]
clap-rs/clap
2,771
clap-rs__clap-2771
[ "2770" ]
af7802a2ed1a76ae6341513b3a002244cb2c2fe8
diff --git a/src/output/usage.rs b/src/output/usage.rs --- a/src/output/usage.rs +++ b/src/output/usage.rs @@ -1,6 +1,8 @@ // std use std::collections::BTreeMap; +use indexmap::IndexSet; + // Internal use crate::{ build::AppSettings as AS, diff --git a/src/output/usage.rs b/src/output/usage.rs --- a/src/outp...
diff --git /dev/null b/tests/double_require.rs new file mode 100644 --- /dev/null +++ b/tests/double_require.rs @@ -0,0 +1,89 @@ +use clap::{App, Arg, ErrorKind}; + +static HELP: &str = "prog + +USAGE: + prog [FLAGS] + +FLAGS: + -a + -b + -c + -h, --help ...
Duplicate output in error message if called with missing argument ### 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.55.0 (c8dfcfe04 2021-09-06) ### Clap Version 3.0.0-beta.4...
2021-09-16T18:27:00Z
2021-09-17T18:28:44Z
0.14
a0ab35d678d797041aad20ff9e99ddaa52b84e24
[ "no_duplicate_error", "hidden_subcmds_only", "vector" ]
[ "build::app::settings::test::app_settings_fromstr", "build::app::tests::app_send_sync", "build::arg::test::flag_display", "build::arg::test::option_display_single_alias", "build::arg::settings::test::arg_settings_fromstr", "build::arg::test::option_display_multiple_occurrences", "build::arg::test::optio...
[]
[]
clap-rs/clap
2,758
clap-rs__clap-2758
[ "2731" ]
c4780e3305b4c2632c7d843511ae7dfe3652a569
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 @@ -361,7 +361,7 @@ pub fn gen_augment( fn gen_arg_enum_possible_values(ty: &Type) -> TokenStream { quote_spanned! { ty.span()=> - .possible_values(&<...
diff --git a/clap_generate/tests/value_hints.rs b/clap_generate/tests/value_hints.rs --- a/clap_generate/tests/value_hints.rs +++ b/clap_generate/tests/value_hints.rs @@ -11,7 +11,7 @@ pub fn build_app_with_value_hints() -> App<'static> { .arg( Arg::new("choice") .long("choice") -...
Support `about` for `possible_values` e.g. `ArgEnum` ### Clap Version master ### Describe your use case Sometimes the value itself my not give enough information to the user, therefore it would be helpful to be able to show and additional about in e.g. fish completions. Fish does that for example for `__fish_...
The challenge is the derive API is built on top of the builder API, so we need to come up with a way to specify this within the builder API. Possibly a variant of `possible_values` that takes a slice of tuples. > Possibly a variant of possible_values that takes a slice of tuples. Tho this is not very builder like...
2021-09-07T14:53:50Z
2021-09-19T11:30:08Z
0.14
a0ab35d678d797041aad20ff9e99ddaa52b84e24
[ "completions::elvish::elvish_with_special_commands", "completions::fish::fish_with_special_help", "completions::fish::fish_with_special_commands", "completions::bash::bash", "completions::fish::fish_with_sub_subcommands", "completions::fish::fish_with_aliases", "completions::fish::fish", "completions:...
[]
[]
[]
clap-rs/clap
2,749
clap-rs__clap-2749
[ "1463" ]
dae86f456ef26645947ac3f452a02a819adccc79
diff --git a/src/parse/errors.rs b/src/parse/errors.rs --- a/src/parse/errors.rs +++ b/src/parse/errors.rs @@ -13,6 +13,7 @@ use crate::{ output::fmt::Colorizer, parse::features::suggestions, util::{safe_exit, termcolor::ColorChoice, SUCCESS_CODE, USAGE_CODE}, + App, AppSettings, }; /// Short hand...
diff --git a/tests/help.rs b/tests/help.rs --- a/tests/help.rs +++ b/tests/help.rs @@ -2514,3 +2514,40 @@ FLAGS: false )); } + +#[test] +fn disabled_help_flag() { + let app = App::new("foo") + .subcommand(App::new("sub")) + .setting(AppSettings::DisableHelpFlag); + assert!(utils::comp...
Usage suggests help subcommand when using DisableHelpSubcommand <!-- Please use the following template to assist with creating an issue and to ensure a speedy resolution. If an area is not applicable, feel free to delete the area or mark with `N/A` --> ### Rust Version * rustc 1.36.0-nightly (3991285f5 2019-04-...
I have a similar Problem: when i use the `AppSettings::DisableHelpFlags` the error output shows this ``` error: Found argument '--help' which wasn't expected, or isn't valid in this context USAGE: application <SUBCOMMAND> For more information try --help ``` I'll take a look at this I have been looking an...
2021-09-01T04:23:46Z
2021-09-04T20:10:24Z
0.14
a0ab35d678d797041aad20ff9e99ddaa52b84e24
[ "disabled_help_flag", "disabled_help_flag_and_subcommand", "subcommand_not_recognized" ]
[ "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,730
clap-rs__clap-2730
[ "2727" ]
f085fa64f4bb463ecbcf0b163204987e33782ec5
diff --git a/clap_generate/src/generators/shells/fish.rs b/clap_generate/src/generators/shells/fish.rs --- a/clap_generate/src/generators/shells/fish.rs +++ b/clap_generate/src/generators/shells/fish.rs @@ -133,7 +133,15 @@ fn value_completion(option: &Arg) -> String { } if let Some(data) = option.get_possi...
diff --git a/clap_generate/tests/value_hints.rs b/clap_generate/tests/value_hints.rs --- a/clap_generate/tests/value_hints.rs +++ b/clap_generate/tests/value_hints.rs @@ -131,7 +131,7 @@ _my_app_commands() { _my_app "$@""#; -static FISH_VALUE_HINTS: &str = r#"complete -c my_app -l choice -r -f -a "bash fish zsh" +...
clap_generate fish: ArgEnum completions shows the description of the argument ### Rust Version rustc 1.54.0 (a178d0322 2021-07-26) ### Clap Version master ### Minimal reproducible code ```rs use clap::{ArgEnum, Clap, IntoApp}; use clap_generate::generators; fn main() { clap_generate::generate::...
This cannot be solved by just removing the description as that would remove it fom the option completion as well: `--smth (this is the description`. The solution is, to add the options first, and then only the description: ```fish complete -c clap-issue -n "__fish_seen_subcommand_from test" -l case -r -f -a "a b c...
2021-08-20T22:56:49Z
2021-08-25T15:48:28Z
0.14
a0ab35d678d797041aad20ff9e99ddaa52b84e24
[ "fish_with_value_hints" ]
[ "completions::bash::bash", "completions::bash::bash_with_special_commands", "completions::powershell::powershell", "completions::elvish::elvish_with_aliases", "completions::elvish::elvish", "completions::fish::fish_with_special_help", "completions::fish::fish", "completions::fish::fish_with_special_co...
[]
[]
clap-rs/clap
2,701
clap-rs__clap-2701
[ "1571" ]
9d5cf64d6a8c4d5911008ce4af6b41caeca6e8bf
diff --git a/src/build/arg/mod.rs b/src/build/arg/mod.rs --- a/src/build/arg/mod.rs +++ b/src/build/arg/mod.rs @@ -15,7 +15,7 @@ use std::{ error::Error, ffi::OsStr, fmt::{self, Display, Formatter}, - str, + iter, str, sync::{Arc, Mutex}, }; #[cfg(feature = "env")] diff --git a/src/build/arg...
diff --git a/tests/help.rs b/tests/help.rs --- a/tests/help.rs +++ b/tests/help.rs @@ -186,8 +186,8 @@ FLAGS: -V, --version Print version information OPTIONS: - -o, --option <option>... tests options - -O, --opt <opt> tests options"; + -o, --option <option> tests options + -O, -...
help text wrong for number_of_values=1 <!-- Please use the following template to assist with creating an issue and to ensure a speedy resolution. If an area is not applicable, feel free to delete the area or mark with `N/A` --> ### Rust Version Any ### Affected Version of clap clap 2.33 ### Behavior Su...
Pure `clap` equivalent: ```rust Arg::new("name") .long("package") .short("p"), .number_of_values(1) .takes_value(true) .multiple_values(true) ``` Hey. I'd be more than willing to take this one, but I wanted to try and get some clarification on what we would expect in this scenario? I'm not r...
2021-08-15T01:15:28Z
2021-08-17T16:27:28Z
0.14
a0ab35d678d797041aad20ff9e99ddaa52b84e24
[ "issue_1571", "issue_760" ]
[ "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,696
clap-rs__clap-2696
[ "1374" ]
441ff68c2d63536f0e2fd7e171d6fa7d76b2f4c3
diff --git a/src/build/arg/mod.rs b/src/build/arg/mod.rs --- a/src/build/arg/mod.rs +++ b/src/build/arg/mod.rs @@ -1096,10 +1096,11 @@ impl<'help> Arg<'help> { /// **NOTE:** When an argument is overridden it is essentially as if it never was used, any /// conflicts, requirements, etc. are evaluated **after** ...
diff --git a/tests/posix_compatible.rs b/tests/posix_compatible.rs --- a/tests/posix_compatible.rs +++ b/tests/posix_compatible.rs @@ -306,3 +306,25 @@ fn require_overridden_4() { let err = result.err().unwrap(); assert_eq!(err.kind, ErrorKind::MissingRequiredArgument); } + +#[test] +fn issue_1374_overrides_...
Self override and multiple values don't interact well together ### Affected Version of clap master and v3-master (did not try crates.io versions) ### Bug or Feature Request Summary Arguments overriding themselves with multiple values have... surprising behavior. Consider the sample code below: ### Sample C...
I ended up going ahead and creating #1376 Hey @Elarnon , kudos for writing this detailed step-by-step bug report! It's a real pleasure reading well-written explanations in simple fluent language that instantly lands in your brain without a need to parse "what that person meant". Bonus points for the attempt to fix it,...
2021-08-14T08:03:41Z
2021-08-14T09:41:41Z
0.14
a0ab35d678d797041aad20ff9e99ddaa52b84e24
[ "flag_overrides_itself", "conflict_overridden_2", "conflict_overridden_4", "mult_flag_overrides_itself", "conflict_overridden_3", "mult_option_overrides_itself", "option_overrides_itself", "posix_compatible_flags_long", "posix_compatible_flags_long_rev", "posix_compatible_flags_short", "posix_co...
[ "build::app::settings::test::app_settings_fromstr", "build::app::tests::app_send_sync", "build::app::tests::propagate_version", "build::app::tests::global_setting", "build::app::tests::global_settings", "build::app::tests::issue_2090", "build::arg::settings::test::arg_settings_fromstr", "build::arg::t...
[]
[]
clap-rs/clap
2,653
clap-rs__clap-2653
[ "2448" ]
4bec66dd03640a26df2d05dc89828f6f97da113a
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 @@ -264,9 +264,9 @@ pub fn gen_augment( Ty::OptionOption => quote_spanned! { ty.span()=> .takes_value(true) ...
diff --git a/clap_derive/tests/options.rs b/clap_derive/tests/options.rs --- a/clap_derive/tests/options.rs +++ b/clap_derive/tests/options.rs @@ -14,7 +14,10 @@ #![allow(clippy::option_option)] +mod utils; + use clap::Clap; +use utils::*; #[test] fn required_option() { diff --git a/clap_derive/tests/options....
Singleton optional values should use `[<name>]` in help message ### Rust Version rustc 1.53.0-nightly (9d9c2c92b 2021-04-19) ### Affected Version of clap 3.0.0-beta.2 ### Expected Behavior Summary Help message for `Option<Option<type>>` switches uses `[<name>]` rather than `<name>...` to indicate that th...
Can you please add more context on why `Option<Option<i32>>` is used instead of `Option<i32>`? `Option<i32>` makes the argument of the switch required which is something I don’t want. I want `--opt` to enable particular feature while allow `--opt=<value>` to customise an argument of that feature. For example, it could...
2021-08-01T22:16:29Z
2021-08-02T08:19:20Z
0.14
a0ab35d678d797041aad20ff9e99ddaa52b84e24
[ "option_option_help" ]
[ "option_from_str", "default_value", "option_with_default", "option_with_raw_default", "optional_option", "optional_argument_for_optional_option", "options", "required_option", "two_optional_vecs", "two_option_options", "optional_vec" ]
[]
[]
clap-rs/clap
2,648
clap-rs__clap-2648
[ "1737" ]
75445b974ed536add0d4f13ce8131348ff553cf4
diff --git a/src/build/app/mod.rs b/src/build/app/mod.rs --- a/src/build/app/mod.rs +++ b/src/build/app/mod.rs @@ -2485,8 +2485,7 @@ impl<'help> App<'help> { { debug!("App::_check_help_and_version: Building help subcommand"); self.subcommands.push( - App::new("help") - ...
diff --git a/tests/help.rs b/tests/help.rs --- a/tests/help.rs +++ b/tests/help.rs @@ -2528,3 +2528,57 @@ OPTIONS: false )); } + +#[test] +fn missing_positional_final_required() { + let app = App::new("test") + .setting(AppSettings::AllowMissingPositional) + .arg(Arg::new("arg1")) + ...
Order of arguments looks wrong when using AllowMissingPositional <!-- Please use the following template to assist with creating an issue and to ensure a speedy resolution. If an area is not applicable, feel free to delete the area or mark with `N/A` --> ### Rust Version ``` rustc 1.41.1 (f3e1a954d 2020-02-24) ...
2021-07-31T00:40:12Z
2021-07-31T06:39:23Z
0.14
a0ab35d678d797041aad20ff9e99ddaa52b84e24
[ "missing_positional_final_required" ]
[ "build::app::settings::test::app_settings_fromstr", "build::app::tests::app_send_sync", "build::app::tests::global_settings", "build::app::tests::global_setting", "build::app::tests::global_version", "build::arg::settings::test::arg_settings_fromstr", "build::arg::test::flag_display", "build::arg::tes...
[]
[]
clap-rs/clap
2,642
clap-rs__clap-2642
[ "2500" ]
8ca62aa18559d8c30056d6c1ebfda2840e0a322c
diff --git a/benches/05_ripgrep.rs b/benches/05_ripgrep.rs --- a/benches/05_ripgrep.rs +++ b/benches/05_ripgrep.rs @@ -513,7 +513,7 @@ lazy_static! { "Show verbose help output.", "When given, more details about flags are provided." ); - doc!(h, "version", "Prints version inform...
diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -415,15 +415,15 @@ USAGE: MyApp [FLAGS] [OPTIONS] <INPUT> [SUBCOMMAND] FLAGS: - -h, --help Prints help information + -h, --help Print help information -v Sets the level of verbosity - -V, --version P...
Change default help and version message to infinitive form ### 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 ### Describe your use case There are two problems here. 1. `clap` uses an unconve...
1. We can change the default help string in clap. 2. You can use `mut_arg("help", |a| a.about("help info"))` in clap_derive. Try pasting that on a struct in clap attribute. 1. Would you be open to accepting a PR to change the default string? 2. Perhaps I'm doing something wrong, but I wasn't able to get this working....
2021-07-30T03:31:03Z
2021-07-30T07:35:50Z
0.14
a0ab35d678d797041aad20ff9e99ddaa52b84e24
[ "completions::elvish::elvish_with_aliases", "completions::elvish::elvish", "completions::fish::fish_with_aliases", "completions::elvish::elvish_with_special_commands", "completions::powershell::powershell_with_aliases", "completions::fish::fish_with_special_help", "completions::fish::fish", "completio...
[ "generators::tests::test_find_subcommand_with_path", "generators::tests::test_flags", "generators::tests::test_longs", "generators::tests::test_all_subcommands", "generators::tests::test_shorts", "generators::tests::test_subcommands", "generate_completions", "completions::bash::bash_with_aliases", "...
[]
[]
tokio-rs/tokio
6,742
tokio-rs__tokio-6742
[ "3181" ]
338e13b04baa3cf8db3feb1ba2266c0070a9efdf
diff --git a/tokio/src/runtime/blocking/schedule.rs b/tokio/src/runtime/blocking/schedule.rs --- a/tokio/src/runtime/blocking/schedule.rs +++ b/tokio/src/runtime/blocking/schedule.rs @@ -57,4 +61,10 @@ impl task::Schedule for BlockingSchedule { fn schedule(&self, _task: task::Notified<Self>) { unreachable...
diff --git a/tokio/src/runtime/blocking/schedule.rs b/tokio/src/runtime/blocking/schedule.rs --- a/tokio/src/runtime/blocking/schedule.rs +++ b/tokio/src/runtime/blocking/schedule.rs @@ -1,6 +1,6 @@ #[cfg(feature = "test-util")] use crate::runtime::scheduler; -use crate::runtime::task::{self, Task}; +use crate::runti...
Add `on_spawn` configuration for Builder **Is your feature request related to a problem? Please describe.** For monitoring and tracking purposes I want to run some custom code when any spawned task is created/polled/dropped. **Describe the solution you'd like** I propose a configuration method `on_spawn` for `...
As a downside, such an `on_spawn` callback can't be generic (unless the whole tokio Runtime is generic), so one additional level of indirection is added to each poll. Also I'd like similar `on_spawn_blocking` which would apply to `spawn_blocking`. Both wrappers would run "in context" of parent task to have access to an...
2024-08-01T20:50:16Z
2024-08-27T13:28:00Z
1.39
338e13b04baa3cf8db3feb1ba2266c0070a9efdf
[ "fs::file::tests::flush_while_idle", "fs::file::tests::busy_file_seek_error", "fs::file::tests::incomplete_flush_followed_by_write", "fs::file::tests::incomplete_read_followed_by_flush", "fs::file::tests::incomplete_partial_read_followed_by_write", "fs::file::tests::open_set_len_err", "fs::file::tests::...
[]
[]
[]
tokio-rs/tokio
6,618
tokio-rs__tokio-6618
[ "6566" ]
8e15c234c60cf8132c490ccf03dd31738cfeaca8
diff --git a/tokio-util/src/sync/cancellation_token.rs b/tokio-util/src/sync/cancellation_token.rs --- a/tokio-util/src/sync/cancellation_token.rs +++ b/tokio-util/src/sync/cancellation_token.rs @@ -241,6 +241,52 @@ impl CancellationToken { pub fn drop_guard(self) -> DropGuard { DropGuard { inner: Some(se...
diff --git a/tokio-util/tests/sync_cancellation_token.rs b/tokio-util/tests/sync_cancellation_token.rs --- a/tokio-util/tests/sync_cancellation_token.rs +++ b/tokio-util/tests/sync_cancellation_token.rs @@ -1,6 +1,7 @@ #![warn(rust_2018_idioms)] use tokio::pin; +use tokio::sync::oneshot; use tokio_util::sync::{Can...
Add a `CancellationToken` method for running a future until completion or cancellation (This is a variant of the idea proposed in #4598; I was advised to create a new issue for this.) Give how (seemingly) often a [`tokio_util::sync::CancellationToken`](https://docs.rs/tokio-util/latest/tokio_util/sync/struct.Cancell...
Seems reasonable enough to me. It is nice that it does not involve a `FutureExt` trait, which I prefer to avoid.
2024-06-06T16:23:11Z
2024-06-13T19:43:42Z
1.38
8e15c234c60cf8132c490ccf03dd31738cfeaca8
[ "cancel_child_token_without_parent", "cancel_child_token_through_parent", "cancel_grandchild_token_through_parent_if_child_was_dropped", "cancel_only_all_descendants", "cancel_token_owned", "cancel_token", "cancel_token_owned_drop_test", "create_child_token_after_parent_was_cancelled", "derives_send...
[]
[]
[]
tokio-rs/tokio
6,409
tokio-rs__tokio-6409
[ "6367" ]
8342e4b524984d5e80168da89760799aa1a2bfba
diff --git a/tokio-stream/src/lib.rs b/tokio-stream/src/lib.rs --- a/tokio-stream/src/lib.rs +++ b/tokio-stream/src/lib.rs @@ -73,6 +73,9 @@ #[macro_use] mod macros; +mod poll_fn; +pub(crate) use poll_fn::poll_fn; + pub mod wrappers; mod stream_ext; diff --git /dev/null b/tokio-stream/src/poll_fn.rs new file mo...
diff --git a/tokio-stream/tests/stream_stream_map.rs b/tokio-stream/tests/stream_stream_map.rs --- a/tokio-stream/tests/stream_stream_map.rs +++ b/tokio-stream/tests/stream_stream_map.rs @@ -1,14 +1,17 @@ +use futures::stream::iter; use tokio_stream::{self as stream, pending, Stream, StreamExt, StreamMap}; use tokio_...
[FEATURE_REQ] Add `recv_many` to StreamMap **Is your feature request related to a problem? Please describe.** Most channels in tokio offer `recv_many` and `poll_recv_many`, merged with https://github.com/tokio-rs/tokio/pull/6236. StreamMap doesn't offer anything like this. **Describe the solution you'd like** An a...
2024-03-17T17:46:52Z
2025-01-18T13:10:27Z
1.36
8342e4b524984d5e80168da89760799aa1a2bfba
[ "contains_key_borrow", "clear", "iter_keys", "iter_values", "iter_values_mut", "new_capacity_zero", "empty", "insert_remove", "multiple_entries", "one_ready_many_none", "replace", "size_hint_with_upper", "size_hint_without_upper", "single_entry", "with_capacity" ]
[]
[]
[]