mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 09:39:52 +08:00
parent
0844247b43
commit
27a11ef7fe
|
@ -56,6 +56,14 @@ pub fn r#builtin(
|
|||
return STATUS_INVALID_ARGS;
|
||||
}
|
||||
|
||||
// If we don't have either, we print our help.
|
||||
// This is also what e.g. command and time,
|
||||
// the other decorator/builtins do.
|
||||
if !opts.query && !opts.list_names {
|
||||
builtin_print_help(parser, streams, cmd);
|
||||
return STATUS_INVALID_ARGS;
|
||||
}
|
||||
|
||||
if opts.query {
|
||||
let optind = w.woptind;
|
||||
for arg in argv.iter().take(argc).skip(optind) {
|
||||
|
|
|
@ -9,4 +9,9 @@ builtin -nq string
|
|||
#CHECKERR: builtin: invalid option combination, --query and --names are mutually exclusive
|
||||
echo $status
|
||||
#CHECK: 2
|
||||
|
||||
builtin -- -q &| grep -q "builtin - run a builtin command\|fish: builtin: missing man page"
|
||||
echo $status
|
||||
#CHECK: 0
|
||||
|
||||
exit 0
|
||||
|
|
Loading…
Reference in New Issue
Block a user