fisher/man/man7/fisher-commands.7
Jorge Bucaran 68beef51e9 One more push before 0.8.0, fixed bugs, paved the way for DEBUG mode.
* Add Mizuki to THANKS for help with Japanese translation of the QuickStart Guide.
* fisher --list should return 1 (fail) if no plugins are installed. Closes #101.
* More consistent style 'Usage' instead of 'usage'.
* Silence index check in case $fisher_cache/.index does not exist.
* Add more descriptive message if plugin is not found.
* Silence search failure in case $fisher_cache/.index does not exist.
2016-02-15 21:24:22 +09:00

110 lines
1.8 KiB
Groff

.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "FISHER\-COMMANDS" "7" "February 2016" "" "fisherman"
.
.SH "NAME"
\fBfisher\-commands\fR \- Creating Fisherman Commands
.
.SH "SYNOPSIS"
This document describes how to add new commands to Fisherman\. A Fisherman command is a function that you can invoke using the \fBfisher\fR CLI, for example:
.
.IP "" 4
.
.nf
fisher my_command [*options*]
.
.fi
.
.IP "" 0
.
.SH "DESCRIPTION"
To add a command, create a function \fBfisher_<my_command>\fR:
.
.IP "" 4
.
.nf
function fisher_hello \-d "Hello, how are you?"
echo hello
end
.
.fi
.
.IP "" 0
.
.P
Test it works: \fBfisher hello\fR\.
.
.P
To make this function available to future fish sessions, add it to \fB$XDG_CONFIG_HOME/fish/functions\fR:
.
.IP "" 4
.
.nf
funcsave fisher_hello
.
.fi
.
.IP "" 0
.
.P
You can also create a local plugin and install it with Fisherman:
.
.IP "" 4
.
.nf
mkdir fisher_hello
cd fisher_hello
functions fisher_hello > fisher_hello\.fish
fisher install \.
.
.fi
.
.IP "" 0
.
.P
The method described above will create a symbolic link to the \fBfisher_hello\fR directory and \fBfisher_hello\.fish\fR inside \fB$fisher_config/functions\fR\.
.
.SH "EXAMPLES"
The following example implements a command to retrieve plugin information and format the output into columns\.
.
.IP "" 4
.
.nf
function fisher_info \-d "Display information about plugins"
switch "$argv"
case \-h \-\-help
printf "Usage: fisher info name | URL [\.\.\.]\en\en"
printf " \-h \-\-help Show usage help\en"
return
end
for item in $argv
fisher search $item \-\-name \-\-info
end | sed \-E \'s/;/: /\' | column
end
.
.fi
.
.IP "" 0
.
.SH "SEE ALSO"
fisher(1)
.
.br
fisher help tour
.
.br
funcsave(1)
.
.br
fisher help plugins
.
.br