2014-10-01 08:06:56 +08:00
|
|
|
# vim: set filetype=fish:
|
|
|
|
|
2014-10-01 11:58:45 +08:00
|
|
|
status -b
|
2016-11-05 13:32:43 +08:00
|
|
|
and echo '"status -b" unexpectedly returned true at top level'
|
2014-10-01 11:58:45 +08:00
|
|
|
|
|
|
|
begin
|
|
|
|
status -b
|
2016-11-05 13:32:43 +08:00
|
|
|
or echo '"status -b" unexpectedly returned false inside a begin block'
|
2014-10-01 11:58:45 +08:00
|
|
|
end
|
|
|
|
|
2016-11-05 13:32:43 +08:00
|
|
|
status -l
|
|
|
|
and echo '"status -l" unexpectedly returned true for a non-login shell'
|
|
|
|
|
|
|
|
status -i
|
|
|
|
and echo '"status -i" unexpectedly returned true for a non-interactive shell'
|
|
|
|
|
|
|
|
status is-login
|
|
|
|
and echo '"status is-login" unexpectedly returned true for a non-login shell'
|
|
|
|
|
|
|
|
status is-interactive
|
|
|
|
and echo '"status is-interactive" unexpectedly returned true for a non-interactive shell'
|
|
|
|
|
|
|
|
# We should get an error message about an invalid combination of flags.
|
|
|
|
status --is-interactive --is-login
|
|
|
|
|
|
|
|
# We should get an error message about an unexpected arg for `status
|
|
|
|
# is-block`.
|
|
|
|
status -b is-interactive
|
|
|
|
|
|
|
|
# Try to set the job control to an invalid mode.
|
|
|
|
status job-control full1
|
|
|
|
status --job-control=1none
|
|
|
|
|
|
|
|
# Now set it to a valid mode.
|
|
|
|
status job-control none
|
2017-04-13 06:34:25 +08:00
|
|
|
|
|
|
|
# Check status -u outside functions
|
|
|
|
status current-function
|
|
|
|
|
|
|
|
function test_function
|
|
|
|
status current-function
|
|
|
|
end
|
|
|
|
|
|
|
|
test_function
|
2018-04-25 05:02:15 +08:00
|
|
|
eval test_function
|
|
|
|
|
|
|
|
logmsg Future Feature Flags
|
|
|
|
status features
|
|
|
|
status test-feature stderr-nocaret ; echo $status
|
|
|
|
status test-feature not-a-feature ; echo $status
|
2019-04-14 01:11:42 +08:00
|
|
|
|
|
|
|
logmsg 'Ensure $status isn\'t reset before a function is executed'
|
|
|
|
function echo_last
|
|
|
|
echo $status
|
|
|
|
end
|
|
|
|
|
|
|
|
false; echo_last; echo $status #1
|