For fish shell users who stumble on this thread.
Let foo
be a function that does not "return" (echo) a value, but it sets the exit code as usual.
To avoid checking $status
after calling the function, you can do:
foo; and echo success; or echo failure
And if it's too long to fit on one line:
foo; and begin
echo success
end; or begin
echo failure
end