Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save colstrom/b8a1f2ceddd6295eb428ca1159c63fef to your computer and use it in GitHub Desktop.
show-source.fish: pretty-prints function definitions
name = show-source
author = Chris Olstrom
license = MIT
provides = fish/functions/show-source
requires
command/fish_indent
fish/builtin/case
fish/builtin/count
fish/builtin/end
fish/builtin/function
fish/builtin/functions
fish/builtin/read
fish/builtin/switch
fish/builtin/while
fish/functions/list
fish/functions/show-source
function show-source
switch (count $argv)
case 0
while read --local name
functions $name | fish_indent --ansi
end
case '*'
list $argv | show-source
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment