mirror of
https://github.com/nushell/nushell.git
synced 2024-11-07 17:14:23 +01:00
remote --help/-h from $scope.commands display (#3311)
* remote --help/-h from $scope.commands * change a test
This commit is contained in:
parent
005649b6fc
commit
ea0205f2ff
@ -52,7 +52,10 @@ impl Scope {
|
||||
for frame in self.frames.lock().iter().rev() {
|
||||
for (name, command) in frame.commands.iter() {
|
||||
if !output.contains_key(name) {
|
||||
output.insert(name.clone(), command.signature());
|
||||
let mut sig = command.signature();
|
||||
// don't show --help and -h in the command arguments for $scope.commands
|
||||
sig.remove_named("help");
|
||||
output.insert(name.clone(), sig);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ fn scope_variable_with_command_present() {
|
||||
|
||||
assert_that!(
|
||||
nu.pipeline("def meaning-of-life [--number: int] { echo $number }; echo $scope.commands | get meaning-of-life"),
|
||||
says().to_stdout("-h --help --number")
|
||||
says().to_stdout("--number")
|
||||
);
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user