Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rbw gen-completions ${shell} fails for debug build #198

Closed
antecrescent opened this issue Jul 28, 2024 · 1 comment
Closed

rbw gen-completions ${shell} fails for debug build #198

antecrescent opened this issue Jul 28, 2024 · 1 comment

Comments

@antecrescent
Copy link

antecrescent commented Jul 28, 2024

A Gentoo Linux user reported this here: https://bugs.gentoo.org/935517

To reproduce, build rbw with the debug profile (i.e. don't pass --release to cargo build) and run the following:

RUST_BACKTRACE=1 /var/tmp/portage/app-admin/rbw-1.12.0/work/rbw-1.12.0/target/debug/rbw gen-completions bash
thread 'main' panicked at /var/tmp/portage/app-admin/rbw-1.12.0/work/cargo_home/gentoo/clap_builder-4.5.11/src/builder/debug_asserts.rs:292:13:
Command generate: Argument group 'password-type' contains non-existent argument 'no-symbols'
stack backtrace:
   0: rust_begin_unwind
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:652:5
   1: core::panicking::panic_fmt
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:72:14
   2: clap_builder::builder::debug_asserts::assert_app
             at /var/tmp/portage/app-admin/rbw-1.12.0/work/cargo_home/gentoo/clap_builder-4.5.11/src/builder/debug_asserts.rs:292:13
   3: clap_builder::builder::command::Command::_build_self
             at /var/tmp/portage/app-admin/rbw-1.12.0/work/cargo_home/gentoo/clap_builder-4.5.11/src/builder/command.rs:4142:13
   4: clap_builder::builder::command::Command::_build_recursive
             at /var/tmp/portage/app-admin/rbw-1.12.0/work/cargo_home/gentoo/clap_builder-4.5.11/src/builder/command.rs:4045:9
   5: clap_builder::builder::command::Command::_build_recursive
             at /var/tmp/portage/app-admin/rbw-1.12.0/work/cargo_home/gentoo/clap_builder-4.5.11/src/builder/command.rs:4047:13
   6: clap_builder::builder::command::Command::build
             at /var/tmp/portage/app-admin/rbw-1.12.0/work/cargo_home/gentoo/clap_builder-4.5.11/src/builder/command.rs:4040:9
   7: clap_complete::generator::_generate
             at /var/tmp/portage/app-admin/rbw-1.12.0/work/cargo_home/gentoo/clap_complete-4.5.11/src/generator/mod.rs:259:5
   8: clap_complete::generator::generate
             at /var/tmp/portage/app-admin/rbw-1.12.0/work/cargo_home/gentoo/clap_complete-4.5.11/src/generator/mod.rs:255:5
   9: rbw::main
             at /var/tmp/portage/app-admin/rbw-1.12.0/work/rbw-1.12.0/src/bin/rbw/main.rs:466:13
  10: core::ops::function::FnOnce::call_once
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

This seems to fix it, but don't understand yet why it does or if that's the correct fix. The issue could be related to clap-rs/clap#2475.

--- a/src/bin/rbw/main.rs
+++ b/src/bin/rbw/main.rs
@@ -145,8 +145,8 @@ enum Opt {
             password to the database.",
         visible_alias = "gen",
         group = clap::ArgGroup::new("password-type").args(&[
-            "no-symbols",
-            "only-numbers",
+            "no_symbols",
+            "only_numbers",
             "nonconfusables",
             "diceware",
         ])
@doy doy closed this as completed in 80a5651 Jul 29, 2024
@doy
Copy link
Owner

doy commented Jul 29, 2024

fixed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants