Ahoy! Fisherman 1.3.0

* Fix bug in fisher_config_color_reset not declaring path variable.
* Silence Git checkout standard error to prevent update failures in some edge cases.
* Revise and correct errors in the documentation and README.
* Add more instrumentation to fisher_plugin_disable.
* Minor doc updates.
This commit is contained in:
Jorge Bucaran 2016-03-12 06:45:17 +09:00 committed by Jorge Bucaran
parent b259a1e2b1
commit eec6b67e16
13 changed files with 106 additions and 67 deletions

View file

@ -1,11 +1,17 @@
# Change Log # Change Log
## [1.3.0][v130] - 2016-03-11
* Fix bug in fisher_config_color_reset not declaring path variable.
* Silence Git checkout standard error to prevent update failures in some edge cases.
* Revise and correct errors in the documentation and README.
* Add more instrumentation to fisher_plugin_disable.
* Minor doc updates.
## [1.3.0][v130] - 2016-03-09 ## [1.3.0][v130] - 2016-03-09
* Merge tutorial and CLI documentation into one document. * Merge tutorial and CLI documentation into one document.
* Update README with new simplified documentation. * Update README with new simplified documentation.
* Tweak fisher help menu to highlight command aliases. * Tweak fisher help menu to highlight command aliases.
## [1.2.0][v120] - 2016-03-08 ## [1.2.0][v120] - 2016-03-08
@ -359,6 +365,7 @@
<!-- Links --> <!-- Links -->
[v131]: https://github.com/fisherman/fisherman/releases/tag/1.3.1
[v130]: https://github.com/fisherman/fisherman/releases/tag/1.3.0 [v130]: https://github.com/fisherman/fisherman/releases/tag/1.3.0
[v120]: https://github.com/fisherman/fisherman/releases/tag/1.2.0 [v120]: https://github.com/fisherman/fisherman/releases/tag/1.2.0
[v110]: https://github.com/fisherman/fisherman/releases/tag/1.1.0 [v110]: https://github.com/fisherman/fisherman/releases/tag/1.1.0

View file

@ -256,7 +256,14 @@ git push origin master
## Plugins ## Plugins
Plugins can be utilities, prompts, commands or snippets. Plugins can be utilities, prompts, commands or snippets. To create a plugin from a template, install the new command.
```
fisher install new
fisher new plugin < meta.yml
```
See the documentation of new for details.
### Utilities ### Utilities

View file

@ -1,10 +1,10 @@
function __fisher_config_color_reset function __fisher_config_color_reset -a path
if test ! -f "$path" if test ! -f "$path"
set -U fish_color_normal normal set -U fish_color_normal normal
set -U fish_color_command 005fd7 purple set -U fish_color_command 005fd7 purple
set -U fish_color_param 00afff cyan set -U fish_color_param 00afff cyan
set -U fish_color_redirection normal set -U fish_color_redirection 005fd7
set -U fish_color_comment red set -U fish_color_comment 600
set -U fish_color_error red --bold set -U fish_color_error red --bold
set -U fish_color_escape cyan set -U fish_color_escape cyan
set -U fish_color_operator cyan set -U fish_color_operator cyan
@ -32,30 +32,32 @@ function __fisher_config_color_reset
read -laz fish_colors < $path read -laz fish_colors < $path
set -U fish_color_normal (echo $fish_colors[1] | tr " " \n) set fish_colors[25] ""
set -U fish_color_command (echo $fish_colors[2] | tr " " \n)
set -U fish_color_param (echo $fish_colors[3] | tr " " \n) set -U fish_color_normal (echo "$fish_colors[1]" | tr " " \n)
set -U fish_color_redirection (echo $fish_colors[4] | tr " " \n) set -U fish_color_command (echo "$fish_colors[2]" | tr " " \n)
set -U fish_color_comment (echo $fish_colors[5] | tr " " \n) set -U fish_color_param (echo "$fish_colors[3]" | tr " " \n)
set -U fish_color_error (echo $fish_colors[6] | tr " " \n) set -U fish_color_redirection (echo "$fish_colors[4]" | tr " " \n)
set -U fish_color_escape (echo $fish_colors[7] | tr " " \n) set -U fish_color_comment (echo "$fish_colors[5]" | tr " " \n)
set -U fish_color_operator (echo $fish_colors[8] | tr " " \n) set -U fish_color_error (echo "$fish_colors[6]" | tr " " \n)
set -U fish_color_end (echo $fish_colors[9] | tr " " \n) set -U fish_color_escape (echo "$fish_colors[7]" | tr " " \n)
set -U fish_color_quote (echo $fish_colors[10] | tr " " \n) set -U fish_color_operator (echo "$fish_colors[8]" | tr " " \n)
set -U fish_color_autosuggestion (echo $fish_colors[11] | tr " " \n) set -U fish_color_end (echo "$fish_colors[9]" | tr " " \n)
set -U fish_color_user (echo $fish_colors[12] | tr " " \n) set -U fish_color_quote (echo "$fish_colors[10]" | tr " " \n)
set -U fish_color_valid_path (echo $fish_colors[13] | tr " " \n) set -U fish_color_autosuggestion (echo "$fish_colors[11]" | tr " " \n)
set -U fish_color_cwd (echo $fish_colors[14] | tr " " \n) set -U fish_color_user (echo "$fish_colors[12]" | tr " " \n)
set -U fish_color_cwd_root (echo $fish_colors[15] | tr " " \n) set -U fish_color_valid_path (echo "$fish_colors[13]" | tr " " \n)
set -U fish_color_match (echo $fish_colors[16] | tr " " \n) set -U fish_color_cwd (echo "$fish_colors[14]" | tr " " \n)
set -U fish_color_search_match (echo $fish_colors[17] | tr " " \n) set -U fish_color_cwd_root (echo "$fish_colors[15]" | tr " " \n)
set -U fish_color_selection (echo $fish_colors[18] | tr " " \n) set -U fish_color_match (echo "$fish_colors[16]" | tr " " \n)
set -U fish_pager_color_prefix (echo $fish_colors[19] | tr " " \n) set -U fish_color_search_match (echo "$fish_colors[17]" | tr " " \n)
set -U fish_pager_color_completion (echo $fish_colors[20] | tr " " \n) set -U fish_color_selection (echo "$fish_colors[18]" | tr " " \n)
set -U fish_pager_color_description (echo $fish_colors[21] | tr " " \n) set -U fish_pager_color_prefix (echo "$fish_colors[19]" | tr " " \n)
set -U fish_pager_color_progress (echo $fish_colors[22] | tr " " \n) set -U fish_pager_color_completion (echo "$fish_colors[20]" | tr " " \n)
set -U fish_color_history_current (echo $fish_colors[23] | tr " " \n) set -U fish_pager_color_description (echo "$fish_colors[21]" | tr " " \n)
set -U fish_color_host (echo $fish_colors[24] | tr " " \n) set -U fish_pager_color_progress (echo "$fish_colors[22]" | tr " " \n)
set -U fish_color_history_current (echo "$fish_colors[23]" | tr " " \n)
set -U fish_color_host (echo "$fish_colors[24]" | tr " " \n)
rm -f $path rm -f $path
end end

View file

@ -7,21 +7,21 @@ function __fisher_path_update -a path
return 1 return 1
end end
git stash --quiet ^ /dev/null git stash --quiet ^ /dev/null
git checkout master --quiet ^ /dev/null git checkout master --quiet ^ /dev/null
if not git pull --rebase origin master --quiet if not git pull --quiet --rebase origin master
git rebase --abort --quiet git rebase --quiet --abort
git fetch origin master --quiet git fetch --quiet origin master
git reset --hard FETCH_HEAD --quiet git reset --quiet --hard FETCH_HEAD
git clean -d --force --quiet git clean --quiet -d --force
end ^ /dev/null end ^ /dev/null
if test ! -z "$branch" if test ! -z "$branch"
git checkout "$branch" --quiet git checkout "$branch" --quiet ^ /dev/null
end end
git stash apply --quiet ^ /dev/null git stash apply --quiet ^ /dev/null
popd popd
end end

View file

@ -24,12 +24,19 @@ function __fisher_plugin_disable -a plugin path option
end end
if test -s $fisher_file if test -s $fisher_file
debug "File remove %s" "$plugin" set -l key
__fisher_file_remove ( if not set key (fisher_search --name=$plugin --name --index=$fisher_cache/.index)
if not fisher_search --name=$plugin --name --index=$fisher_cache/.index debug "Path $path"
__fisher_url_from_path $path set key (__fisher_url_from_path $path)
end end
) $fisher_file > /dev/null
debug "fishfile remove %s start" "$key"
if set key (__fisher_file_remove "$key" "$fisher_file")
debug "fishfile remove %s ok" "$key"
else
debug "fishfile remove %s fail" "$key"
end
end end
end end

View file

@ -56,7 +56,7 @@ function fisher -d "Fish plugin manager"
case help case help
printf "Usage: fisher <command> [<options>] [--help] [--version]\n\n" printf "Usage: fisher <command> [<options>] [--help] [--version]\n\n"
set -l color (set_color $fish_color_command -u) set -l color (set_color -u)
set -l color_normal (set_color normal) set -l color_normal (set_color normal)
printf "Commands:\n" printf "Commands:\n"

View file

@ -1,4 +1,4 @@
function fisher_help -d "Show help" function fisher_help -d "Show command help"
if not set -q argv[1] if not set -q argv[1]
man fisher man fisher
return return

View file

@ -4,7 +4,7 @@
.TH "FISHER\-HELP" "1" "March 2016" "" "fisherman" .TH "FISHER\-HELP" "1" "March 2016" "" "fisherman"
. .
.SH "NAME" .SH "NAME"
\fBfisher\-help\fR \- Show help about Fisherman \fBfisher\-help\fR \- Show command help
. .
.SH "SYNOPSIS" .SH "SYNOPSIS"
fisher help [\fIcommand\fR] [\-\-help] fisher help [\fIcommand\fR] [\-\-help]
@ -17,10 +17,10 @@ fisher help \fIcommand\fR
.br .br
. .
.SH "DESCRIPTION" .SH "DESCRIPTION"
Help displays \fIcommand\fR documentation, usage, guides and tutorials\. Help displays \fIcommand\fR documentation\.
. .
.P .P
Help is based in man(1) pages\. To supply help with your own plugin or command, create one or more man\.1~7 pages and add them to your project under the corresponding man/man% directory\. Help is based in man(1) pages\. To supply help with your own plugin or command, create one or more man pages and add them to your project under the corresponding man/man% directory\.
. .
.IP "" 4 .IP "" 4
. .
@ -37,7 +37,7 @@ my_plugin
.IP "" 0 .IP "" 0
. .
.P .P
Help for my_plugin is available via man(1)\. To add documentation to a fisher command, prepend the keyword fisher\- to the man file, e\.g\., fisher\-my\-command\.1\. This will teach Fisherman how to access the man page using fisher help my\-command\. To add documentation to a fisher command, prepend the keyword fisher\- to the man file, e\.g\., fisher\-my\-command\.1\. This will teach Fisherman how to access the man page using \fBfisher help my\-command\fR\.
. .
.P .P
There are utilities that can help you generate man pages from other text formats, such as Markdown\. For example pandoc(1) or ronn(1)\. There are utilities that can help you generate man pages from other text formats, such as Markdown\. For example pandoc(1) or ronn(1)\.

View file

@ -1,5 +1,5 @@
fisher-help(1) -- Show help about Fisherman fisher-help(1) -- Show command help
=========================================== ===================================
## SYNOPSIS ## SYNOPSIS
@ -11,9 +11,9 @@ fisher help *command*<br>
## DESCRIPTION ## DESCRIPTION
Help displays *command* documentation, usage, guides and tutorials. Help displays *command* documentation.
Help is based in man(1) pages. To supply help with your own plugin or command, create one or more man.1~7 pages and add them to your project under the corresponding man/man% directory. Help is based in man(1) pages. To supply help with your own plugin or command, create one or more man pages and add them to your project under the corresponding man/man% directory.
``` ```
my_plugin my_plugin
@ -23,7 +23,7 @@ my_plugin
`-- my_plugin.1 `-- my_plugin.1
``` ```
Help for my_plugin is available via man(1). To add documentation to a fisher command, prepend the keyword fisher- to the man file, e.g., fisher-my-command.1. This will teach Fisherman how to access the man page using fisher help my-command. To add documentation to a fisher command, prepend the keyword fisher- to the man file, e.g., fisher-my-command.1. This will teach Fisherman how to access the man page using `fisher help my-command`.
There are utilities that can help you generate man pages from other text formats, such as Markdown. For example pandoc(1) or ronn(1). There are utilities that can help you generate man pages from other text formats, such as Markdown. For example pandoc(1) or ronn(1).

View file

@ -448,7 +448,21 @@ $fisher_alias \fIcommand\fR=\fIalias\fR \.\.\.
Use this variable to create aliases of Fisherman commands\. Use this variable to create aliases of Fisherman commands\.
. .
.SH "PLUGINS" .SH "PLUGINS"
Plugins can be utilities, prompts, commands or snippets\. Plugins can be utilities, prompts, commands or snippets\. To create a plugin from a template, install the new command\.
.
.IP "" 4
.
.nf
fisher install new
fisher new plugin < meta\.yml
.
.fi
.
.IP "" 0
.
.P
See the documentation of new for details\.
. .
.SS "UTILITIES" .SS "UTILITIES"
Utilities are plugins that define one or more functions\. Utilities are plugins that define one or more functions\.

View file

@ -270,7 +270,14 @@ This file is automatically updated as you install and uninstall plugins.
## PLUGINS ## PLUGINS
Plugins can be utilities, prompts, commands or snippets. Plugins can be utilities, prompts, commands or snippets. To create a plugin from a template, install the new command.
```
fisher install new
fisher new plugin < meta.yml
```
See the documentation of new for details.
### UTILITIES ### UTILITIES

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "GETOPTS" "1" "February 2016" "" "fisherman" .TH "GETOPTS" "1" "March 2016" "" "fisherman"
. .
.SH "NAME" .SH "NAME"
\fBgetopts\fR \- Command line options parser \fBgetopts\fR \- Command line options parser
@ -15,7 +15,7 @@ getopts \fIoptions\fR \.\.\.
\fBGetopts\fR is a command line options parser for fish\. \fBGetopts\fR is a command line options parser for fish\.
. .
.SH "USAGE" .SH "USAGE"
Study the output of the following example Study the output of getopts in the following example
. .
.IP "" 4 .IP "" 4
. .
@ -41,10 +41,7 @@ _ baz
.IP "" 0 .IP "" 0
. .
.P .P
The items on the left are the option flags\. The items on the right are the option values\. The underscore \fB_\fR character is the default \fIkey\fR for bare arguments\. The items on the left are the command option \fIkeys\fR\. The items on the right are the option \fIvalues\fR\. The underscore \fB_\fR character is the default key for bare arguments\.
.
.P
Use read(1) to process the generated stream and switch(1) to match patterns
. .
.IP "" 4 .IP "" 4
. .

View file

@ -11,7 +11,7 @@ getopts *options* ...<br>
## USAGE ## USAGE
Study the output of the following example Study the output of getopts in the following example
``` ```
getopts -ab1 --foo=bar baz getopts -ab1 --foo=bar baz
@ -24,9 +24,7 @@ foo bar
_ baz _ baz
``` ```
The items on the left are the option flags. The items on the right are the option values. The underscore `_` character is the default *key* for bare arguments. The items on the left are the command option *keys*. The items on the right are the option *values*. The underscore `_` character is the default key for bare arguments.
Use read(1) to process the generated stream and switch(1) to match patterns
``` ```
getopts -ab1 --foo=bar baz | while read -l key option getopts -ab1 --foo=bar baz | while read -l key option