diff --git a/integration/help.bats b/integration/help.bats index 0e7f3a6..cd9764b 100644 --- a/integration/help.bats +++ b/integration/help.bats @@ -80,7 +80,7 @@ The help section can span multiple lines." run main --help directory assert_success - assert_output "Usage: main directory [OPTIONS] [commands_with_args]... + assert_output "Usage: main directory [commands_with_args]... A directory subcommand diff --git a/src/commands/directory.rs b/src/commands/directory.rs index 49c9565..4134180 100644 --- a/src/commands/directory.rs +++ b/src/commands/directory.rs @@ -1,6 +1,8 @@ use std::fs; use std::path::PathBuf; +use clap::Arg; + use crate::commands::subcommand; use crate::commands::Command; use crate::config::Config; @@ -19,7 +21,8 @@ impl<'a> DirectoryCommand<'a> { pub fn new(name: &str, names: Vec, path: PathBuf, config: &'a Config) -> Result { let readme_path = path.join("README"); - let mut command = config.user_cli_command(name); + let mut command = config.base_command(name); + command = command.arg(Arg::new("commands_with_args").trailing_var_arg(true).allow_hyphen_values(true).num_args(..)); if readme_path.exists() { let docs = parser::extract_docs(&readme_path);