Skip to content

Instantly share code, notes, and snippets.

@colstrom
Last active December 9, 2016 06:43
Show Gist options
  • Select an option

  • Save colstrom/ee00c70aedf10bdf8b24764a003dce75 to your computer and use it in GitHub Desktop.

Select an option

Save colstrom/ee00c70aedf10bdf8b24764a003dce75 to your computer and use it in GitHub Desktop.
empty.fish: sugar for test with less surprising results
function empty
switch (count $argv)
case 0
true
case '*'
for string in $argv
test -z "$string"
and return (true)
end
end
end
name = empty
author = Chris Olstrom
license = MIT
provides = fish/functions/empty
requires
fish/builtin/and
fish/builtin/case
fish/builtin/count
fish/builtin/end
fish/builtin/for
fish/builtin/function
fish/builtin/return
fish/builtin/string
fish/builtin/switch
fish/builtin/test
fish/builtin/true
fish/functions/empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment