diff --git a/src/parsers/nushell.rs b/src/parsers/nushell.rs index c00694f..90a349f 100644 --- a/src/parsers/nushell.rs +++ b/src/parsers/nushell.rs @@ -284,7 +284,10 @@ pub fn format_positional(name: &str, p: &Positional) -> String { .collect(); let prefix = if p.variadic { "..." } else { "" }; let suffix = if p.optional && !p.variadic { "?" } else { "" }; - let typ = nushell_type_of_param(&name.to_ascii_uppercase()); + let typ = match nushell_type_of_param(&name.to_ascii_uppercase()) { + "string" => "glob", + other => other, + }; format!(" {prefix}{name_underscored}{suffix}: {typ}") } diff --git a/tests/ports.rs b/tests/ports.rs index f38b793..e1c601f 100644 --- a/tests/ports.rs +++ b/tests/ports.rs @@ -339,8 +339,8 @@ Print a short usage summary and exit. ); let nu = generate_extern("getent", &r); - assert!(nu.contains("database: string"), "nu = {nu}"); - assert!(nu.contains("...key: string"), "nu = {nu}"); + assert!(nu.contains("database: glob"), "nu = {nu}"); + assert!(nu.contains("...key: glob"), "nu = {nu}"); assert!(nu.contains("--service(-s): string"), "nu = {nu}"); assert!(!nu.contains("--servicedatabase"), "nu = {nu}"); assert!(nu.contains("export extern \"getent passwd\""), "nu = {nu}"); @@ -781,7 +781,7 @@ fn positional_order_survives_cache_and_generation() { let nu = generate_extern("git clone", &cached); let repository = nu - .find("repository: string") + .find("repository: glob") .expect("repository positional"); let directory = nu.find("directory?: path").expect("directory positional"); assert!(repository < directory, "nu = {nu}");