Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
REVIEW: Fix `rad .`
◌ CI pending Lorenz Leutgeb committed 6 months ago
commit aa702aa54d25a1518ccff9b8e6d3dad1a9f05dfd
parent 32e23b5116fafbf3a9d2719cee61bc7746ffb8ec
1 pending (1 total) View logs
1 file changed +12 -1
modified crates/radicle-cli/src/main.rs
@@ -268,7 +268,18 @@ pub(crate) fn run_other(exe: &str, args: &[OsString]) -> Result<(), Option<anyho
            }
        }
        "inspect" => {
-
            if let Some(Commands::Inspect(args)) = CliArgs::parse().command {
+
            let reconstructed_args = {
+
                // This is a horrible workaround to reconstruct the original
+
                // args after having them mangled by our `lexopt`-style parser
+
                // in `parse_args()` in case they were `rad .`.
+
                // TODO: Remove this, when `rad` is fully migrated to `clap`.
+
                vec!["rad", "inspect"]
+
                    .into_iter()
+
                    .map(OsString::from)
+
                    .chain(args.iter().cloned())
+
            };
+

+
            if let Some(Commands::Inspect(args)) = CliArgs::parse_from(reconstructed_args).command {
                term::run_command_fn(inspect::run, args);
            }
        }