fish-shell/tests/checks/not.fish
Johannes Altmanninger 6d18f57e96 Make ! a builtin too, fixing "! -h"
UnLike other aliases (":.["), ! is special in the grammar but in the
few cases like "! -h" where we parse it as decorated statement they
are equals. Add it to the built in list, so the help argument works.

It can still be overridden, so this should not break anything.
2025-01-15 10:54:18 +01:00

22 lines
372 B
Fish

#RUN: %fish %s
not true
echo $status
# CHECK: 1
# Two "not" prefixes on a single job cancel each other out.
not not sh -c 'exit 34'
echo $status
# CHECK: 34
! -h
# CHECKERR: fish: !: missing man page
# CHECKERR: Documentation may not be installed.
# CHECKERR: `help !` will show an online version
function !
echo overridden! $argv
end
! -h
# CHECK: overridden! -h