2016-01-01 21:12:40 +00:00
|
|
|
fisher-commands(7) -- Creating Fisherman Commands
|
|
|
|
=================================================
|
|
|
|
|
|
|
|
## SYNOPSIS
|
|
|
|
|
|
|
|
This document describes how to add new commands to Fisherman. A Fisherman command is a function that you can invoke like `fisher command` [*options*].
|
|
|
|
|
|
|
|
|
|
|
|
## DESCRIPTION
|
|
|
|
|
|
|
|
To add a command, create a function `fisher_<my_command>`:
|
|
|
|
|
|
|
|
```
|
|
|
|
function fisher_hello -d "Friendly command"
|
|
|
|
echo hello
|
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
Make sure it works: `fisher hello`.
|
|
|
|
|
2016-01-10 07:01:07 +00:00
|
|
|
To make this function available to the current and future fish sessions, add it to `$XDG_CONFIG_HOME/fish/functions`:
|
2016-01-01 21:12:40 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
funcsave fisher_hello
|
|
|
|
```
|
|
|
|
|
2016-01-10 07:01:07 +00:00
|
|
|
You may also choose to save this function to `$fisher_config/functions`.
|
2016-01-01 21:12:40 +00:00
|
|
|
|
|
|
|
## EXAMPLES
|
|
|
|
|
|
|
|
The following example implements a command to retrieve plugin information and format the output into columns.
|
|
|
|
|
|
|
|
```
|
|
|
|
function fisher_info -d "Display information about plugins"
|
|
|
|
switch "$argv"
|
|
|
|
case -h --help
|
2016-01-10 07:01:07 +00:00
|
|
|
printf "usage: fisher info name | URL [...]\n\n"
|
|
|
|
printf " -h --help Show usage help\n"
|
2016-01-01 21:12:40 +00:00
|
|
|
return
|
|
|
|
end
|
|
|
|
for item in $argv
|
|
|
|
fisher search $item --name --info
|
|
|
|
end | sed -E 's/;/: /' | column
|
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
## SEE ALSO
|
|
|
|
|
2016-01-10 07:01:07 +00:00
|
|
|
fisher(1)<br>
|
2016-01-10 19:55:59 +00:00
|
|
|
fisher help tour<br>
|
2016-01-10 07:01:07 +00:00
|
|
|
funcsave(1)<br>
|
|
|
|
fisher help plugins<br>
|