Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save colstrom/41535598618e5553cce9a2037b150023 to your computer and use it in GitHub Desktop.
list.fish: coerces arguments into lists
name = list
author = Chris Olstrom
license = MIT
provides = fish/functions/list
requires
fish/builtin/case
fish/builtin/count
fish/builtin/echo
fish/builtin/end
fish/builtin/for
fish/builtin/function
fish/builtin/read
fish/builtin/switch
fish/builtin/while
fish/functions/list
function list
switch (count $argv)
case 0
while read object
list $object
end
case '*'
for arg in $argv
echo $arg
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment