diff --git a/.travis.yml b/.travis.yml index 7ca4a98..b03c276 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,4 +4,4 @@ before_install: - sudo apt-get update - sudo apt-get -y install fish script: - - make && fish -c "fisher_install fishery/fishtape; fishtape test/*.fish" + - make && fish -c "fisher i fishery/fishtape; fishtape test/*.fish" diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a06d58..ea58c7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Change Log +## [1.0.0][v100] - 2016-03-01 + +* Deprecate fisher --list in favor of a new command fisher list. The behavior is roughly the same. See fisher help list for usage. tl;dr: Use list to query the local system / cache and search to query the index. + + ![](https://cloud.githubusercontent.com/assets/8317250/13388099/8973fbe0-df00-11e5-95c8-4bbb0e7172ae.gif) + +* Teach fisher_plugin_walk about fish_postexec, fish_command_not_found and fish_preexec event emitters and erase them during uninstall if they were defined in a snippet. + +* Fisherman now recognizes the following aliases by default: *i* for install, *u* for update, *l* for list, *s* for search and *h* for help. + +* Large documentation rewrite. Better, simpler, more concise and more consistent. + +* Fisherman now detects if users have modified their fish prompt using fish_config and if so, uninstalls $fisher_prompt. + ## [0.9.0][v090] - 2016-02-25 * Welcome aboard @jethrokuan, the newest Fisherman organization member. @@ -144,6 +158,8 @@ + Now fisher_list can list plugins from the _cache_, a _fishfile/bundle_ and plugins that are _installed/enabled_ or _disabled_. This removes fisher_file and combines it with fisher_list. This also removes fisher -f and replaces it with fisher -l or fisher --list=. + > fisher --list was replaced by fisher list + + Rename fisher_parse_help to fisher_complete and have the function create the completions automatically. This allows you to complete your commands with parseable usage help faster. The original design was fine, but this change improves auto-complete performance so it was preferred. + Use fisher_index_update when building file with Make. This helps prevent an error when using a fish version < 2.2.0. #55 #50 #48. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 1436f58..ced6990 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,14 +1,8 @@ -# Contributor Code of Conduct +# Code of Conduct -As contributors and maintainers of this project, and in the interest of -fostering an open and welcoming community, we pledge to respect all people who -contribute through reporting issues, posting feature requests, updating -documentation, submitting pull requests or patches, and other activities. +As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. -We are committed to making participation in this project a harassment-free -experience for everyone, regardless of level of experience, gender, gender -identity and expression, sexual orientation, disability, personal appearance, -body size, race, ethnicity, age, religion, or nationality. +We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality. Examples of unacceptable behavior by participants include: @@ -20,35 +14,14 @@ Examples of unacceptable behavior by participants include: addresses, without explicit permission * Other unethical or unprofessional conduct -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. -By adopting this Code of Conduct, project maintainers commit themselves to -fairly and consistently applying these principles to every aspect of managing -this project. Project maintainers who do not follow or enforce the Code of -Conduct may be permanently removed from the project team. +By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team. -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting a project maintainer at [hi@fisherman.sh](mailto:hi@fisherman.sh). All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. Maintainers are -obligated to maintain confidentiality with regard to the reporter of an -incident. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting a project maintainer at [hi@fisherman.sh](mailto:hi@fisherman.sh). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Maintainers are obligated to maintain confidentiality with regard to the reporter of an incident. +This Code of Conduct is adapted from the [Contributor Covenant], version 1.3.0, available at -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 1.3.0, available at -[http://contributor-covenant.org/version/1/3/0/][version] - -:anchor: - - - -[version]: http://contributor-covenant.org/version/1/3/0/ -[homepage]: http://contributor-covenant.org +[Contributor Covenant]: http://contributor-covenant.org diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5b9402b..270b7b5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,72 +1,41 @@ [![Slack Room][slack-badge]][slack-link] -# Contributing to Fisherman +# Contributing -If you are looking for ways to help, peruse the [open issues][issues] or send us your PR if you are already working on something. +If you are looking for ways to help, browse [open issues][issues] or send us your PR if you are already working on something. ## Guidelines * Fork the repo and create your feature branch from master. -* If you make significant changes, please add tests too. Get familiar with [Fishtape][fishtape]. +* If you make significant changes, please add tests too. Get familiar with [Fishtape]. * If you've changed APIs, please update the documentation. -* Follow the [seven rules][rules] of a great git commit message. +* Follow the [seven rules] of a great Git commit message. ## Plugins -The fastest way to create a plugin is using the `scaffold` plugin. +1. Create a new plugin with `scaffold`. +```fish +fisher install scaffold +fisher scaffold +``` -1. Install - - ```fish - fisher install scaffold - ``` - -2. Create a new plugin using the default template. - > See the `fisher help scaffold` for other usage instructions. - - ```fish - fisher scaffold - ``` - -To browse the available content use `fisher search` or browse the [Fishery][fishery]. - -To submit a new plugin to the [index][index], use the `submit` plugin. - -1. Install - - ```fish - fisher install submit - ``` - -2. Submit - - ```fish - fisher submit my_plugin - ``` +2. Submit a plugin to the [index] with `submit`. +```fish +fisher install submit +fisher submit my_plugin +``` ## Translations -If you would like to translate a portion of the documentation, you can begin with the [Quickstart Guide][quick-start]. Use any of the existing translations as a reference to get started. - - +If you would like to translate a portion of the documentation, you can begin with the [Quickstart Guide]. [slack-link]: https://fisherman-wharf.herokuapp.com/ [slack-badge]: https://img.shields.io/badge/slack-join%20the%20chat-00B9FF.svg?style=flat-square - - - -[rules]: http://chris.beams.io/posts/git-commit/#seven-rules -[issues]: https://github.com/fisherman/fisherman/issues?q=is%3Aopen+is%3Aissue -[fishtape]: https://github.com/fisherman/fishtape - - - +[seven rules]: http://chris.beams.io/posts/git-commit/#seven-rules +[open issues]: https://github.com/fisherman/fisherman/issues?q=is%3Aopen+is%3Aissue +[Fishtape]: https://github.com/fisherman/fishtape [index]: https://github.com/fisherman/fisher-index -[fishery]: https://github.com/fishery - - - -[quick-start]: https://github.com/fisherman/fisherman/wiki/Quickstart-Guide +[Quickstart Guide]: https://github.com/fisherman/fisherman/wiki/Quickstart-Guide diff --git a/Makefile b/Makefile index 6489fd4..e6b4278 100644 --- a/Makefile +++ b/Makefile @@ -10,9 +10,8 @@ FISHER_FILE := $(FISHER_CONFIG)/fishfile MAN := $(FISHER_HOME)/man MAN1 := $(wildcard $(MAN)/man1/*.md) -MAN5 := $(wildcard $(MAN)/man5/*.md) MAN7 := $(wildcard $(MAN)/man7/*.md) -DOCS := $(MAN1:%.md=%.1) $(MAN5:%.md=%.5) $(MAN7:%.md=%.7) +DOCS := $(MAN1:%.md=%.1) $(MAN7:%.md=%.7) INDEX := $(FISHER_CACHE)/.index VERSION = `cat $(FISHER_HOME)/VERSION` @@ -58,7 +57,7 @@ $(FISHER_CACHE): $(FISHER_FILE): touch $@ -%.1 %.5 %.7: %.md +%.1 %.7: %.md -@if type ronn 2>/dev/null 1>&2; then \ ronn --manual=fisherman --roff $? 1>&2 2> /dev/null;\ fi;\ diff --git a/THANKS.md b/THANKS.md index 53e0476..28a57d8 100644 --- a/THANKS.md +++ b/THANKS.md @@ -1,6 +1,6 @@ # Thank You -The following individuals have contributed to Fisherman. :heart: +The following individuals have contributed to Fisherman. * [Daniel Perez](https://github.com/tuvistavie) * [Daniele Sluijters](https://github.com/daenney) @@ -9,6 +9,7 @@ The following individuals have contributed to Fisherman. :heart: * [Ian](https://github.com/ViViDboarder) * [Ivan Tham](https://github.com/pickfire) * [Jethro Kuan](https://github.com/jethrokuan) +* [Jon Scott](https://github.com/jonscottclark) * [Jorge Bucaran](https://github.com/bucaran) * [Kevin Ballard](https://github.com/kballard) * [Mizuki](https://github.com/zukif) diff --git a/completions/fisher.fish b/completions/fisher.fish index 9dcb4d2..3c011a5 100644 --- a/completions/fisher.fish +++ b/completions/fisher.fish @@ -2,19 +2,11 @@ set -l IFS ";" complete -xc fisher -complete -c fisher -n "__fish_use_subcommand" -s l -l list -d "[=] List plugins" -complete -c fisher -n "__fish_use_subcommand" -s h -l help -d "Display help" +complete -c fisher -n "__fish_use_subcommand" -s h -l help -d "Show usage help" complete -c fisher -n "__fish_use_subcommand" -s v -l version -d "Show version information" complete -c fisher -a "fisherman" -d "Update Fisherman" -n "__fish_seen_subcommand_from update" -complete -c fisher -a "\t" -n "__fish_seen_subcommand_from search" -complete -c fisher -l "name" -d "Filter by name" -n "__fish_seen_subcommand_from search" -complete -c fisher -l "url" -d "Filter by url" -n "__fish_seen_subcommand_from search" -complete -c fisher -l "info" -d "Filter by info" -n "__fish_seen_subcommand_from search" -complete -c fisher -l "author" -d "Filter by author" -n "__fish_seen_subcommand_from search" -complete -c fisher -l "tags" -d "Filter by tag/s" -n "__fish_seen_subcommand_from search" - __fisher_help_guides | while read -l guide info complete -c fisher -n "__fish_seen_subcommand_from help" -a $guide -d "$info" end diff --git a/functions/__fisher_cache_list.fish b/functions/__fisher_cache_list.fish index 0656275..7f3879f 100644 --- a/functions/__fisher_cache_list.fish +++ b/functions/__fisher_cache_list.fish @@ -1,3 +1,3 @@ function __fisher_cache_list - find -L $fisher_cache/* -maxdepth 0 -type d ^ /dev/null | sed 's|.*/||' + find -L $fisher_cache/* -maxdepth 0 -type d ^ /dev/null | sed 's|.*/||' end diff --git a/functions/__fisher_file.fish b/functions/__fisher_file.fish index cef7adf..1872d92 100644 --- a/functions/__fisher_file.fish +++ b/functions/__fisher_file.fish @@ -1,13 +1,5 @@ function __fisher_file - awk ' - /^[ \t]*(package|theme) .+/ { - if ($1 == "package") { - $1 = "https://github.com/oh-my-fish/plugin-"$2 - } else { - $1 = "https://github.com/oh-my-fish/theme-"$2 - } - } - + awk -v FS=\t ' /@http/ { gsub("@.*$", "", $1) } diff --git a/functions/__fisher_list.fish b/functions/__fisher_list.fish deleted file mode 100644 index 09470c3..0000000 --- a/functions/__fisher_list.fish +++ /dev/null @@ -1,64 +0,0 @@ -function __fisher_list -a source - switch "$source" - case bare - __fisher_cache_list - - case url - for i in (__fisher_cache_list) - __fisher_url_from_path $fisher_cache/$i - end - - case "" all cache - set -l enabled (__fisher_list $fisher_file) - set -l cache (__fisher_cache_list) - - if test -z "$cache" - return 1 - end - - set -l legend " " - - if test -z "$enabled" - set legend "" - end - - for i in $cache - if contains -- $i $enabled - if test $i = "$fisher_prompt" - printf "%s%s\n" ">" $i - - else if test -L $fisher_cache/$i - printf "%s%s\n" "@" $i - - else - printf "%s%s\n" "*" $i - end - else - printf "%s%s\n" "$legend" $i - end - end - - case enabled installed - __fisher_list $fisher_file - - case disabled - set -l enabled (__fisher_list $fisher_file) - - for name in (__fisher_cache_list) - if not contains -- $name $enabled - printf "%s\n" $name - end - end - - case theme prompt - printf "%s\n" $fisher_prompt - - case - - __fisher_file | __fisher_name - - case \* - if test -s "$source" - __fisher_list - < $source - end - end -end diff --git a/functions/__fisher_plugin_disable.fish b/functions/__fisher_plugin_disable.fish index 5e1079c..508af71 100644 --- a/functions/__fisher_plugin_disable.fish +++ b/functions/__fisher_plugin_disable.fish @@ -11,7 +11,7 @@ function __fisher_plugin_disable -a plugin path option __fisher_plugin_uninstall_handler $plugin $source "$option" case \* - __fisher_plugin_unlink $name $fisher_config/$target + __fisher_plugin_unlink $fisher_config/$target $name end end @@ -20,7 +20,7 @@ function __fisher_plugin_disable -a plugin path option end if test -s $fisher_file - debug "Remove '%s' from fishfile" "$plugin" + debug "Remove from fishfile %s" "$plugin" __fisher_file_remove ( if not fisher_search --name=$plugin --name --index=$fisher_cache/.index diff --git a/functions/__fisher_plugin_unlink.fish b/functions/__fisher_plugin_unlink.fish index bf048f2..89635bb 100644 --- a/functions/__fisher_plugin_unlink.fish +++ b/functions/__fisher_plugin_unlink.fish @@ -1,7 +1,9 @@ -function __fisher_plugin_unlink -a name file - debug "Unlink '%s'" $file +function __fisher_plugin_unlink -a file name + debug "Unlink %s" $file command rm -f $file - - debug "Erase function '%s'" $name - functions -e $name + + if test ! -z "$name" + debug "Erase %s" $name + functions -e $name + end end diff --git a/functions/__fisher_plugin_validate.fish b/functions/__fisher_plugin_validate.fish index 0160ddf..52f35cc 100644 --- a/functions/__fisher_plugin_validate.fish +++ b/functions/__fisher_plugin_validate.fish @@ -1,31 +1,44 @@ function __fisher_plugin_validate -a plugin + if set -q argv[2] + printf "%s\n" "$argv" + return 1 + end + switch "$plugin" case ..\* + printf "%s\n" "../" return 1 - case . /\* ./\* - if test ! -e $plugin + case . ./\* /\* + if test ! -e "$plugin" + printf "%s\n" $plugin return 1 end - switch "$plugin" - case /\* - printf "%s\n" $plugin + set plugin ( + switch "$plugin" + case /\* + printf "%s\n" $plugin - case \* - printf "$PWD/%s/%s" (dirname $plugin) (basename $plugin) + case \* + printf "$PWD/%s/%s" (dirname "$plugin") (basename "$plugin") - end | sed -E 's|[./]*$||; s|/([\./])/+|/|g' + end | sed -E 's|[./]*$||; s|/([\./])/+|/|g' + ) + + printf "%s\n" $plugin + + __fisher_plugin_validate (basename $plugin) > /dev/null case \* set -l id "[A-Za-z0-9._-]" - if not printf "%s\n" $plugin | grep -qE "^(($id+)[:/]*)*\$" - printf "%s\n" $plugin + if not printf "%s\n" "$plugin" | grep -qE "^(($id+)[:/]*)*\$" + printf "%s\n" "$plugin" return 1 end - printf "%s\n" $plugin \ + printf "%s\n" "$plugin" \ | sed -E " s|^gh[:/]+|https://github.com/| s|^gl[:/]+|https://gitlab.com/| diff --git a/functions/__fisher_plugin_walk.fish b/functions/__fisher_plugin_walk.fish index 48b0bed..7828a5c 100644 --- a/functions/__fisher_plugin_walk.fish +++ b/functions/__fisher_plugin_walk.fish @@ -21,11 +21,17 @@ function __fisher_plugin_walk -a plugin path switch "$base" case \*$plugin\* case \* - debug "Rename '%s' to '%s'" $plugin $plugin.$base + debug "Move %s to %s" $plugin $plugin.$base set base $plugin.$base end - printf "%s %s %s\n" --source $file conf.d/$base + switch "$name" + case fish_postexec fish_preexec fish_command_not_found + case \* + set name + end + + printf "%s %s %s %s\n" --source $file conf.d/$base $name case \* printf "%s %s %s %s\n" --source $file functions/$base $name @@ -35,14 +41,14 @@ function __fisher_plugin_walk -a plugin path for file in $path/{functions/,}*.{py,rb,php,pl,awk,sed} set -l base (basename $file) - debug "Script file '%s'" $file + debug "Script %s" $file printf "%s %s %s\n" -- $file functions/$base end for n in (seq 9) for file in $path/man/man$n/*.$n - debug "Manual page '%s'" $file + debug "Man %s" $file printf "%s %s %s\n" --man $file man/man$n/(basename $file) end diff --git a/functions/fish_config.fish b/functions/fish_config.fish new file mode 100644 index 0000000..c3fdf17 --- /dev/null +++ b/functions/fish_config.fish @@ -0,0 +1,28 @@ +function fish_config -d "Launch fish's web based configuration" -a tab + set -l config ~/.config + + if set -q XDG_CONFIG_HOME + set config $XDG_CONFIG_HOME + end + + set -l file $config/fish/functions/fish_prompt.fish + set -l sum_before (cksum $file ^ /dev/null | awk '{ print $1 + $2 }') + + debug "fish_config start" + + eval $__fish_datadir/tools/web_config/webconfig.py $tab + + debug "fish_config end" + + if test ! -z "$fisher_prompt" + set -l sum_after (cksum $file ^ /dev/null | awk '{ print $1 + $2 }') + + debug "fish_prompt check sum before: %s" $sum_before + debug "fish_prompt check sum after: %s" $sum_after + + if test "$sum_before" != "$sum_after" + debug "Uninstall %s" "$fisher_prompt" + fisher_uninstall "$fisher_prompt" -q + end + end +end diff --git a/functions/fisher.fish b/functions/fisher.fish index 27e9af5..f52e0ef 100644 --- a/functions/fisher.fish +++ b/functions/fisher.fish @@ -1,4 +1,4 @@ -function fisher -d "Fish Plugin Manager" +function fisher -d "Fish plugin manager" set -l value set -l option help @@ -13,18 +13,10 @@ function fisher -d "Fish Plugin Manager" set option help set value $value $2 - case l list - set option list - set value $2 - case v version set option version case \* - if test ! -z "$option" - continue - end - printf "fisher: '%s' is not a valid option.\n" $1 > /dev/stderr fisher -h > /dev/stderr return 1 @@ -33,14 +25,26 @@ function fisher -d "Fish Plugin Manager" switch "$option" case command - printf "%s\n" $fisher_alias | sed 's/[=,]/ /g' | while read -la alias - if set -q alias[2] - switch "$value" - case $alias[2..-1] - set value $alias[1] - break + switch "$version" + case 2.1.\* 2.0.0 + if test ! -z "$fisher_alias" + printf "fisher: fish 2.2.0 or above is required to use aliases." + end + + case \* + if test -z "$fisher_alias" + set fisher_alias install=i update=u search=s list=l help=h + end + + printf "%s\n" $fisher_alias | sed 's/[=,]/ /g' | while read -la alias + if set -q alias[2] + switch "$value" + case $alias[2..-1] + set value $alias[1] + break + end + end end - end end if not functions -q "fisher_$value" @@ -58,18 +62,15 @@ function fisher -d "Fish Plugin Manager" eval "fisher_$value" (printf "%s\n" "'"$argv"'") - case list - __fisher_list $value - case version - sed 's/^/fisher version /;q' $fisher_home/VERSION + sed 's/^/fisher version /' $fisher_home/VERSION case help if test -z "$value" set value commands end - printf "Usage: fisher [] [--list] [--version]\n\n" + printf "Usage: fisher [] [--help] [--version]\n\n" switch commands case $value diff --git a/functions/fisher_help.fish b/functions/fisher_help.fish index cd59782..779009a 100644 --- a/functions/fisher_help.fish +++ b/functions/fisher_help.fish @@ -1,4 +1,4 @@ -function fisher_help -d "Show Help" +function fisher_help -d "Show help" if not set -q argv[1] man fisher return @@ -31,10 +31,9 @@ function fisher_help -d "Show Help" case h printf "Usage: fisher help [] [--all] [--guides] [--help]\n\n" - printf " -a --all List available documentation\n" - printf " -g --guides List available guides\n" - printf " -h --help Show usage help\n" - printf " --usage[=] Display command usage\n" + printf " -a --all List all the documentation\n" + printf " -g --guides List available guides\n" + printf " -h --help Show usage help\n" return case \* diff --git a/functions/fisher_install.fish b/functions/fisher_install.fish index 2c8ba22..5757c1b 100644 --- a/functions/fisher_install.fish +++ b/functions/fisher_install.fish @@ -1,4 +1,4 @@ -function fisher_install -d "Install Plugins" +function fisher_install -d "Install plugins" set -l plugins set -l option set -l stdout /dev/stdout @@ -37,6 +37,8 @@ function fisher_install -d "Install Plugins" set -l total (count $plugins) set -l skipped + set -l IFS \t + if set -q plugins[1] printf "%s\n" $plugins else @@ -46,16 +48,19 @@ function fisher_install -d "Install Plugins" debug "Validate %s" $item if not set item (__fisher_plugin_validate $item) + debug "Validate fail %s" $item printf "fisher: '%s' is not a valid name, path or URL.\n" $item > $stderr continue end + debug "Validate pass %s" $item + switch "$item" case https://gist.github.com\* debug "Install gist %s" $item if set -l name (__fisher_gist_to_name $item) - printf "%s %s\n" $item $name + printf "%s\t%s\n" $item $name else set total (math $total - 1) printf "fisher: Repository '%s' not found.\n" $item > $stderr @@ -64,18 +69,18 @@ function fisher_install -d "Install Plugins" case \*/\* debug "Install URL %s" $item - printf "%s %s\n" $item (printf "%s\n" $item | __fisher_name) + printf "%s\t%s\n" "$item" (printf "%s\n" "$item" | __fisher_name) case \* if set -l url (fisher_search --url --name=$item --index=$fisher_cache/.index) debug "Install %s" $item - printf "%s %s\n" $url $item + printf "%s\t%s\n" $url $item else if test -d $fisher_cache/$item debug "Install %s" \$fisher_cache/$item - printf "%s %s\n" (__fisher_url_from_path $fisher_cache/$item) $item + printf "%s\t%s\n" (__fisher_url_from_path $fisher_cache/$item) $item else set total (math $total - 1) @@ -85,7 +90,7 @@ function fisher_install -d "Install Plugins" end | while read -l url name - if contains -- $name (__fisher_list $fisher_file) + if contains -- $name (fisher_list $fisher_file) if test -z "$option" set total (math $total - 1) set skipped $skipped $name @@ -110,11 +115,11 @@ function fisher_install -d "Install Plugins" if test ! -e $path if test -d "$url" - debug "Link '%s' to the cache" $url + debug "Link %s" $url command ln -sfF $url $path else - debug "Download '%s'" $url + debug "Download %s" $url if not spin "__fisher_url_clone $url $path" --error=$stderr continue diff --git a/functions/fisher_list.fish b/functions/fisher_list.fish new file mode 100644 index 0000000..0ce50cb --- /dev/null +++ b/functions/fisher_list.fish @@ -0,0 +1,69 @@ +function fisher_list -a key -d "List installed plugins" + switch "$key" + case -b --bare + __fisher_cache_list + + case "" + set -l enabled (fisher_list $fisher_file) + set -l cache (__fisher_cache_list) + + if test -z "$cache" + return 1 + end + + set -l indent " " + + if test -z "$enabled" + set indent "" + end + + for i in $cache + if contains -- $i $enabled + if test $i = "$fisher_prompt" + printf "%s%s\n" ">$indent" $i + + else if test -L $fisher_cache/$i + + printf "%s%s\n" "@$indent" $i + + else + printf "%s%s\n" "*$indent" $i + end + else + printf "%s%s\n" "$indent$indent" $i + end + end + + case -l --link + find $fisher_cache/* -maxdepth 0 -type l ^ /dev/null | sed 's|.*/||' + + case --enabled + fisher_list $fisher_file + + case --disabled + set -l enabled (fisher_list $fisher_file) + + for name in (__fisher_cache_list) + if not contains -- $name $enabled + printf "%s\n" $name + end + end + + case - + __fisher_file | __fisher_name + + case -h + printf "Usage: fisher list [] [--enabled] [--disabled] [--bare] [--link] \n\n" + printf " -b --bare List plugin without decorators\n" + printf " -l --link List plugins that are symbolic links\n" + printf " --enabled List plugins that are enabled\n" + printf " --disabled List plugins that are disabled\n" + printf " -h --help Show usage help\n" + return + + case \* + if test -s "$key" + fisher_list - < $key + end + end +end diff --git a/functions/fisher_search.fish b/functions/fisher_search.fish index 7128913..d8ca955 100644 --- a/functions/fisher_search.fish +++ b/functions/fisher_search.fish @@ -1,4 +1,4 @@ -function fisher_search -d "Search Plugins" +function fisher_search -d "Search plugin index" set -l fields set -l query set -l index @@ -9,9 +9,6 @@ function fisher_search -d "Search Plugins" getopts $argv | while read -l 1 2 3 switch "$1" - case fmt format - set format "$2" - case _ switch "$2" case \*/\* @@ -50,13 +47,19 @@ function fisher_search -d "Search Plugins" set query $query "$3 tags(\"$2\")" $join end + case long + set format long + + case full + set format full + case a and set join "&&" case o or set join "||" - case no-color + case C no-color set option no-color case query @@ -69,15 +72,14 @@ function fisher_search -d "Search Plugins" set stdout /dev/null case h - printf "Usage: fisher search [] [--format=] [--and|--or]\n" - printf " [--no-color] [--quiet] [--help]\n\n" - - printf " -a --and Join query with AND operator\n" - printf " -o --or Join query with OR operator\n" - printf " --no-color Turn off color display\n" - printf " --format= Use format to display results\n" - printf " -q --quiet Enable quiet mode\n" - printf " -h --help Show usage help\n" + printf "Usage: fisher search [] [--long] [--full] [--no-color]\n" + printf " [--quiet] [--help]\n\n" + + printf " --long Display results in long format\n" + printf " --full Display results in full format\n" + printf " -C --no-color Turn off color display\n" + printf " -q --quiet Enable quiet mode\n" + printf " -h --help Show usage help\n" return case \* @@ -144,14 +146,14 @@ function fisher_search -d "Search Plugins" end set legend - set local (fisher -l | awk ' + set local (fisher_list | awk ' !/^@/ { if (append) { printf("|") } - printf("%s", substr($0, 2)) + printf("%s", substr($0, 3)) append++ } @@ -162,46 +164,42 @@ function fisher_search -d "Search Plugins" set legend " " end - set fields 'if ("'"$local"'" && $1~/'"$local"'/) {' + set fields ' + legend="*" + + if ($1 == "'"$fisher_prompt"'") { + legend = ">" + } + + if ("'"$local"'" && $1~/'"$local"'/) { + ' switch "$format" - case default oneline + case default set fields $fields ' - printf("* '"$weak_color"'%-18s'"$normal"' %s\n", $1, $3) + printf("%s '"$weak_color"'%-18s'"$normal"' %s\n", legend, $1, $3) } else { printf("'"$legend$name_color"'%-18s'"$normal"' %s\n", $1, $3) } ' set options $options -v compact=1 - case longline + case long set fields $fields ' - printf("%-40s * '"$weak_color"'%-18s'"$normal"' %s\n", humanize_url($2), $1, $3) + printf("%-40s %s '"$weak_color"'%-18s'"$normal"' %s\n", humanize_url($2), legend, $1, $3) } else { printf("'"$tag_color"'%-40s'"$normal"' '"$legend$name_color"'%-18s'"$normal"' %s\n", humanize_url($2), $1, $3) } ' set options $options -v compact=1 - case short + case full set fields $fields ' - printf("'"$weak_color"'*%s by %s\n%s'"$normal"'\n%s\n", $1, $5, $3, humanize_url($2)) + printf("'"$weak_color"'%s %s by %s\n%s'"$normal"'\n%s\n", legend, $1, $5, $3, humanize_url($2)) } else { printf("'"$name_color"'%s'"$normal"' by '"$author_color"'%s'"$normal"'\n%s\n'"$url_color"'%s'"$normal"'\n", $1, $5, $3, humanize_url($2)) } ' - - case verbose - set fields $fields ' - printf("'"$weak_color"'*%s by %s\n%s'"$normal"'\n%s\n%s\n", $1, $5, $3, $4, humanize_url($2)) - } else { - printf("'"$name_color"'%s'"$normal"' by '"$author_color"'%s'"$normal"'\n%s\n'"$tag_color"'%s'"$normal"'\n'"$url_color"'%s'"$normal"'\n", $1, $5, $3, $4, humanize_url($2)) - } - ' - - case raw - set fields print - end else if test "$fields" = author diff --git a/functions/fisher_uninstall.fish b/functions/fisher_uninstall.fish index 376217d..87b8b5a 100644 --- a/functions/fisher_uninstall.fish +++ b/functions/fisher_uninstall.fish @@ -1,4 +1,4 @@ -function fisher_uninstall -d "Uninstall Plugins" +function fisher_uninstall -d "Uninstall plugins" set -l plugins set -l option set -l stdout /dev/stdout @@ -18,7 +18,7 @@ function fisher_uninstall -d "Uninstall Plugins" case h printf "Usage: fisher uninstall [] [--force] [--quiet] [--help]\n\n" - printf " -f --force Delete copy from cache\n" + printf " -f --force Delete copy from the cache\n" printf " -q --quiet Enable quiet mode\n" printf " -h --help Show usage help\n" return @@ -35,6 +35,8 @@ function fisher_uninstall -d "Uninstall Plugins" set -l index 1 set -l total (count $plugins) set -l skipped + + set -l IFS \t if set -q plugins[1] printf "%s\n" $plugins @@ -42,14 +44,17 @@ function fisher_uninstall -d "Uninstall Plugins" __fisher_file end | while read -l item path - - debug "Validate '%s'" $item + debug "Validate %s" $item + debug "Shit %s" $path if not set item (__fisher_plugin_validate $item) - printf "fisher: '%s' is not a valid name, path or url.\n" $item > $stderr + debug "Validate fail %s" $item + printf "fisher: '%s' is not a valid name, path or URL.\n" $item > $stderr continue end + debug "Validate pass %s" $item + if not set path (__fisher_path_from_plugin $item) set total (math $total - 1) printf "fisher: '%s' not found\n" $item > $stderr @@ -58,9 +63,9 @@ function fisher_uninstall -d "Uninstall Plugins" set -l name (printf "%s\n" $path | __fisher_name) - debug "Uninstall '%s' in '%s'" "$name" "$path" + debug "Uninstall %s" "$name" - if not contains -- $name (__fisher_list $fisher_file) + if not contains -- $name (fisher_list $fisher_file) if test -z "$option" set total (math $total - 1) set skipped $skipped $name @@ -80,14 +85,14 @@ function fisher_uninstall -d "Uninstall Plugins" end if __fisher_plugin_can_enable "$name" "$path" - debug "Plugin disable '%s' w/ option '%s'" "$name" "$option" - + debug "Plugin disable %s w/ option %s" "$name" "$option" __fisher_plugin_disable "$name" "$path" "$option" + else + debug "Plugin can't dissable %s" "$name" end if test "$option" = force debug "Remove path '%s'" "$path" - command rm -rf $path end @@ -107,12 +112,12 @@ function fisher_uninstall -d "Uninstall Plugins" return 1 end - debug "Pre-reset completions and key bindings" + debug "Reset completions and key bindings start" __fisher_complete_reset __fisher_key_bindings_reset - debug "Post-reset completions and key bindings" + debug "Reset completions and key bindings done" printf "Aye! %d plugin/s uninstalled in %0.fs\n" $count $time > $stdout end diff --git a/functions/fisher_update.fish b/functions/fisher_update.fish index e6cdbed..ed9d8a4 100644 --- a/functions/fisher_update.fish +++ b/functions/fisher_update.fish @@ -1,4 +1,4 @@ -function fisher_update -d "Update Plugins/Fisherman" +function fisher_update -d "Update plugins" set -l plugins set -l option self set -l stdout /dev/stdout @@ -64,6 +64,8 @@ function fisher_update -d "Update Plugins/Fisherman" set -l total (count $plugins) set -l skipped + set -l IFS \t + if set -q plugins[1] printf "%s\n" $plugins else @@ -74,7 +76,7 @@ function fisher_update -d "Update Plugins/Fisherman" debug "Validate '%s'" $item if not set item (__fisher_plugin_validate $item) - printf "fisher: '%s' is not a valid name, path or url.\n" $item > $stderr + printf "fisher: '%s' is not a valid name, path or URL.\n" $item > $stderr continue end diff --git a/functions/getopts.fish b/functions/getopts.fish index 5b1ee2d..e692dec 100644 --- a/functions/getopts.fish +++ b/functions/getopts.fish @@ -1,10 +1,11 @@ -function getopts -d "Parse command options" +function getopts -d "Parse command line options" if not set -q argv[1] return 1 end printf "%s\n" $argv | sed -E ' - s/^-([A-Za-z]+)/- \1 /; s/^--([A-Za-z0-9_-]+)(!?)=?(.*)/-- \1 \3 \2 /' | awk ' + s/^-([A-Za-z]+)/- \1 / + s/^--([A-Za-z0-9_-]+)(!?)=?(.*)/-- \1 \3 \2 /' | awk ' function out(k,v) { if (!seen[k v]++) print k (v == "" ? "" : " "v) } function pop() { return len <= 0 ? "_" : opt[len--] } diff --git a/man/man1/fisher-help.1 b/man/man1/fisher-help.1 index f434d36..a15c46a 100644 --- a/man/man1/fisher-help.1 +++ b/man/man1/fisher-help.1 @@ -4,21 +4,21 @@ .TH "FISHER\-HELP" "1" "February 2016" "" "fisherman" . .SH "NAME" -\fBfisher\-help\fR \- Show Help +\fBfisher\-help\fR \- Show help about Fisherman . .SH "SYNOPSIS" -fisher \fBhelp\fR [\fIkeyword\fR] [\fB\-\-all\fR] [\fB\-\-guides\fR] [\fB\-\-usage\fR[=\fIcommand\fR]] [\fB\-\-help\fR] +fisher help [\fIkeyword\fR] [\-\-all] [\-\-guides] [\-\-usage[=\fIcommand\fR]] [\-\-help] . .br . .SH "USAGE" -fisher \fBhelp\fR \fIcommand\fR +fisher help \fIcommand\fR . .br -fisher \fBhelp\fR \fIguide\fR +fisher help \fIguide\fR . .br -fisher \fBhelp\fR \fB\-\-usage\fR=[\fIcommand\fR] +fisher help \-\-usage=[\fIcommand\fR] . .br . @@ -26,7 +26,7 @@ fisher \fBhelp\fR \fB\-\-usage\fR=[\fIcommand\fR] Help displays \fIcommand\fR documentation, usage, guides and tutorials\. . .P -Help is based in \fBman\fR(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\.1~7 pages and add them to your project under the corresponding man/man% directory\. . .IP "" 4 . @@ -43,37 +43,37 @@ my_plugin .IP "" 0 . .P -Help for my_plugin is now available via \fBman\fR(1)\. To add documentation to a \fBfisher\fR command, prepend the keyword \fBfisher\-\fR to the man file, e\.g\., \fBfisher\-my\-command\.1\fR\. This will teach Fisherman how to access the man page using \fBfisher help my\-command\fR\. +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\. . .P -There are utilities that can help you generate man pages from other text formats, such as Markdown\. One example is \fBronn\fR(1)\. For an example without using external utilities, see \fIExample\fR in \fBfisher help plugins\fR\. +There are utilities that can help you generate man pages from other text formats, such as Markdown\. For example pandoc(1) or ronn(1)\. . .SH "OPTIONS" . .TP -\fB\-a \-\-all\fR +\-a, \-\-all List all available commands and guides\. . .TP -\fB\-g \-\-guides[=*bare*]\fR +\-g, \-\-guides[=\fIbare\fR] List guides / tutorials\. Use \fIbare\fR to generate easy to parse output\. . .TP -\fB\-\-commands[=*bare*]\fR -List commands\. This is the default behavior of \fBfisher help\fR\. Use \fIbare\fR to generate easy to parse output\. +\-\-commands[=\fIbare\fR] +List commands\. This is the default behavior of fisher help\. Use \fIbare\fR to generate easy to parse output\. . .TP -\fB\-\-usage[=*command*]\fR -Display usage help for \fIcommand\fR\. To teach Fisherman how to display help for your command, \fIcommand\fR must implement a \fB\-h\fR flag\. +\-\-usage[=\fIcommand\fR] +Display usage help for \fIcommand\fR\. To teach Fisherman how to display help for your command, \fIcommand\fR must implement a \-h flag\. . .TP -\fB\-h \-\-help\fR +\-h, \-\-help Show usage help\. . .SH "EXAMPLES" . .IP "\(bu" 4 -Show all the available documentation\. +Show all the existing documentation\. . .IP "" 0 . @@ -81,14 +81,14 @@ Show all the available documentation\. . .nf -fisher help \-a +fisher help \-\-all . .fi . .IP "" 0 . .IP "\(bu" 4 -Show documentation about help\. +Show help about help\. . .IP "" 0 . @@ -103,7 +103,7 @@ fisher help help .IP "" 0 . .IP "\(bu" 4 -Show usage help for all Fisherman commands\. +Show usage help for all available commands\. . .IP "" 0 . @@ -118,4 +118,4 @@ fisher help \-\-commands=bare | fisher help \-\-usage .IP "" 0 . .SH "SEE ALSO" -\fBman\fR(1), \fBfisher\fR(1) +man(1), fisher(1) diff --git a/man/man1/fisher-help.md b/man/man1/fisher-help.md index 715de93..e337a7e 100644 --- a/man/man1/fisher-help.md +++ b/man/man1/fisher-help.md @@ -1,21 +1,21 @@ -fisher-help(1) -- Show Help -=========================== +fisher-help(1) -- Show help about Fisherman +=========================================== ## SYNOPSIS -fisher `help` [*keyword*] [`--all`] [`--guides`] [`--usage`[=*command*]] [`--help`]
+fisher help [*keyword*] [--all] [--guides] [--usage[=*command*]] [--help]
## USAGE -fisher `help` *command*
-fisher `help` *guide*
-fisher `help` `--usage`=[*command*]
+fisher help *command*
+fisher help *guide*
+fisher help --usage=[*command*]
## DESCRIPTION Help displays *command* documentation, usage, guides and tutorials. -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.1~7 pages and add them to your project under the corresponding man/man% directory. ``` my_plugin @@ -25,42 +25,42 @@ my_plugin `-- my_plugin.1 ``` -Help for my_plugin is now 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`. +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. -There are utilities that can help you generate man pages from other text formats, such as Markdown. One example is `ronn`(1). For an example without using external utilities, see *Example* in `fisher help plugins`. +There are utilities that can help you generate man pages from other text formats, such as Markdown. For example pandoc(1) or ronn(1). ## OPTIONS -* `-a --all`: +* -a, --all: List all available commands and guides. -* `-g --guides[=*bare*]`: +* -g, --guides[=*bare*]: List guides / tutorials. Use *bare* to generate easy to parse output. -* `--commands[=*bare*]`: - List commands. This is the default behavior of `fisher help`. Use *bare* to generate easy to parse output. +* --commands[=*bare*]: + List commands. This is the default behavior of fisher help. Use *bare* to generate easy to parse output. -* `--usage[=*command*]`: - Display usage help for *command*. To teach Fisherman how to display help for your command, *command* must implement a `-h` flag. +* --usage[=*command*]: + Display usage help for *command*. To teach Fisherman how to display help for your command, *command* must implement a -h flag. -* `-h --help`: +* -h, --help: Show usage help. ## EXAMPLES -* Show all the available documentation. +* Show all the existing documentation. ``` -fisher help -a +fisher help --all ``` -* Show documentation about help. +* Show help about help. ``` fisher help help ``` -* Show usage help for all Fisherman commands. +* Show usage help for all available commands. ``` fisher help --commands=bare | fisher help --usage @@ -68,4 +68,4 @@ fisher help --commands=bare | fisher help --usage ## SEE ALSO -`man`(1), `fisher`(1) +man(1), fisher(1) diff --git a/man/man1/fisher-install.1 b/man/man1/fisher-install.1 index 42acb2e..baf6de9 100644 --- a/man/man1/fisher-install.1 +++ b/man/man1/fisher-install.1 @@ -4,48 +4,42 @@ .TH "FISHER\-INSTALL" "1" "February 2016" "" "fisherman" . .SH "NAME" -\fBfisher\-install\fR \- Install Plugins +\fBfisher\-install\fR \- Install plugins . .SH "SYNOPSIS" -fisher \fBinstall\fR [\fIplugins\fR \.\.\.] [\fB\-\-force\fR] [\fB\-\-quiet\fR] [\fB\-\-help\fR] +fisher install [\fIplugins\fR \.\.\.] [\-\-force] [\-\-quiet] [\-\-help] . .SH "USAGE" -fisher \fBinstall\fR \fIurl\fR \.\.\. +fisher install \fIurl\fR . .br -fisher \fBinstall\fR \fIname\fR \.\.\. +fisher install \fIname\fR . .br -fisher \fBinstall\fR \fIpath\fR \.\.\. +fisher install \fIpath\fR . .br -fisher \fBinstall\fR \fIowner/repo\fR \.\.\. +fisher install \fIowner/repo\fR +. +.br +fisher install \fIfunction\fR . .br . .SH "DESCRIPTION" -Install one or more plugins, by name, URL or a local path\. If no arguments are given, read the standard input\. +Install one or more plugins, by name, URL, path or function name\. If no arguments are given, read the standard input\. . .P -In addition, all of the following \fBowner/repo\fR variations are accepted: +In addition, all of the following owner/repo variations are accepted: . .IP "\(bu" 4 -owner/repo \fB>\fR https://github\.com/owner/repo -. -.br - +owner/repo \fIhttps://github\.com/owner/repo\fR . .IP "\(bu" 4 -\fIgithub\fR/owner/repo \fB>\fR https://github\.com/owner/repo -. -.br - +github/owner/repo \fIhttps://github\.com/owner/repo\fR . .IP "\(bu" 4 -\fIgh\fR/owner/repo \fB>\fR https://github\.com/owner/repo -. -.br - +gh/owner/repo \fIhttps://github\.com/owner/repo\fR . .IP "" 0 . @@ -53,53 +47,44 @@ owner/repo \fB>\fR https://github\.com/owner/repo Shortcuts to other common Git repository hosting services are also available: . .IP "\(bu" 4 -\fIbb\fR/owner/repo \fB>\fR https://bitbucket\.org/owner/repo -. -.br - +bb/owner/repo \fIhttps://bitbucket\.org/owner/repo\fR . .IP "\(bu" 4 -\fIgl\fR/owner/repo \fB>\fR https://gitlab\.com/owner/repo -. -.br - +gl/owner/repo \fIhttps://gitlab\.com/owner/repo\fR . .IP "\(bu" 4 -\fIomf\fR/owner/repo \fB>\fR https://github\.com/oh\-my\-fish/repo -. -.br - +omf/owner/repo \fIhttps://github\.com/oh\-my\-fish/repo\fR . .IP "" 0 . .P -If a URL is given, the repository is cloned to \fB$fisher_cache\fR the first time and any relevant plugin files are copied to \fB$fisher_config\fR functions, completions, conf\.d and man directories\. +If a URL is given, the repository is cloned to $fisher_cache the first time and any relevant plugin files are copied to $fisher_config functions, completions, conf\.d and man directories\. . .P -If the plugin already exists in \fB$fisher_cache\fR, the files are only copied to \fB$fisher_config\fR\. To update a plugin use \fBfisher update\fR\. +If the plugin already exists in $fisher_cache, the files are only copied to $fisher_config\. To update a plugin use fisher update\. . .P -If the plugin declares dependencies, these will be installed too\. If any of the dependencies are already enabled or downloaded to the cache, they will not be updated to prevent version issues\. See \fIPlugins\fR in \fBfisher help fishfile\fR\. +If the plugin declares dependencies, these will be installed too\. If any of the dependencies are already enabled or downloaded to the cache, they will not be updated to prevent version issues\. . .P -If a plugin includes either a \fBfish_prompt\.fish\fR or \fBfish_right_prompt\.fish\fR, both files are first removed from \fB$fisher_config/functions\fR and then the new ones are copied\. +If a plugin includes either a fish_prompt\.fish or fish_right_prompt\.fish, both files are first removed from $fisher_config/functions and then the new ones are copied\. . .SH "OPTIONS" . .TP -\fB\-f\fR \fB\-\-force\fR -Reinstall given plugin/s\. If the plugin is already in the cache, it will be installed from the cache\. +\-f, \-\-force +Reinstall given plugin/s\. . .TP -\fB\-q\fR \fB\-\-quiet\fR +\-q, \-\-quiet Enable quiet mode\. . .TP -\fB\-h\fR \fB\-\-help\fR +\-h, \-\-help Show usage help\. . -.SH "EXAMPLES" -Here is the directory tree of \fImy_plugin\fR: +.SH "DIRECTORY TREE" +The directory tree in \fImy_plugin\fR . .IP "" 4 . @@ -123,7 +108,7 @@ my_plugin .IP "" 0 . .P -And here is the directory tree of \fB$fisher_config/\fR after running \fBfisher install my_plugin\fR: +The directory tree in $fisher_config after running fisher install my_plugin: . .IP "" 4 . @@ -146,11 +131,8 @@ $fisher_config . .IP "" 0 . -.P -In addition, any \fBinit\.fish\fR and \fB*\.config\.fish\fR files, are copied to \fB$fisher_config/conf\.d\fR and evaluated during the start of the shell\. -. -.P -To prevent name collisions, \fBinit\.fish\fR files are renamed to \fBmy_plugin\.init\.fish\fR\. +.SH "SNIPPETS" +Snippets are plugins that run code at the start of the shell\. Snippets must be placed inside a sub directory named conf\.d\. . .SH "EXAMPLES" . @@ -170,16 +152,7 @@ fisher install fishtape simnalamburt/shellder ~/plugins/my_plugin .IP "" 0 . .SH "SEE ALSO" -\fBfisher\fR(1) -. -.br -\fBfisher help config\fR -. -.br -\fBfisher help update\fR -. -.br -\fBfisher help uninstall\fR +fisher help uninstall . .br diff --git a/man/man1/fisher-install.md b/man/man1/fisher-install.md index a892630..ce6b96b 100644 --- a/man/man1/fisher-install.md +++ b/man/man1/fisher-install.md @@ -1,55 +1,56 @@ -fisher-install(1) -- Install Plugins +fisher-install(1) -- Install plugins ==================================== ## SYNOPSIS -fisher `install` [*plugins* ...] [`--force`] [`--quiet`] [`--help`] +fisher install [*plugins* ...] [--force] [--quiet] [--help] ## USAGE -fisher `install` *url* ...
-fisher `install` *name* ...
-fisher `install` *path* ...
-fisher `install` *owner/repo* ...
+fisher install *url*
+fisher install *name*
+fisher install *path*
+fisher install *owner/repo*
+fisher install *function*
## DESCRIPTION -Install one or more plugins, by name, URL or a local path. If no arguments are given, read the standard input. +Install one or more plugins, by name, URL, path or function name. If no arguments are given, read the standard input. -In addition, all of the following `owner/repo` variations are accepted: +In addition, all of the following owner/repo variations are accepted: -* owner/repo `>` https://github.com/owner/repo
-* *github*/owner/repo `>` https://github.com/owner/repo
-* *gh*/owner/repo `>` https://github.com/owner/repo
+* owner/repo *https://github.com/owner/repo* +* github/owner/repo *https://github.com/owner/repo* +* gh/owner/repo *https://github.com/owner/repo* Shortcuts to other common Git repository hosting services are also available: -* *bb*/owner/repo `>` https://bitbucket.org/owner/repo
-* *gl*/owner/repo `>` https://gitlab.com/owner/repo
-* *omf*/owner/repo `>` https://github.com/oh-my-fish/repo
+* bb/owner/repo *https://bitbucket.org/owner/repo* +* gl/owner/repo *https://gitlab.com/owner/repo* +* omf/owner/repo *https://github.com/oh-my-fish/repo* -If a URL is given, the repository is cloned to `$fisher_cache` the first time and any relevant plugin files are copied to `$fisher_config` functions, completions, conf.d and man directories. +If a URL is given, the repository is cloned to $fisher_cache the first time and any relevant plugin files are copied to $fisher_config functions, completions, conf.d and man directories. -If the plugin already exists in `$fisher_cache`, the files are only copied to `$fisher_config`. To update a plugin use `fisher update`. +If the plugin already exists in $fisher_cache, the files are only copied to $fisher_config. To update a plugin use fisher update. -If the plugin declares dependencies, these will be installed too. If any of the dependencies are already enabled or downloaded to the cache, they will not be updated to prevent version issues. See *Plugins* in `fisher help fishfile`. +If the plugin declares dependencies, these will be installed too. If any of the dependencies are already enabled or downloaded to the cache, they will not be updated to prevent version issues. -If a plugin includes either a `fish_prompt.fish` or `fish_right_prompt.fish`, both files are first removed from `$fisher_config/functions` and then the new ones are copied. +If a plugin includes either a fish_prompt.fish or fish_right_prompt.fish, both files are first removed from $fisher_config/functions and then the new ones are copied. ## OPTIONS -* `-f` `--force`: - Reinstall given plugin/s. If the plugin is already in the cache, it will be installed from the cache. +* -f, --force: + Reinstall given plugin/s. -* `-q` `--quiet`: +* -q, --quiet: Enable quiet mode. -* `-h` `--help`: +* -h, --help: Show usage help. -## EXAMPLES +## DIRECTORY TREE -Here is the directory tree of *my_plugin*: +The directory tree in *my_plugin* ``` my_plugin @@ -66,7 +67,7 @@ my_plugin `-- my_plugin.1 ``` -And here is the directory tree of `$fisher_config/` after running `fisher install my_plugin`: +The directory tree in $fisher_config after running fisher install my_plugin: ``` $fisher_config @@ -83,9 +84,9 @@ $fisher_config `-- my_plugin/... ``` -In addition, any `init.fish` and `*.config.fish` files, are copied to `$fisher_config/conf.d` and evaluated during the start of the shell. +## SNIPPETS -To prevent name collisions, `init.fish` files are renamed to `my_plugin.init.fish`. +Snippets are plugins that run code at the start of the shell. Snippets must be placed inside a sub directory named conf.d. ## EXAMPLES @@ -97,7 +98,4 @@ fisher install fishtape simnalamburt/shellder ~/plugins/my_plugin ## SEE ALSO -`fisher`(1)
-`fisher help config`
-`fisher help update`
-`fisher help uninstall`
+fisher help uninstall
diff --git a/man/man1/fisher-list.1 b/man/man1/fisher-list.1 new file mode 100644 index 0000000..517505f --- /dev/null +++ b/man/man1/fisher-list.1 @@ -0,0 +1,78 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "FISHER\-LIST" "1" "February 2016" "" "fisherman" +. +.SH "NAME" +\fBfisher\-list\fR \- List installed plugins +. +.SH "SYNOPSIS" +fisher list [\fIfile\fR] +. +.br +fisher list [\-\-bare] [\-\-link] [\-\-enabled] [\-\-disabled] [\-\-help] +. +.br +. +.SH "USAGE" +fisher list [\fIfile\fR] +. +.SH "DESCRIPTION" +The list command displays all the plugins you have installed\. +. +.IP "" 4 +. +.nf + +fisher list + debug +* fishtape +> shellder +* spin +@ wipe +. +.fi +. +.IP "" 0 +. +.P +The legend consists of: +. +.P +\fB*\fR Indicate the plugin is currently installed +. +.br +\fB>\fR Indicate the plugin is a prompt +. +.br +\fB@\fR Indicate the plugin is a symbolic link +. +.br +. +.SH "OPTIONS" +. +.TP +\-b, \-\-bare +List plugin without decorators +. +.TP +\-l, \-\-link +List plugins that are symbolic links +. +.TP +\-\-enabled +List plugins that are enabled +. +.TP +\-\-disabled +List plugins that are disabled +. +.TP +\-h, \-\-help +Show usage help +. +.SH "SEE ALSO" +fisher help search +. +.br + diff --git a/man/man1/fisher-list.md b/man/man1/fisher-list.md new file mode 100644 index 0000000..58ccbc5 --- /dev/null +++ b/man/man1/fisher-list.md @@ -0,0 +1,51 @@ +fisher-list(1) -- List installed plugins +======================================== + +## SYNOPSIS + +fisher list [*file*]
+fisher list [--bare] [--link] [--enabled] [--disabled] [--help]
+ +## USAGE + +fisher list [*file*] + +## DESCRIPTION + +The list command displays all the plugins you have installed. + +``` +fisher list + debug +* fishtape +> shellder +* spin +@ wipe +``` + +The legend consists of: + +`*` Indicate the plugin is currently installed
+`>` Indicate the plugin is a prompt
+`@` Indicate the plugin is a symbolic link
+ +## OPTIONS + +* -b, --bare: + List plugin without decorators + +* -l, --link: + List plugins that are symbolic links + +* --enabled: + List plugins that are enabled + +* --disabled: + List plugins that are disabled + +* -h, --help: + Show usage help + +## SEE ALSO + +fisher help search
diff --git a/man/man1/fisher-search.1 b/man/man1/fisher-search.1 index 3d64c85..e033c02 100644 --- a/man/man1/fisher-search.1 +++ b/man/man1/fisher-search.1 @@ -4,97 +4,152 @@ .TH "FISHER\-SEARCH" "1" "February 2016" "" "fisherman" . .SH "NAME" -\fBfisher\-search\fR \- Search Plugin Index +\fBfisher\-search\fR \- Search plugin index . .SH "SYNOPSIS" -fisher \fBsearch\fR [\fIplugins\fR \.\.\.] +fisher search [\fIplugins\fR \.\.\.] . .br -fisher \fBsearch\fR [\fB\-\-name|\-\-url|\-\-info|\-\-tag|\-\-author\fR] +fisher search [\-\-name|\-\-url|\-\-info|\-\-tag|\-\-author] . .br -fisher \fBsearch\fR [\fB\-\-query\fR=\fIfield\fR[\fB&&\fR,\fB||\fR]\fIfield\fR\.\.\.] +fisher search [\-\-and] [\-\-or] [\-\-quiet] [\-\-help] . .br -fisher \fBsearch\fR [\fB\-\-format\fR=\fIoneline\fR|\fIshort\fR|\fIverbose\fR|\fIlongline\fR] [\-\-no\-color] +fisher search [\-\-long|\-\-full] [\-\-no\-color] . .br -fisher \fBsearch\fR [\fB\-\-and\fR] [\fB\-\-or\fR] [\fB\-\-quiet\fR] [\fB\-\-help\fR] +fisher search [\-\-query=\fIfield\fR[&&,||]\fIfield\fR\.\.\.] . .br . .SH "USAGE" -fisher \fBsearch\fR \fIurl\fR +fisher search \fIurl\fR . .br -fisher \fBsearch\fR \fIname\fR +fisher search \fIname\fR . .br -fisher \fBsearch\fR \fIowner/repo\fR +fisher search \fIowner/repo\fR . .br -fisher \fBsearch\fR \fIquery\fR +fisher search \fIquery\fR . .br . .SH "DESCRIPTION" Search plugins in the Fisherman index\. . +.IP "" 4 +. +.nf + +fisher search + \.\.\. +* debug Conditional debug logger + errno POSIX error code/string translator +* fishtape TAP producing test runner + flash Flash\-inspired, thunder prompt + fzf Efficient keybindings for fzf + get Press any key to continue + \.\.\. +> shellder Powerline prompt optimized for speed + \.\.\. +. +.fi +. +.IP "" 0 +. .P -The index file consists of records plugin name and info\. \fB*\fR is shown if plugin is installed\. +Get detailed information about a plugin\. +. +.IP "" 4 +. +.nf + +fisher search shellder +> shellder by simnalamburt +Powerline prompt optimized for speed +github\.com/simnalamburt/shellder +. +.fi +. +.IP "" 0 . .P -For example: +Search plugins using tags\. . .IP "" 4 . .nf - name info +fisher search \-\-tag={git,test} + \.\.\. +* fishtape TAP producing test runner + git\-branch\-name Get the name of the current Git branch + git\-is\-repo Test if the current directory is a Git repo + git\-is\-dirty Test if there are changes not staged for commit + git\-is\-stashed Test if there are changes in the stash + \.\.\. . .fi . .IP "" 0 . .P -See \fIIndex\fR in \fBfisher help tour\fR for more information about the index\. +The legend consists of: +. +.P +\fB*\fR Indicate the plugin is currently installed +. +.br +\fB>\fR Indicate the plugin is a prompt +. +.br +\fB@\fR Indicate the plugin is a symbolic link +. +.br . .SH "OPTIONS" . .TP -\fB\-\-[=match]\fR -Display index records where \fIfield\fR equals \fImatch\fR\. \fIfield\fR can be any of \fBname\fR, \fBurl\fR, \fBinfo\fR, \fBtag/s\fR or \fBauthor\fR\. If \fImatch\fR is not given, display only the given \fIfield\fR from every record in the index\. Use \fB!=\fR to negate the query\. +\-\-\fIfield\fR[=\fImatch\fR] +Display index records where \fIfield\fR equals \fImatch\fR\. \fIfield\fR can be any of name, url, info, tag/s or author\. If \fImatch\fR is not given, display only the given \fIfield\fR from every record in the index\. Use != to negate the query\. . .TP -\fB\-\-[~/regex/]\fR -Same as \fB\-\-[=regex]\fR, but using Regular Expressions instead of exact matching\. Use \fB!~\fR to negate the query\. +\-\-\fIfield\fR[~/regex/] +Same as \-\-\fIfield\fR[=\fImatch\fR], but using Regular Expressions\. Use !~ to negate the query\. . .TP -\fB\-\-format=oneline|short|verbose|longline\fR -Use the given format to display search results\. +\-\-long +Display results in long format\. . .TP -\fB\-\-no\-color\fR +\-\-full +Display results in full format\. +. +.TP +\-\-no\-color Turn off color display\. . .TP -\fB\-a \-\-and\fR +\-a, \-\-and Join the query with a logical AND operator\. . .TP -\fB\-o \-\-or\fR +\-o, \-\-or Join the query with a logical OR operator\. This is the default operator\. . .TP -\fB\-q \-\-quiet\fR +\-q, \-\-quiet Enable quiet mode\. . .TP -\fB\-h \-\-help\fR +\-h, \-\-help Show help\. . -.SH "OUTPUT" -To allow for easier parsing, Search will print results records in the same line when using one or more of the following options: \fB\-\-name\fR, \fB\-\-url\fR, \fB\-\-info\fR, \fB\-\-tags\fR, \fB\-\-author\fR\. +.SH "RESULTS" +Search prints results records in the same line, when using one or more of the following options: \-\-name, \-\-url, \-\-info, \-\-tags, \-\-author\. This allows you to parse search results easily\. . .IP "" 4 . @@ -108,9 +163,6 @@ shark;https://github\.com/fishery/shark;bucaran . .IP "" 0 . -.P -The result set above consists of single line per record, and each record consists of one or more of the specified fields separated by semicolons \fB\';\'\fR\. -. .SH "EXAMPLES" . .IP "\(bu" 4 @@ -159,7 +211,7 @@ fisher search \-\-and \-\-name!=(fisher \-\-list=bare) .IP "" 0 . .IP "\(bu" 4 -Search all plugins whose name does not start with the letter \fBs\fR\. +Search all plugins whose name does not start with the letter s\. . .IP "" 0 . @@ -172,12 +224,4 @@ fisher search \-\-name!~/^s/ .fi . .IP "" 0 -. -.SH "SEE ALSO" -\fBfisher\fR(1) -. -.br -\fBfisher help plugins\fR -. -.br diff --git a/man/man1/fisher-search.md b/man/man1/fisher-search.md index ea84d75..9cb926b 100644 --- a/man/man1/fisher-search.md +++ b/man/man1/fisher-search.md @@ -1,64 +1,99 @@ -fisher-search(1) -- Search Plugin Index +fisher-search(1) -- Search plugin index ======================================= ## SYNOPSIS -fisher `search` [*plugins* ...]
-fisher `search` [`--name|--url|--info|--tag|--author`]
-fisher `search` [`--query`=*field*[`&&`,`||`]*field*...]
-fisher `search` [`--format`=*oneline*|*short*|*verbose*|*longline*] [--no-color]
-fisher `search` [`--and`] [`--or`] [`--quiet`] [`--help`]
+fisher search [*plugins* ...]
+fisher search [--name|--url|--info|--tag|--author]
+fisher search [--and] [--or] [--quiet] [--help]
+fisher search [--long|--full] [--no-color]
+fisher search [--query=*field*[&&,||]*field*...]
## USAGE -fisher `search` *url*
-fisher `search` *name*
-fisher `search` *owner/repo*
-fisher `search` *query*
+fisher search *url*
+fisher search *name*
+fisher search *owner/repo*
+fisher search *query*
## DESCRIPTION Search plugins in the Fisherman index. -The index file consists of records plugin name and info. `*` is shown if plugin is installed. +``` +fisher search + ... +* debug Conditional debug logger + errno POSIX error code/string translator +* fishtape TAP producing test runner + flash Flash-inspired, thunder prompt + fzf Efficient keybindings for fzf + get Press any key to continue + ... +> shellder Powerline prompt optimized for speed + ... +``` + +Get detailed information about a plugin. + +``` +fisher search shellder +> shellder by simnalamburt +Powerline prompt optimized for speed +github.com/simnalamburt/shellder +``` -For example: +Search plugins using tags. ``` - name info +fisher search --tag={git,test} + ... +* fishtape TAP producing test runner + git-branch-name Get the name of the current Git branch + git-is-repo Test if the current directory is a Git repo + git-is-dirty Test if there are changes not staged for commit + git-is-stashed Test if there are changes in the stash + ... ``` -See *Index* in `fisher help tour` for more information about the index. +The legend consists of: + +`*` Indicate the plugin is currently installed
+`>` Indicate the plugin is a prompt
+`@` Indicate the plugin is a symbolic link
## OPTIONS -* `--[=match]`: - Display index records where *field* equals *match*. *field* can be any of `name`, `url`, `info`, `tag/s` or `author`. If *match* is not given, display only the given *field* from every record in the index. Use `!=` to negate the query. +* --*field*[=*match*]: + Display index records where *field* equals *match*. *field* can be any of name, url, info, tag/s or author. If *match* is not given, display only the given *field* from every record in the index. Use != to negate the query. + +* --*field*[~/regex/]: + Same as --*field*[=*match*], but using Regular Expressions. Use !~ to negate the query. -* `--[~/regex/]`: - Same as `--[=regex]`, but using Regular Expressions instead of exact matching. Use `!~` to negate the query. +* --long: + Display results in long format. -* `--format=oneline|short|verbose|longline`: - Use the given format to display search results. +* --full: + Display results in full format. -* `--no-color`: +* --no-color: Turn off color display. -* `-a --and`: +* -a, --and: Join the query with a logical AND operator. -* `-o --or`: +* -o, --or: Join the query with a logical OR operator. This is the default operator. -* `-q --quiet`: +* -q, --quiet: Enable quiet mode. -* `-h --help`: +* -h, --help: Show help. -## OUTPUT +## RESULTS -To allow for easier parsing, Search will print results records in the same line when using one or more of the following options: `--name`, `--url`, `--info`, `--tags`, `--author`. +Search prints results records in the same line, when using one or more of the following options: --name, --url, --info, --tags, --author. This allows you to parse search results easily. ```fish fisher search shark --name --url --author @@ -66,8 +101,6 @@ fisher search shark --name --url --author shark;https://github.com/fishery/shark;bucaran ``` -The result set above consists of single line per record, and each record consists of one or more of the specified fields separated by semicolons `';'`. - ## EXAMPLES * Display plugins by name and format the result into multiple columns. @@ -88,13 +121,8 @@ fisher search --url | sed 's|https://github.com/||' | column fisher search --and --name!=(fisher --list=bare) ``` -* Search all plugins whose name does not start with the letter `s`. +* Search all plugins whose name does not start with the letter s. ```fish fisher search --name!~/^s/ ``` - -## SEE ALSO - -`fisher`(1)
-`fisher help plugins`
diff --git a/man/man1/fisher-uninstall.1 b/man/man1/fisher-uninstall.1 index c045112..b930194 100644 --- a/man/man1/fisher-uninstall.1 +++ b/man/man1/fisher-uninstall.1 @@ -4,51 +4,51 @@ .TH "FISHER\-UNINSTALL" "1" "February 2016" "" "fisherman" . .SH "NAME" -\fBfisher\-uninstall\fR \- Uninstall Plugins +\fBfisher\-uninstall\fR \- Uninstall plugins . .SH "SYNOPSIS" -fisher \fBuninstall\fR [\fIplugins\fR \.\.\.] +fisher uninstall [\fIplugins\fR \.\.\.] . .br -fisher \fBuninstall\fR [\fB\-\-force\fR] [\fB\-\-quiet\fR] [\fB\-\-help\fR] +fisher uninstall [\-\-force] [\-\-quiet] [\-\-help] . .br . .SH "USAGE" -fisher \fBuninstall\fR \fIurl\fR \.\.\. +fisher uninstall \fIurl\fR . .br -fisher \fBuninstall\fR \fIname\fR \.\.\. +fisher uninstall \fIname\fR . .br -fisher \fBuninstall\fR \fIpath\fR \.\.\. +fisher uninstall \fIpath\fR . .br -fisher \fBuninstall\fR \fIowner/repo\fR \.\.\. +fisher uninstall \fIowner/repo\fR . .br . .SH "DESCRIPTION" -Uninstall one or more plugins, by name, URL or a local path\. If no arguments are given, read the standard input\. This process is the inverse of Install\. See \fBfisher help install\fR\. +Uninstall one or more plugins, by name, URL or path\. If no arguments are given, read the standard input\. This process is the inverse of Install\. . .P -Uninstall does not remove any copies of the given plugin in \fB$fisher_cache\fR\. To erase the copy from the cache, use the \fB\-\-force\fR option\. +Uninstall does not remove any copies of the given plugin in $fisher_cache\. To erase the copy from the cache, use the \-\-force option\. . .P -Uninstall does not remove any dependencies installed with other plugins\. This behavior prevents breaking plugins that share the same dependency\. See \fBFlat Tree\fR in \fBfisher help tour\fR\. +Uninstall does not remove any dependencies installed with other plugins\. This behavior prevents breaking plugins that share the same dependency\. . .SH "OPTIONS" . .TP -\fB\-f \-\-force\fR +\-f, \-\-force Delete copy from cache\. . .TP -\fB\-q \-\-quiet\fR +\-q, \-\-quiet Enable quiet mode\. . .TP -\fB\-h \-\-help\fR +\-h, \-\-help Show usage help\. . .SH "EXAMPLES" @@ -69,10 +69,7 @@ fisher \-\-list | fisher uninstall \-\-force .IP "" 0 . .SH "SEE ALSO" -\fBfisher\fR(1) -. -.br -\fBfisher help plugins\fR +fisher help install . .br diff --git a/man/man1/fisher-uninstall.md b/man/man1/fisher-uninstall.md index 5ec228f..210c106 100644 --- a/man/man1/fisher-uninstall.md +++ b/man/man1/fisher-uninstall.md @@ -1,35 +1,35 @@ -fisher-uninstall(1) -- Uninstall Plugins +fisher-uninstall(1) -- Uninstall plugins ======================================== ## SYNOPSIS -fisher `uninstall` [*plugins* ...]
-fisher `uninstall` [`--force`] [`--quiet`] [`--help`]
+fisher uninstall [*plugins* ...]
+fisher uninstall [--force] [--quiet] [--help]
## USAGE -fisher `uninstall` *url* ...
-fisher `uninstall` *name* ...
-fisher `uninstall` *path* ...
-fisher `uninstall` *owner/repo* ...
+fisher uninstall *url*
+fisher uninstall *name*
+fisher uninstall *path*
+fisher uninstall *owner/repo*
## DESCRIPTION -Uninstall one or more plugins, by name, URL or a local path. If no arguments are given, read the standard input. This process is the inverse of Install. See `fisher help install`. +Uninstall one or more plugins, by name, URL or path. If no arguments are given, read the standard input. This process is the inverse of Install. -Uninstall does not remove any copies of the given plugin in `$fisher_cache`. To erase the copy from the cache, use the `--force` option. +Uninstall does not remove any copies of the given plugin in $fisher_cache. To erase the copy from the cache, use the --force option. -Uninstall does not remove any dependencies installed with other plugins. This behavior prevents breaking plugins that share the same dependency. See `Flat Tree` in `fisher help tour`. +Uninstall does not remove any dependencies installed with other plugins. This behavior prevents breaking plugins that share the same dependency. ## OPTIONS -* `-f --force`: +* -f, --force: Delete copy from cache. -* `-q --quiet`: +* -q, --quiet: Enable quiet mode. -* `-h --help`: +* -h, --help: Show usage help. ## EXAMPLES @@ -42,5 +42,4 @@ fisher --list | fisher uninstall --force ## SEE ALSO -`fisher`(1)
-`fisher help plugins`
+fisher help install
diff --git a/man/man1/fisher-update.1 b/man/man1/fisher-update.1 index 911c57e..2cb5509 100644 --- a/man/man1/fisher-update.1 +++ b/man/man1/fisher-update.1 @@ -4,50 +4,47 @@ .TH "FISHER\-UPDATE" "1" "February 2016" "" "fisherman" . .SH "NAME" -\fBfisher\-update\fR \- Update Fisherman and Plugins +\fBfisher\-update\fR \- Update plugins . .SH "SYNOPSIS" -fisher \fBupdate\fR [\fIplugins\fR \.\.\.] [\fB\-\-quiet\fR] [\fB\-\-help\fR] +fisher update [\fIplugins\fR \.\.\.] [\-\-quiet] [\-\-help] . .br . .SH "USAGE" -fisher \fBupdate\fR \fIurl\fR \.\.\. +fisher update \fIurl\fR \.\.\. . .br -fisher \fBupdate\fR \fIname\fR \.\.\. +fisher update \fIname\fR \.\.\. . .br -fisher \fBupdate\fR \fIpath\fR \.\.\. +fisher update \fIpath\fR \.\.\. . .br -fisher \fBupdate\fR \fIowner/repo\fR \.\.\. +fisher update \fIowner/repo\fR \.\.\. . .br . .SH "DESCRIPTION" -Update one or more plugins, by name, URL or a local path\. If no arguments are given, update Fisherman to the latest release\. If you try to update a plugin that is currently disabled, but present in the cache, it will be updated and then enabled\. Use a dash \fB\-\fR to read from the standard input\. +Update one or more plugins, by name, URL or path\. If no arguments are given, update Fisherman to the latest release\. If you try to update a plugin that is currently disabled, but exists in the cache, it will be updated and then enabled\. Use a dash \fB\-\fR to read from the standard input\. . .P -One exception to the process described above is updating a prompt which is not the current one\. In this case the repository is updated, but it will not be activated as that is probably not what the user wants\. -. -.P -If a plugin is missing dependencies, they will be installed\. If any dependencies are already installed they will not be updated\. See \fBPlugins\fR in \fBfisher help fishfile\fR\. +If a plugin is missing dependencies, they will be installed\. If any dependencies are already installed they will not be updated\. . .SH "OPTIONS" . .TP -\fB\-q \-\-quiet\fR +\-q, \-\-quiet Enable quiet mode\. . .TP -\fB\-h \-\-help\fR +\-h, \-\-help Show usage help\. . .SH "EXAMPLES" . .IP "\(bu" 4 -Update Fisherman +Update Fisherman\. . .IP "" 0 . @@ -62,7 +59,7 @@ fisher update .IP "" 0 . .IP "\(bu" 4 -Update all the plugins in the cache \fIconcurrently\fR\. +Update all the plugins in the cache\. . .IP "" 0 . @@ -70,17 +67,24 @@ Update all the plugins in the cache \fIconcurrently\fR\. . .nf -fisher \-\-list | cut \-c 2\- | xargs \-n1 \-P0 fish \-c \'fisher update\' +fisher list | fisher update \- . .fi . .IP "" 0 . -.SH "SEE ALSO" -\fBfisher\fR(1) +.IP "\(bu" 4 +Update all the plugins in the cache concurrently\. . -.br -\fBfisher help plugins\fR +.IP "" 0 . -.br +.IP "" 4 +. +.nf + +fisher list \-\-bare | xargs \-n1 \-P0 fish \-c "fisher update \-" +. +.fi +. +.IP "" 0 diff --git a/man/man1/fisher-update.md b/man/man1/fisher-update.md index 5f3a661..78f432a 100644 --- a/man/man1/fisher-update.md +++ b/man/man1/fisher-update.md @@ -1,48 +1,47 @@ -fisher-update(1) -- Update Fisherman and Plugins -================================================ +fisher-update(1) -- Update plugins +================================== ## SYNOPSIS -fisher `update` [*plugins* ...] [`--quiet`] [`--help`]
+fisher update [*plugins* ...] [--quiet] [--help]
## USAGE -fisher `update` *url* ...
-fisher `update` *name* ...
-fisher `update` *path* ...
-fisher `update` *owner/repo* ...
+fisher update *url* ...
+fisher update *name* ...
+fisher update *path* ...
+fisher update *owner/repo* ...
## DESCRIPTION -Update one or more plugins, by name, URL or a local path. If no arguments are given, update Fisherman to the latest release. If you try to update a plugin that is currently disabled, but present in the cache, it will be updated and then enabled. Use a dash `-` to read from the standard input. +Update one or more plugins, by name, URL or path. If no arguments are given, update Fisherman to the latest release. If you try to update a plugin that is currently disabled, but exists in the cache, it will be updated and then enabled. Use a dash `-` to read from the standard input. -One exception to the process described above is updating a prompt which is not the current one. In this case the repository is updated, but it will not be activated as that is probably not what the user wants. - -If a plugin is missing dependencies, they will be installed. If any dependencies are already installed they will not be updated. See `Plugins` in `fisher help fishfile`. +If a plugin is missing dependencies, they will be installed. If any dependencies are already installed they will not be updated. ## OPTIONS -* `-q --quiet`: +* -q, --quiet: Enable quiet mode. -* `-h --help`: +* -h, --help: Show usage help. ## EXAMPLES -* Update Fisherman +* Update Fisherman. ```fish fisher update ``` -* Update all the plugins in the cache *concurrently*. +* Update all the plugins in the cache. ```fish -fisher --list | cut -c 2- | xargs -n1 -P0 fish -c 'fisher update' +fisher list | fisher update - ``` -## SEE ALSO +* Update all the plugins in the cache concurrently. -`fisher`(1)
-`fisher help plugins`
+```fish +fisher list --bare | xargs -n1 -P0 fish -c "fisher update -" +``` diff --git a/man/man1/fisher.1 b/man/man1/fisher.1 index fa4e7e1..5755a4e 100644 --- a/man/man1/fisher.1 +++ b/man/man1/fisher.1 @@ -4,39 +4,58 @@ .TH "FISHER" "1" "February 2016" "" "fisherman" . .SH "NAME" -\fBfisher\fR \- Fish Plugin Manager +\fBfisher\fR \- Fish plugin manager . .SH "SYNOPSIS" -\fBfisher\fR \fIcommand\fR [\fIoptions\fR] [\fB\-\-version\fR] [\fB\-\-help\fR] -. -.br -\fBfisher\fR \fB\-\-list[=bare|url|all|enabled|disabled|theme|file]\fR +fisher \fIcommand\fR [\fIarguments\fR] [\-\-version] [\-\-help] . .br . .SH "DESCRIPTION" -Fisherman is a blazing fast, modern plugin manager for \fBfish\fR(1)\. +Fisherman is a plugin manager for fish\. . .P -The following commands are available: \fIinstall\fR, \fIuninstall\fR, \fIupdate\fR, \fIsearch\fR and \fIhelp\fR\. See \fBfisher help \fR for information about each command\. +The Fisherman CLI consists of the following commands: \fIinstall\fR, \fIupdate\fR, \fIuninstall\fR, \fIlist\fR, \fIsearch\fR and \fIhelp\fR\. . -.SH "OPTIONS" +.SH "USAGE" +Run a command\. . -.TP -\fB\-l \-\-list[=bare|url|all|enabled|disabled|theme|file]\fR -List local plugins according to a given option\. Plugins are prepended with a legend character to indicate their kind\. \fB*\fR for enabled plugins, \fB>\fR for the currently enabled prompt and \fB|\fR for symbolic links\. To list plugins without the legend use \fB\-\-list=bare\fR\. Use a dash \fB\-\fR to read from the standard input\. +.IP "" 4 +. +.nf + +fisher [] +. +.fi +. +.IP "" 0 +. +.P +Get help about a command\. +. +.IP "" 4 +. +.nf + +fisher help +. +.fi +. +.IP "" 0 +. +.P +Fisherman knows the following aliases by default: \fIi\fR for install, \fIu\fR for update, \fIl\fR for list, \fIs\fR for search and \fIh\fR for help\. +. +.SH "OPTIONS" . .TP \fB\-v \-\-version\fR -Show version information\. Fisherman\'s current version can be found in the VERSION file at the root of the project\. The version scheme is based in \fBSemantic Versioning\fR and uses Git annotated tags to track each release\. +Show version information\. Fisherman follows \fBSemantic Versioning\fR and uses Git annotated tags to track releases\. . .TP \fB\-h \-\-help\fR Show usage help\. . -.SH "CUSTOM COMMANDS" -A Fisherman command is a regular function that can be invoked using the \fBfisher\fR command\. By convention, any function like \fBfisher_\fR is recognized as a Fisherman command\. You can create plugins that add new commands this way\. See \fBfisher help commands\fR and \fBfisher help plugins\fR for more information\. -. .SH "EXAMPLES" . .IP "\(bu" 4 @@ -55,7 +74,7 @@ fisher install fishtape shark get .IP "" 0 . .IP "\(bu" 4 -Install plugins from a \fIfishfile\fR or bundle\. +Install a plugin as a symbolic link\. . .IP "" 0 . @@ -63,14 +82,14 @@ Install plugins from a \fIfishfile\fR or bundle\. . .nf -fisher \-\-list=path/to/bundle | fisher install +fisher install \./path/to/plugin . .fi . .IP "" 0 . .IP "\(bu" 4 -Install a plugin if inside a plugin project\. +Update Fisherman to the latest version\. . .IP "" 0 . @@ -78,20 +97,212 @@ Install a plugin if inside a plugin project\. . .nf -fisher install \. +fisher update . .fi . .IP "" 0 . +.IP "\(bu" 4 +Search the Fisherman index\. +. +.IP "" 0 +. +.IP "" 4 +. +.nf + +fisher search +. +.fi +. +.IP "" 0 +. +.IP "\(bu" 4 +Show all the documentation\. +. +.IP "" 0 +. +.IP "" 4 +. +.nf + +fisher help \-\-all +. +.fi +. +.IP "" 0 +. +.SH "CONCEPTS" +. +.SS "FLAT TREE" +Fisherman merges the directory trees of all the plugins it installs into a single flat tree\. Since the flat tree is loaded only once at the start of the shell, Fisherman performs equally well, regardless of the number of plugins installed\. +. +.P +The following illustrates an example Fisherman configuration path with a single plugin and prompt\. +. +.IP "" 4 +. +.nf + +$fisher_config +|\-\- cache/ +|\-\- conf\.d/ +| `\-\- my_plugin\.config\.fish +|\-\- fishfile +|\-\- functions/ +| |\-\- my_plugin\.fish +| |\-\- fish_prompt\.fish +| `\-\- fish_right_prompt\.fish +|\-\- completions/ +| `\-\- my_plugin\.fish +`\-\- man/ + `\-\- man1/ + `\-\- my_plugin\.1 +. +.fi +. +.IP "" 0 +. +.SS "PLUGINS" +To install plugins, type fisher install and press \fItab\fR once to list all the available plugins\. Similarly, use fisher update / uninstall and press \fItab\fR to see what plugins you can update or uninstall\. +. +.P +To search plugins use fisher search \fIname\fR\. You can by a specific field using fisher search \-\-\fIfield\fR=\fImatch\fR\. +. +.IP "" 4 +. +.nf + +fisher search \-\-tag={*keywords*} +. +.fi +. +.IP "" 0 +. +.P +or +. +.IP "" 4 +. +.nf + +fisher search \-\-name=*name* +. +.fi +. +.IP "" 0 +. +.P +See fisher help search for advanced options\. +. +.P +To learn how to create plugins enter fisher help tutorial\. +. +.SS "INDEX" +The index is a plain text database that lists Fisherman official plugins\. +. +.P +The index is a list of records, each consisting of the following fields: \fIname\fR, \fIurl\fR, \fIinfo\fR, one or more \fItags\fR and \fIauthor\fR\. +. +.P +Fields are separated by a new line \fB\en\fR\. Tags are separated by one \fIspace\fR\. +. +.IP "" 4 +. +.nf + +z +https://github\.com/fishery/fish\-z +Pure\-fish z directory jumping +z search cd jump +jethrokuan +. +.fi +. +.IP "" 0 +. +.P +If you have a plugin you would like to submit to the index, use the submit plugin\. +. +.IP "" 4 +. +.nf + +fisher install submit +fisher submit my_plugin +. +.fi +. +.IP "" 0 +. +.P +Otherwise, submit the plugin manually by creating a pull request in the index repository \fIhttps://github\.com/fisherman/fisher\-index\fR\. +. +.IP "" 4 +. +.nf + +git clone https://github\.com/fisherman/fisher\-index +cd index +echo "$name\en$url\en$info\en$tags\en$author\en\en" >> index +git push origin master +. +.fi +. +.IP "" 0 +. +.SS "FISHFILE" +Fisherman keeps track of a special file known as \fIfishfile\fR to know what plugins are currently enabled\. +. +.IP "" 4 +. +.nf + +# My Fishfile +gitio +fishtape +shark +get +shellder +. +.fi +. +.IP "" 0 +. +.P +This file is automatically updated as you install and uninstall plugins\. +. +.SS "VARIABLES" +. +.TP +$fisher_home +The home directory\. If you installed Fisherman using the recommended method \fBcurl \-sL install\.fisherman\.sh | fish\fR, the location ought to be \fIXDG_DATA_HOME/fisherman\fR\. If you clone Fisherman and run make yourself, the current working directory is used by default\. +. +.TP +$fisher_config +The configuration directory\. This is default location of the \fIfishfile\fR, \fIkey_bindings\.fish\fR, \fIcache\fR, \fIfunctions\fR, \fIcompletions\fR and \fIconf\.d\fR directories\. The default location is \fIXDG_CONFIG_HOME/fisherman\fR\. +. +.TP +$fisher_file +See FISHFILE above\. +. +.TP +$fisher_cache +The cache directory\. Plugins are downloaded to this location\. +. +.TP +$fisher_alias \fIcommand\fR=\fIalias\fR[,\fIalias2\fR] \.\.\. +Use this variable to customize Fisherman command aliases\. +. .SH "AUTHORS" -Fisherman was created by Jorge Bucaran \fIj@bucaran\.me\fR\. +Fisherman was created by Jorge Bucaran :: @bucaran :: \fIj@bucaran\.me\fR\. . .P -See THANKS\.md file for the complete list of contributors\. +See THANKS\.md file for a complete list of contributors\. . .SH "SEE ALSO" -\fBfisher help tour\fR +fisher help tutorial . .br diff --git a/man/man1/fisher.md b/man/man1/fisher.md index 07697b4..e97f80f 100644 --- a/man/man1/fisher.md +++ b/man/man1/fisher.md @@ -1,31 +1,39 @@ -fisher(1) -- Fish Plugin Manager +fisher(1) -- Fish plugin manager ================================ ## SYNOPSIS -`fisher` *command* [*options*] [`--version`] [`--help`]
-`fisher` `--list[=bare|url|all|enabled|disabled|theme|file]`
+fisher *command* [*arguments*] [--version] [--help]
## DESCRIPTION -Fisherman is a blazing fast, modern plugin manager for `fish`(1). +Fisherman is a plugin manager for fish. -The following commands are available: *install*, *uninstall*, *update*, *search* and *help*. See `fisher help ` for information about each command. +The Fisherman CLI consists of the following commands: *install*, *update*, *uninstall*, *list*, *search* and *help*. -## OPTIONS +## USAGE -* `-l --list[=bare|url|all|enabled|disabled|theme|file]`: - List local plugins according to a given option. Plugins are prepended with a legend character to indicate their kind. `*` for enabled plugins, `>` for the currently enabled prompt and `|` for symbolic links. To list plugins without the legend use `--list=bare`. Use a dash `-` to read from the standard input. +Run a command. -* `-v --version`: - Show version information. Fisherman's current version can be found in the VERSION file at the root of the project. The version scheme is based in `Semantic Versioning` and uses Git annotated tags to track each release. +``` +fisher [] +``` -* `-h --help`: - Show usage help. +Get help about a command. -## CUSTOM COMMANDS +``` +fisher help +``` + +Fisherman knows the following aliases by default: *i* for install, *u* for update, *l* for list, *s* for search and *h* for help. + +## OPTIONS -A Fisherman command is a regular function that can be invoked using the `fisher` command. By convention, any function like `fisher_` is recognized as a Fisherman command. You can create plugins that add new commands this way. See `fisher help commands` and `fisher help plugins` for more information. +* -v, --version: + Show version information. Fisherman follows Semantic Versioning and uses Git annotated tags to track releases. + +* -h, --help: + Show usage help. ## EXAMPLES @@ -35,24 +43,145 @@ A Fisherman command is a regular function that can be invoked using the `fisher` fisher install fishtape shark get ``` -* Install plugins from a *fishfile* or bundle. +* Install a plugin as a symbolic link. + +```fish +fisher install ./path/to/plugin +``` + +* Update Fisherman to the latest version. ```fish -fisher --list=path/to/bundle | fisher install +fisher update ``` -* Install a plugin if inside a plugin project. +* Search the Fisherman index. ```fish -fisher install . +fisher search ``` +* Show all the documentation. + +```fish +fisher help --all +``` + +## CONCEPTS + +### FLAT TREE + +Fisherman merges the directory trees of all the plugins it installs into a single flat tree. Since the flat tree is loaded only once at the start of the shell, Fisherman performs equally well, regardless of the number of plugins installed. + +The following illustrates an example Fisherman configuration path with a single plugin and prompt. + +``` +$fisher_config +|-- cache/ +|-- conf.d/ +| `-- my_plugin.config.fish +|-- fishfile +|-- functions/ +| |-- my_plugin.fish +| |-- fish_prompt.fish +| `-- fish_right_prompt.fish +|-- completions/ +| `-- my_plugin.fish +`-- man/ + `-- man1/ + `-- my_plugin.1 +``` + +### PLUGINS + +To install plugins, type fisher install and press *tab* once to list all the available plugins. Similarly, use fisher update / uninstall and press *tab* to see what plugins you can update or uninstall. + +To search plugins use fisher search *name*. You can by a specific field using fisher search --*field*=*match*. + +```fish +fisher search --tag={*keywords*} +``` + +or + +```fish +fisher search --name=*name* +``` + +See fisher help search for advanced options. + +To learn how to create plugins enter fisher help tutorial. + +### INDEX + +The index is a plain text database that lists Fisherman official plugins. + +The index is a list of records, each consisting of the following fields: *name*, *url*, *info*, one or more *tags* and *author*. + +Fields are separated by a new line `\n`. Tags are separated by one *space*. + +``` +z +https://github.com/fishery/fish-z +Pure-fish z directory jumping +z search cd jump +jethrokuan +``` + +If you have a plugin you would like to submit to the index, use the submit plugin. + +``` +fisher install submit +fisher submit my_plugin +``` + +Otherwise, submit the plugin manually by creating a pull request in the index repository *https://github.com/fisherman/fisher-index*. + +``` +git clone https://github.com/fisherman/fisher-index +cd index +echo "$name\n$url\n$info\n$tags\n$author\n\n" >> index +git push origin master +``` + +### FISHFILE + +Fisherman keeps track of a special file known as *fishfile* to know what plugins are currently enabled. + +``` +# My Fishfile +gitio +fishtape +shark +get +shellder +``` + +This file is automatically updated as you install and uninstall plugins. + +### VARIABLES + +* $fisher_home: + The home directory. If you installed Fisherman using the recommended method `curl -sL install.fisherman.sh | fish`, the location ought to be *XDG_DATA_HOME/fisherman*. If you clone Fisherman and run make yourself, the current working directory is used by default. + +* $fisher_config: + The configuration directory. This is default location of the *fishfile*, *key_bindings.fish*, *cache*, *functions*, *completions* and *conf.d* directories. The default location is *XDG_CONFIG_HOME/fisherman*. + +* $fisher_file: + See FISHFILE above. + +* $fisher_cache: + The cache directory. Plugins are downloaded to this location. + +* $fisher_alias *command*=*alias*[,*alias2*] ...: + Use this variable to customize Fisherman command aliases. + ## AUTHORS -Fisherman was created by Jorge Bucaran *j@bucaran.me*. +Fisherman was created by Jorge Bucaran :: @bucaran :: *j@bucaran.me*. -See THANKS.md file for the complete list of contributors. +See THANKS.md file for a complete list of contributors. ## SEE ALSO -`fisher help tour`
+fisher help tutorial
diff --git a/man/man5/fisher-fishfile.5 b/man/man5/fisher-fishfile.5 deleted file mode 100644 index 5aaad4a..0000000 --- a/man/man5/fisher-fishfile.5 +++ /dev/null @@ -1,59 +0,0 @@ -.\" generated with Ronn/v0.7.3 -.\" http://github.com/rtomayko/ronn/tree/0.7.3 -. -.TH "FISHER\-FISHFILE" "5" "February 2016" "" "fisherman" -. -.SH "NAME" -\fBfisher\-fishfile\fR \- Fishfile Format -. -.SH "SYNOPSIS" -Fishfiles let you share plugin configurations across multiple installations, let plugins declare dependencies and teach Fisherman what plugins are currently enabled / disabled when using \fBfisher \-\-list\fR\. -. -.P -Your fishfile is stored in \fB$fisher_config/fishfile\fR by default, but you can customize this location overriding the \fB$fisher_file\fR variable in your fish configuration file\. -. -.SH "USAGE" -Fishfiles list one or more plugins by their name, URL or path to a local project\. -. -.P -Here is an example: -. -.IP "" 4 -. -.nf - -# Ahoy! - -gitio -fishtape -shark -get -some_user/her_plugin -. -.fi -. -.IP "" 0 -. -.P -A fishfile may contain any amount of whitespace and comments\. -. -.P -If you need to parse a fishfile to list its plugins, for example, to pipe the input into \fBfisher install\fR or \fBfisher update\fR, you can use \fBfisher \-\-list=path/to/fishfile\fR\. Notice that Oh My Fish! bundle file syntax is also supported\. -. -.SH "PLUGINS" -Plugins may list any number of dependencies to other plugins in a fishfile at the root of the project\. -. -.P -When a plugin is installed, its dependencies are downloaded for the first time\. If a dependency is already installed, it is not updated in order to prevent breaking other plugins using a different version\. Currently, uninstalling a plugin does not remove any its dependencies either\. -. -.P -To understand this behavior, it helps to recall the shell\'s single scope for functions\. The lack of private functions means that, it is \fInot\fR possible to single\-lock a specific dependency version\. See also \fBFlat Tree\fR in \fBfisher help tour\fR\. -. -.SH "SEE ALSO" -\fBfisher\fR(1) -. -.br -\fBfisher help config\fR -. -.br - diff --git a/man/man5/fisher-fishfile.md b/man/man5/fisher-fishfile.md deleted file mode 100644 index 8265311..0000000 --- a/man/man5/fisher-fishfile.md +++ /dev/null @@ -1,41 +0,0 @@ -fisher-fishfile(5) -- Fishfile Format -===================================== - -## SYNOPSIS - -Fishfiles let you share plugin configurations across multiple installations, let plugins declare dependencies and teach Fisherman what plugins are currently enabled / disabled when using `fisher --list`. - -Your fishfile is stored in `$fisher_config/fishfile` by default, but you can customize this location overriding the `$fisher_file` variable in your fish configuration file. - -## USAGE - -Fishfiles list one or more plugins by their name, URL or path to a local project. - -Here is an example: - -``` -# Ahoy! - -gitio -fishtape -shark -get -some_user/her_plugin -``` - -A fishfile may contain any amount of whitespace and comments. - -If you need to parse a fishfile to list its plugins, for example, to pipe the input into `fisher install` or `fisher update`, you can use `fisher --list=path/to/fishfile`. Notice that Oh My Fish! bundle file syntax is also supported. - -## PLUGINS - -Plugins may list any number of dependencies to other plugins in a fishfile at the root of the project. - -When a plugin is installed, its dependencies are downloaded for the first time. If a dependency is already installed, it is not updated in order to prevent breaking other plugins using a different version. Currently, uninstalling a plugin does not remove any its dependencies either. - -To understand this behavior, it helps to recall the shell's single scope for functions. The lack of private functions means that, it is *not* possible to single-lock a specific dependency version. See also `Flat Tree` in `fisher help tour`. - -## SEE ALSO - -`fisher`(1)
-`fisher help config`
diff --git a/man/man5/fisher-fishfiles.5 b/man/man5/fisher-fishfiles.5 deleted file mode 120000 index b72cf91..0000000 --- a/man/man5/fisher-fishfiles.5 +++ /dev/null @@ -1 +0,0 @@ -fisher-fishfile.5 \ No newline at end of file diff --git a/man/man7/fisher-commands.7 b/man/man7/fisher-commands.7 deleted file mode 100644 index 57baeaf..0000000 --- a/man/man7/fisher-commands.7 +++ /dev/null @@ -1,106 +0,0 @@ -.\" 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_\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" -\fBfisher\fR(1), \fBfuncsave\fR(1) -. -.br -\fBfisher help tour\fR -. -.br -\fBfisher help plugins\fR -. -.br - diff --git a/man/man7/fisher-commands.md b/man/man7/fisher-commands.md deleted file mode 100644 index c1ff609..0000000 --- a/man/man7/fisher-commands.md +++ /dev/null @@ -1,64 +0,0 @@ -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 using the `fisher` CLI, for example: - -```fish -fisher my_command [*options*] -``` - -## DESCRIPTION - -To add a command, create a function `fisher_`: - -```fish -function fisher_hello -d "Hello, how are you?" - echo hello -end -``` - -Test it works: `fisher hello`. - -To make this function available to future fish sessions, add it to `$XDG_CONFIG_HOME/fish/functions`: - -```fish -funcsave fisher_hello -``` - -You can also create a local plugin and install it with Fisherman: - -```fish -mkdir fisher_hello -cd fisher_hello -functions fisher_hello > fisher_hello.fish -fisher install . -``` - -The method described above will create a symbolic link to the `fisher_hello` directory and `fisher_hello.fish` inside `$fisher_config/functions`. - -## EXAMPLES - -The following example implements a command to retrieve plugin information and format the output into columns. - -```fish -function fisher_info -d "Display information about plugins" - switch "$argv" - case -h --help - printf "Usage: fisher info name | URL [...]\n\n" - printf " -h --help Show usage help\n" - return - end - - for item in $argv - fisher search $item --name --info - end | sed -E 's/;/: /' | column -end -``` - -## SEE ALSO - -`fisher`(1), `funcsave`(1)
-`fisher help tour`
-`fisher help plugins`
diff --git a/man/man7/fisher-config.7 b/man/man7/fisher-config.7 deleted file mode 100644 index 21cfa52..0000000 --- a/man/man7/fisher-config.7 +++ /dev/null @@ -1,62 +0,0 @@ -.\" generated with Ronn/v0.7.3 -.\" http://github.com/rtomayko/ronn/tree/0.7.3 -. -.TH "FISHER\-CONFIG" "7" "February 2016" "" "fisherman" -. -.SH "NAME" -\fBfisher\-config\fR \- Fisherman Configuration -. -.SH "SYNOPSIS" -This document describes how to use Fisherman configuration variables\. -. -.SH "DESCRIPTION" -Your fish user configuration, usually located in \fB$XDG_CONFIG_HOME/fish/config\.fish\fR is updated after installing Fisherman to add the global variables \fB$fisher_home\fR and \fB$fisher_config\fR\. -. -.P -Using the following variables, you can customize the locations of the cache, index URL, fishfile, create command aliases, etc\. -. -.SH "VARIABLES" -. -.TP -\fB$fisher_home\fR -The home directory\. If you installed Fisherman using the recommended method \fBcurl \-sL install\.fisherman\.sh | fish\fR, the location will be \fB$XDG_DATA_HOME/fisherman\fR\. If you clone Fisherman and run \fBmake\fR yourself, \fB$fisher_home\fR will the current working directory\. -. -.TP -\fB$fisher_config\fR -The user configuration directory\. This is default location of your user \fIfishfile\fR, Fisherman \fIkey_bindings\.fish\fR file and the \fIcache\fR, \fIfunctions\fR, \fIcompletions\fR and \fIconf\.d\fR directories\. \fB$XDG_CONFIG_HOME/fisherman\fR by default\. -. -.TP -\fB$fisher_file\fR -This file keeps a list of what plugins you have installed and are currently enabled\. \fB$fisher_config/fishfile\fR by default\. See \fBfisher help fishfile\fR for details\. -. -.TP -\fB$fisher_cache\fR -The cache directory\. Plugins are downloaded first here and installed to \fB$fisher_config/functions\fR afterwards\. The cache is \fB$fisher_config/cache\fR by default\. -. -.TP -\fB$fisher_index\fR -The URL to the index database\. To use a different index set this to a file or URL\. Redirect URLs are currently not supported due to security and performance concerns\. The underlying request and fetch mechanism is based in \fBcurl\fR(1)\. -. -.TP -\fB$fisher_alias command=alias[,\.\.\.] [command2=alias[,\.\.\.]]\fR -Use this variable to define custom aliases for fisher commands\. See \fBExamples\fR below\. -. -.SH "EXAMPLES" -. -.IP "\(bu" 4 -Create aliases for fisher \fBinstall\fR to \fIi\fR, \fIin\fR and \fIinst\fR; and for fisher \fBupdate\fR to \fIup\fR\. -. -.IP "" 0 -. -.IP "" 4 -. -.nf - -set fisher_alias install=i,in,inst update=up -. -.fi -. -.IP "" 0 -. -.SH "SEE ALSO" -\fBfisher help tour\fR diff --git a/man/man7/fisher-config.md b/man/man7/fisher-config.md deleted file mode 100644 index d00b6f5..0000000 --- a/man/man7/fisher-config.md +++ /dev/null @@ -1,44 +0,0 @@ -fisher-config(7) -- Fisherman Configuration -=========================================== - -## SYNOPSIS - -This document describes how to use Fisherman configuration variables. - -## DESCRIPTION - -Your fish user configuration, usually located in `$XDG_CONFIG_HOME/fish/config.fish` is updated after installing Fisherman to add the global variables `$fisher_home` and `$fisher_config`. - -Using the following variables, you can customize the locations of the cache, index URL, fishfile, create command aliases, etc. - -## VARIABLES - -* `$fisher_home`: - The home directory. If you installed Fisherman using the recommended method `curl -sL install.fisherman.sh | fish`, the location will be `$XDG_DATA_HOME/fisherman`. If you clone Fisherman and run `make` yourself, `$fisher_home` will the current working directory. - -* `$fisher_config`: - The user configuration directory. This is default location of your user *fishfile*, Fisherman *key_bindings.fish* file and the *cache*, *functions*, *completions* and *conf.d* directories. `$XDG_CONFIG_HOME/fisherman` by default. - -* `$fisher_file`: - This file keeps a list of what plugins you have installed and are currently enabled. `$fisher_config/fishfile` by default. See `fisher help fishfile` for details. - -* `$fisher_cache`: - The cache directory. Plugins are downloaded first here and installed to `$fisher_config/functions` afterwards. The cache is `$fisher_config/cache` by default. - -* `$fisher_index`: - The URL to the index database. To use a different index set this to a file or URL. Redirect URLs are currently not supported due to security and performance concerns. The underlying request and fetch mechanism is based in `curl`(1). - -* `$fisher_alias command=alias[,...] [command2=alias[,...]]`: - Use this variable to define custom aliases for fisher commands. See `Examples` below. - -## EXAMPLES - -* Create aliases for fisher `install` to *i*, *in* and *inst*; and for fisher `update` to *up*. - -``` -set fisher_alias install=i,in,inst update=up -``` - -## SEE ALSO - -`fisher help tour` diff --git a/man/man7/fisher-faq.7 b/man/man7/fisher-faq.7 deleted file mode 100644 index 589e06d..0000000 --- a/man/man7/fisher-faq.7 +++ /dev/null @@ -1,180 +0,0 @@ -.\" generated with Ronn/v0.7.3 -.\" http://github.com/rtomayko/ronn/tree/0.7.3 -. -.TH "FISHER\-FAQ" "7" "February 2016" "" "fisherman" -. -.SH "NAME" -\fBfisher\-faq\fR \- Frequently Asked Questions -. -.SH "SYNOPSIS" -This document attempts to answer some of Fisherman most frequently asked questions\. Feel free to create a new issue in the Fisherman issue tracker if your question is not answered here\. -. -.SS "What is Fisherman?" -Fisherman is a fish plugin manager that lets you share and reuse code, prompts and configurations easily\. -. -.SS "What do I need to know to use Fisherman?" -Nothing, continue to use fish as usual\. Ready to learn more? Type \fBfisher help\fR or \fBfisher help tour\fR\. -. -.SS "How do I access the documentation?" -Fisherman documentation is based in UNIX \fBman\fR(1) pages\. For basic usage and command enter \fBfisher help\fR\. For help about a specific \fIcommand\fR, enter \fBfisher help \fR\. The following guides are also available: -. -.P -fisher help \fBfaq\fR: Fisherman FAQ -. -.br -fisher help \fBtour\fR: Fisherman Tour -. -.br -fisher help \fBconfig\fR: Fisherman Configuration -. -.br -fisher help \fBplugins\fR: Creating Fisherman Plugins -. -.br -fisher help \fBcommands\fR: Creating Fisherman Commands -. -.br -fisher help \fBfishfile\fR: Fishfile Format -. -.br -. -.SS "What are Fisherman plugins?" -Plugins are written in fish and extend the shell core functionality, run initialization code, add completions or documentations to other commands, etc\. See \fBfisher help plugins\fR\. -. -.P -Plugins may list any number of dependencies to other plugins using a \fIfishfile\fR\. -. -.SS "What is a Fishfile?" -A plain text file consists of a lists of installed plugins or dependencies to other plugins\. -. -.P -Fishfiles let you share plugin configurations across multiple installations, allow plugins to declare dependencies, and prevent information loss in case of system failure\. See also \fBfisher help fishfile\fR\. -. -.SS "What kind of Fisherman plugins are there?" -There is no technical distinction between plugins, themes, commands, etc\., but there is a \fIconceptual\fR difference\. -. -.IP "\(bu" 4 -\fBStandalone Utilities\fR: Plugins that define one or more functions, meant to be used at the command line\. -. -.IP "\(bu" 4 -\fBPrompts / Themes\fR: Plugins that modify the appearance of the fish prompt by defining a \fBfish_prompt\fR and / or \fBfish_right_prompt\fR functions\. -. -.IP "\(bu" 4 -\fBExtension Commands\fR: Plugins that extend Fisherman default commands\. An extension plugin must define one or more functions like \fBfisher_\fR\. For specific information about commands, see \fBfisher help commands\fR and then return to this guide\. -. -.IP "\(bu" 4 -\fBConfiguration Plugins\fR: Plugins that include one or more \fBmy_plugin\.config\.fish\fR files\. Files that follow this convention are evaluated at the start of the session\. -. -.IP "" 0 -. -.P -See \fBfisher help plugins\fR and \fBfisher help commands\fR\. -. -.SS "Does Fisherman support Oh My Fish plugins and themes?" -Yes\. To install either a plugin or theme use their URL: -. -.IP "" 4 -. -.nf - -fisher install omf/plugin\-{rbenv,tab} omf/theme\-scorphish -. -.fi -. -.IP "" 0 -. -.P -You can use the same mechanism to install any valid plugin from any given URL\. See also \fBCompatibility\fR in \fBfisher help tour\fR\. -. -.SS "What does Fisherman do exactly every time I create a new shell session?" -Essentially, add Fisherman functions and completions to the \fB$fish_{function,complete}_path\fR and evaluate files that follow the convention \fB*\.config\.fish\fR\. -. -.IP "" 4 -. -.nf - -set fish_function_path {$fisher_config,$fisher_home}/functions $fish_function_path -set fish_complete_path {$fisher_config,$fisher_home}/completions $fish_complete_path - -for file in $fisher_config/conf\.d/*\.config\.fish - source $file -end -. -.fi -. -.IP "" 0 -. -.P -See \fB$fisher_home/config\.fish\fR for the full code\. -. -.SS "How is Fisherman faster than Oh My Fish and other systems?" -Fisherman ameliorates the slow shell start problem using a flat dependency tree instead of loading a directory hierarchy per plugin\. This also means that Fisherman performance does not decline depending on the number of plugins installed\. See also \fBFlat Tree\fR in \fBfisher help tour\fR\. -. -.SS "How can I upgrade from an existing Oh My Fish! installation?" -Remove the \fB$OMF_PATH\fR and \fB$OMF_CONFIG\fR variables from your \fBconfig\.fish\fR\. -. -.P -Backup dotfiles and other sensitive data\. -. -.IP "" 4 -. -.nf - -rm \-rf {$OMF_PATH,$OMF_CONFIG} -. -.fi -. -.IP "" 0 -. -.P -Install Fisherman\. -. -.IP "" 4 -. -.nf - -curl \-sL install\.fisherman\.sh | fish -. -.fi -. -.IP "" 0 -. -.SS "How do I use fish as my default shell?" -Add Fish to \fB/etc/shells\fR: -. -.IP "" 4 -. -.nf - -echo "/usr/local/bin/fish" | sudo tee \-a /etc/shells -. -.fi -. -.IP "" 0 -. -.P -Make Fish your default shell: -. -.IP "" 4 -. -.nf - -chsh \-s /usr/local/bin/fish -. -.fi -. -.IP "" 0 -. -.P -To switch back to another shell\. -. -.IP "" 4 -. -.nf - -chsh \-s /bin/another/shell -. -.fi -. -.IP "" 0 - diff --git a/man/man7/fisher-faq.md b/man/man7/fisher-faq.md deleted file mode 100644 index adeb615..0000000 --- a/man/man7/fisher-faq.md +++ /dev/null @@ -1,116 +0,0 @@ -fisher-faq(7) -- Frequently Asked Questions -=========================================== - -## SYNOPSIS - -This document attempts to answer some of Fisherman most frequently asked questions. Feel free to create a new issue in the Fisherman issue tracker if your question is not answered here. - -### What is Fisherman? - -Fisherman is a fish plugin manager that lets you share and reuse code, prompts and configurations easily. - -### What do I need to know to use Fisherman? - -Nothing, continue to use fish as usual. Ready to learn more? Type `fisher help` or `fisher help tour`. - -### How do I access the documentation? - -Fisherman documentation is based in UNIX `man`(1) pages. For basic usage and command enter `fisher help`. For help about a specific *command*, enter `fisher help `. The following guides are also available: - -fisher help `faq`: Fisherman FAQ
-fisher help `tour`: Fisherman Tour
-fisher help `config`: Fisherman Configuration
-fisher help `plugins`: Creating Fisherman Plugins
-fisher help `commands`: Creating Fisherman Commands
-fisher help `fishfile`: Fishfile Format
- -### What are Fisherman plugins? - -Plugins are written in fish and extend the shell core functionality, run initialization code, add completions or documentations to other commands, etc. See `fisher help plugins`. - -Plugins may list any number of dependencies to other plugins using a *fishfile*. - -### What is a Fishfile? - -A plain text file consists of a lists of installed plugins or dependencies to other plugins. - -Fishfiles let you share plugin configurations across multiple installations, allow plugins to declare dependencies, and prevent information loss in case of system failure. See also `fisher help fishfile`. - -### What kind of Fisherman plugins are there? - -There is no technical distinction between plugins, themes, commands, etc., but there is a *conceptual* difference. - -* `Standalone Utilities`: Plugins that define one or more functions, meant to be used at the command line. - -* `Prompts / Themes`: Plugins that modify the appearance of the fish prompt by defining a `fish_prompt` and / or `fish_right_prompt` functions. - -* `Extension Commands`: Plugins that extend Fisherman default commands. An extension plugin must define one or more functions like `fisher_`. For specific information about commands, see `fisher help commands` and then return to this guide. - -* `Configuration Plugins`: Plugins that include one or more `my_plugin.config.fish` files. Files that follow this convention are evaluated at the start of the session. - -See `fisher help plugins` and `fisher help commands`. - -### Does Fisherman support Oh My Fish plugins and themes? - -Yes. To install either a plugin or theme use their URL: - -``` -fisher install omf/plugin-{rbenv,tab} omf/theme-scorphish -``` - -You can use the same mechanism to install any valid plugin from any given URL. See also `Compatibility` in `fisher help tour`. - -### What does Fisherman do exactly every time I create a new shell session? - -Essentially, add Fisherman functions and completions to the `$fish_{function,complete}_path` and evaluate files that follow the convention `*.config.fish`. - -```fish -set fish_function_path {$fisher_config,$fisher_home}/functions $fish_function_path -set fish_complete_path {$fisher_config,$fisher_home}/completions $fish_complete_path - -for file in $fisher_config/conf.d/*.config.fish - source $file -end -``` - -See `$fisher_home/config.fish` for the full code. - -### How is Fisherman faster than Oh My Fish and other systems? - -Fisherman ameliorates the slow shell start problem using a flat dependency tree instead of loading a directory hierarchy per plugin. This also means that Fisherman performance does not decline depending on the number of plugins installed. See also `Flat Tree` in `fisher help tour`. - -### How can I upgrade from an existing Oh My Fish! installation? - -Remove the `$OMF_PATH` and `$OMF_CONFIG` variables from your `config.fish`. - -Backup dotfiles and other sensitive data. - -```fish -rm -rf {$OMF_PATH,$OMF_CONFIG} -``` - -Install Fisherman. - -``` -curl -sL install.fisherman.sh | fish -``` - -### How do I use fish as my default shell? - -Add Fish to `/etc/shells`: - -```sh -echo "/usr/local/bin/fish" | sudo tee -a /etc/shells -``` - -Make Fish your default shell: - -```sh -chsh -s /usr/local/bin/fish -``` - -To switch back to another shell. - -```sh -chsh -s /bin/another/shell -``` diff --git a/man/man7/fisher-features.7 b/man/man7/fisher-features.7 deleted file mode 120000 index 9ff8b77..0000000 --- a/man/man7/fisher-features.7 +++ /dev/null @@ -1 +0,0 @@ -fisher-tour.7 \ No newline at end of file diff --git a/man/man7/fisher-plugins.7 b/man/man7/fisher-plugins.7 deleted file mode 100644 index b9ba167..0000000 --- a/man/man7/fisher-plugins.7 +++ /dev/null @@ -1,218 +0,0 @@ -.\" generated with Ronn/v0.7.3 -.\" http://github.com/rtomayko/ronn/tree/0.7.3 -. -.TH "FISHER\-PLUGINS" "7" "February 2016" "" "fisherman" -. -.SH "NAME" -\fBfisher\-plugins\fR \- Creating Fisherman Plugins -. -.SH "DESCRIPTION" -This document describes how to create Fisherman plugins\. This includes stand\-alone utilities, prompts, extension commands and configuration plugins\. -. -.P -There is no technical distinction between any of the terms aforementioned, but there is a \fIconceptual\fR difference\. -. -.SH "DEFINITIONS" -. -.IP "\(bu" 4 -\fBStandalone Utilities\fR: Plugins that define one or more functions\. -. -.IP "\(bu" 4 -\fBPrompts / Themes\fR: Plugins that modify the appearance of the fish prompt by defining a \fBfish_prompt\fR / \fBfish_right_prompt\fR function/s\. -. -.IP "\(bu" 4 -\fBExtension Commands\fR: Plugins that extend Fisherman default commands\. An extension plugin must define one or more functions like \fBfisher_\fR\. For specific information about commands, see \fBfisher help commands\fR\. -. -.IP "\(bu" 4 -\fBConfiguration Plugins\fR: Plugins that include one or more \fBmy_plugin\.config\.fish\fR files\. Files that follow this convention are evaluated at the start of the session\. If a file does not follow the \fB\.config\.fish\fR convention, it must be added to \fBconf\.d/*\.fish\fR and the \fB\fR name will be prepended to the file during the installation process\. -. -.IP "" 0 -. -.P -An example plugin that follows several of the conventions proposed above\. -. -.IP "" 4 -. -.nf - -my_plugin -|\-\- fisher_my_plugin\.fish -|\-\- my_plugin\.fish -|\-\- fish_prompt\.fish -|\-\- fish_right_prompt\.fish -|\-\- my_plugin\.config\.fish -|\-\- functions -| `\-\- my_plugin_helper\.fish -|\-\- conf\.d -| `\-\- *\.fish -|\-\- completions -| `\-\- my_plugin\.fish -`\-\- man - `\-\- man1 - `\-\- my_plugin\.1 -. -.fi -. -.IP "" 0 -. -.SH "DEPENDENCIES" -A plugin may list any number of dependencies to other plugins using a \fIfishfile\fR, see \fBfisher help fishfile\fR\. -. -.P -For example, if \fB\fR depends on \fB\fR, add this dependency into a fishfile at the root of the project: -. -.IP "" 4 -. -.nf - -cat > my_plugin/fishfile -your_plugin -CTRL^D -. -.fi -. -.IP "" 0 -. -.P -Plugins may also define completions using \fBcomplete\fR(1) and provide documentation in the form of \fBman\fR(1) pages\. -. -.SH "EXAMPLE" -This section walks you through creating \fIwtc\fR, a stand\-alone plugin based in \fIgithub\.com/ngerakines/commitment\fR random commit message generator\. -. -.TP -Navigate to your preferred workspace and create the plugin\'s directory and Git repository: - -. -.IP "" 4 -. -.nf - -mkdir \-p my/workspace/wtc; and cd my/workspace/wtc -git init -git remote add origin https://github\.com//wtc -. -.fi -. -.IP "" 0 -. -.IP "\(bu" 4 -Add the implementation\. -. -.IP "" 0 -. -.IP "" 4 -. -.nf - -cat > wtc\.fish - -function wtc \-d "Generate a random commit message" - switch "$argv" - case \-h \-\-help - printf "Usage: wtc [\-\-help]\en\en" - printf " \-h \-\-help Show usage help\en" - return - end - curl \-s whatthecommit\.com/index\.txt -end -^C -. -.fi -. -.IP "" 0 -. -.IP "\(bu" 4 -Add completions\. \fIwtc\fR is simple enough that you could get away without \fB__fisher_parse_help\fR, but more complex utilities, or utilities whose CLI evolves over time, can benefit using automatic completion generation\. Note that in order to use \fB__fisher_parse_help\fR, your command must provide a \fB\-\-help\fR option that prints usage information to standard output\. -. -.IP "" 0 -. -.IP "" 4 -. -.nf - -mkdir completions -cat > completions/wtc\.fish - -set \-l IFS ";" -wtc \-\-help | __fisher_parse_help | while read \-l info long short - complete \-c wtc \-s "$short" \-l "$long" \-d "$info" -end -^C -. -.fi -. -.IP "" 0 -. -.TP -Add basic documentation\. Fisherman uses standard manual pages for displaying help information\. There are utilities that can help you generate man pages from other text formats, such as Markdown\. One example is \fBronn\fR(1)\. For this example, type will do: - -. -.IP "" 4 -. -.nf - -mkdir \-p man/man1 -cat > man/man1/wtc\.1 - - \.TH man 1 "Today" "1\.0" "wtc man page" - \.SH NAME - wtc \e\- Generate a random commit message - \.SH SYNOPSIS - wtc [\-\-help] - \.SH OPTIONS - \-h, \-\-help: Display help information\. - \.SH SEE ALSO - https://github\.com/ngerakines/commitment -^C -. -.fi -. -.IP "" 0 -. -.IP "\(bu" 4 -Commit changes and push to the remote repository\. -. -.IP "" 0 -. -.IP "" 4 -. -.nf - -git add \-\-all -git commit \-m "What the commit? 1\.0" -git push origin master -. -.fi -. -.IP "" 0 -. -.IP "\(bu" 4 -Install with Fisherman\. If you would like to submit your package for registration install the \fBsubmit\fR plugin or send a pull request to the main index repository in \fIhttps://github\.com/fisherman/index\fR\. See \fBIndex\fR in \fBfisher help tour\fR\. -. -.IP "" 0 -. -.IP "" 4 -. -.nf - -fisher install github/*owner*/wtc -wtc -(\e /) -(O\.o) -(> <) Bunny approves these changes\. -. -.fi -. -.IP "" 0 -. -.SH "SEE ALSO" -\fBman\fR(1), \fBcomplete\fR(1) -. -.br -\fBfisher help commands\fR -. -.br -\fBfisher help fishfile\fR -. -.br - diff --git a/man/man7/fisher-plugins.md b/man/man7/fisher-plugins.md deleted file mode 100644 index 1bb768d..0000000 --- a/man/man7/fisher-plugins.md +++ /dev/null @@ -1,136 +0,0 @@ -fisher-plugins(7) -- Creating Fisherman Plugins -=============================================== - -## DESCRIPTION - -This document describes how to create Fisherman plugins. This includes stand-alone utilities, prompts, extension commands and configuration plugins. - -There is no technical distinction between any of the terms aforementioned, but there is a *conceptual* difference. - -## DEFINITIONS - -* `Standalone Utilities`: Plugins that define one or more functions. - -* `Prompts / Themes`: Plugins that modify the appearance of the fish prompt by defining a `fish_prompt` / `fish_right_prompt` function/s. - -* `Extension Commands`: Plugins that extend Fisherman default commands. An extension plugin must define one or more functions like `fisher_`. For specific information about commands, see `fisher help commands`. - -* `Configuration Plugins`: Plugins that include one or more `my_plugin.config.fish` files. Files that follow this convention are evaluated at the start of the session. If a file does not follow the `.config.fish` convention, it must be added to `conf.d/*.fish` and the `` name will be prepended to the file during the installation process. - -An example plugin that follows several of the conventions proposed above. - -``` -my_plugin -|-- fisher_my_plugin.fish -|-- my_plugin.fish -|-- fish_prompt.fish -|-- fish_right_prompt.fish -|-- my_plugin.config.fish -|-- functions -| `-- my_plugin_helper.fish -|-- conf.d -| `-- *.fish -|-- completions -| `-- my_plugin.fish -`-- man - `-- man1 - `-- my_plugin.1 -``` - -## DEPENDENCIES - -A plugin may list any number of dependencies to other plugins using a *fishfile*, see `fisher help fishfile`. - -For example, if `` depends on ``, add this dependency into a fishfile at the root of the project: - -``` -cat > my_plugin/fishfile -your_plugin -CTRL^D -``` - -Plugins may also define completions using `complete`(1) and provide documentation in the form of `man`(1) pages. - -## EXAMPLE - -This section walks you through creating *wtc*, a stand-alone plugin based in *github.com/ngerakines/commitment* random commit message generator. - -* Navigate to your preferred workspace and create the plugin's directory and Git repository: - -```fish -mkdir -p my/workspace/wtc; and cd my/workspace/wtc -git init -git remote add origin https://github.com//wtc -``` - -* Add the implementation. - -```fish -cat > wtc.fish - -function wtc -d "Generate a random commit message" - switch "$argv" - case -h --help - printf "Usage: wtc [--help]\n\n" - printf " -h --help Show usage help\n" - return - end - curl -s whatthecommit.com/index.txt -end -^C -``` - -* Add completions. *wtc* is simple enough that you could get away without `__fisher_parse_help`, but more complex utilities, or utilities whose CLI evolves over time, can benefit using automatic completion generation. Note that in order to use `__fisher_parse_help`, your command must provide a `--help` option that prints usage information to standard output. - -```fish -mkdir completions -cat > completions/wtc.fish - -set -l IFS ";" -wtc --help | __fisher_parse_help | while read -l info long short - complete -c wtc -s "$short" -l "$long" -d "$info" -end -^C -``` - -* Add basic documentation. Fisherman uses standard manual pages for displaying help information. There are utilities that can help you generate man pages from other text formats, such as Markdown. One example is `ronn`(1). For this example, type will do: - -```fish -mkdir -p man/man1 -cat > man/man1/wtc.1 - - .TH man 1 "Today" "1.0" "wtc man page" - .SH NAME - wtc \- Generate a random commit message - .SH SYNOPSIS - wtc [--help] - .SH OPTIONS - -h, --help: Display help information. - .SH SEE ALSO - https://github.com/ngerakines/commitment -^C -``` - -* Commit changes and push to the remote repository. - -```fish -git add --all -git commit -m "What the commit? 1.0" -git push origin master -``` - -* Install with Fisherman. If you would like to submit your package for registration install the `submit` plugin or send a pull request to the main index repository in *https://github.com/fisherman/index*. See `Index` in `fisher help tour`. - -```fish -fisher install github/*owner*/wtc -wtc -(\ /) -(O.o) -(> <) Bunny approves these changes. -``` - -## SEE ALSO - -`man`(1), `complete`(1)
-`fisher help commands`
-`fisher help fishfile`
diff --git a/man/man7/fisher-tour.7 b/man/man7/fisher-tour.7 deleted file mode 100644 index d14c59c..0000000 --- a/man/man7/fisher-tour.7 +++ /dev/null @@ -1,340 +0,0 @@ -.\" generated with Ronn/v0.7.3 -.\" http://github.com/rtomayko/ronn/tree/0.7.3 -. -.TH "FISHER\-TOUR" "7" "February 2016" "" "fisherman" -. -.SH "NAME" -\fBfisher\-tour\fR \- Fisherman Tour -. -.SH "DESCRIPTION" -Fisherman is a blazing fast, modern plugin manager for \fBfish\fR(1)\. -. -.P -Fisherman runs virtually no initialization code, making it \fBas fast as no Fisherman\fR\. The cache mechanism lets you query the index offline and enable or disable plugins as you wish\. -. -.P -Other features include dependency management, excellent test coverage, plugin search capabilities and full compatibility with Tackle, Oh My Fish! and Wahoo themes and plugins\. -. -.P -This document describes Fisherman features and their implementation details\. For usage and command help see \fBfisher\fR(1)\. -. -.SH "FLAT TREE" -The configuration directory structure is optimized to help your shell start new sessions as quickly as possible, regardless of the numbers of plugins or prompts enabled at any given time\. -. -.P -To explain how this is possible, we need to make a digression and discuss function scope first\. In fish, all functions share the same scope and you can use only one name per function\. -. -.P -In the following example: -. -.IP "" 4 -. -.nf - -function foo - echo $_ - function bar - end -end - -function bar - echo $_ -end -. -.fi -. -.IP "" 0 -. -.P -\fIfoo\fR and \fIbar\fR are available immediately at the command line prompt and both print their names\. But there is a catch, calling \fIfoo\fR at least once will create a new \fIbar\fR function, effectively erasing the previous \fIbar\fR definition\. Subsequent calls to \fIbar\fR will print nothing\. -. -.P -By convention, functions that start with any number of underscores are \fIintentionally\fR private, but there is no mechanism that prevents you from calling them once they are loaded\. -. -.P -With this in mind, it\'s possible to improve the slow shell start problem using a \fIflat\fR tree structure whose path is loaded only once\. -. -.P -The overhead of juggling multiple path hierarchies in a per\-plugin basis yields no benefits as everything is shared inside the same scope\. -. -.P -Loading a path simply means adding the desired location to the \fB$fish_function_path\fR array\. See also \fBfunctions\fR(1)\. -. -.P -Here is a snapshot of an example Fisherman configuration path with a single plugin and prompt: -. -.IP "" 4 -. -.nf - -$fisher_config -|\-\- cache/ -|\-\- conf\.d/ -| `\-\- \.config\.fish -|\-\- fishfile -|\-\- functions/ -| |\-\- \.fish -| |\-\- fish_prompt\.fish -| `\-\- fish_right_prompt\.fish -|\-\- completions/ -| `\-\- \.fish -`\-\- man/ - `\-\- man1/ - `\-\- \.1 -. -.fi -. -.IP "" 0 -. -.P -If you are already familiar in the way Fish handles your user configuration, you will find the above structure similar to \fB$XDG_CONFIG_HOME/fish\fR\. See \fBInitialization Files\fR in \fBhelp fish\fR to learn more about fish configuration\. -. -.P -\fBconf\.d\fR, short for configuration directory, is used for initialization files, i\.e\., files that should run at the start of the shell\. Files that follow the naming convention \fB\.config\.fish\fR are added there\. If a file does not follow the \fB\.config\.fish\fR convention, \fB\fR will be added during the installation process\. -. -.SS "PLUGINS" -Plugins are components that extend and add features to your shell\. To see what plugins are available use \fBfisher search\fR\. You can also type \fBfisher install\fR and hit \fItab\fR once to get formatted plugin information\. The same works for \fBfisher update\fR and \fBfisher uninstall\fR\. -. -.P -To learn how to create plugins, see \fBfisher help plugins\fR\. -. -.P -You can install a plugin by their name, URL or by indicating the path to a local plugin project\. -. -.P -In order to install a plugin by \fIname\fR, it must be already published in the index database\. See \fBIndex\fR\. -. -.IP "" 4 -. -.nf - -fisher install shark -. -.fi -. -.IP "" 0 -. -.P -You can use an URL too if you have one\. -. -.IP "" 4 -. -.nf - -fisher install simnalamburt/shellder -. -.fi -. -.IP "" 0 -. -.P -If the domain or host is not provided, Fisherman will use \fBhttps://github\.com\fR by default\. -. -.P -In addition, all of the following \fBowner/repo\fR variations are accepted: -. -.IP "\(bu" 4 -owner/repo \fB>\fR https://github\.com/owner/repo -. -.br - -. -.IP "\(bu" 4 -\fIgithub\fR/owner/repo \fB>\fR https://github\.com/owner/repo -. -.br - -. -.IP "\(bu" 4 -\fIgh\fR/owner/repo \fB>\fR https://github\.com/owner/repo -. -.br - -. -.IP "" 0 -. -.P -Shortcuts to other common Git repository hosting services are also available: -. -.IP "\(bu" 4 -\fIbb\fR/owner/repo \fB>\fR https://bitbucket\.org/owner/repo -. -.br - -. -.IP "\(bu" 4 -\fIgl\fR/owner/repo \fB>\fR https://gitlab\.com/owner/repo -. -.br - -. -.IP "\(bu" 4 -\fIomf\fR/owner/repo \fB>\fR https://github\.com/oh\-my\-fish/repo -. -.br - -. -.IP "" 0 -. -.P -Because of Fisherman\'s flat tree model, there is no technical distinction between plugins or prompts\. Installing a prompt is equivalent to switching themes in other systems\. The interface is always \fIinstall\fR, \fIupdate\fR or \fIuninstall\fR\. -. -.P -Throughout this document and other Fisherman manuals you will find the term prompt when referring to the \fIconcept\fR of a theme, i\.e\., a plugin that defines a \fBfish_prompt\fR / \fBfish_right_prompt\fR function/s\. -. -.SS "INDEX" -You can install, update and uninstall plugins by their name, querying the Fisherman index\. The index is a plain text flat database independently managed\. You can use a custom index file by setting \fB$fisher_index\fR to your own file or URL\. Redirection URLs are currently not supported due to security and performance concerns\. See \fBfisher help config\fR\. -. -.P -A copy of the index is downloaded each time a search query takes place, \fB$fisher_update_interval\fR seconds since the last update\. \fB$fisher_update_interval\fR is 10 seconds by default if not set\. This helps keeping the index up to date and allows you to search the database offline\. -. -.P -The index itself is a list of records, each consisting of the following fields: -. -.IP "\(bu" 4 -\fBname\fR, \fBurl\fR, \fBinfo\fR, one or more \fBtags\fR and \fBauthor\fR\. -. -.IP "" 0 -. -.P -Fields are separated by a new line \fB\'\en\'\fR\. Tags are separated by one \fIspace\fR\. Here is a sample record: -. -.IP "" 4 -. -.nf - -shark -https://github\.com/bucaran/shark -Fantastic Sparkline Generator -chart tool report sparkline graph -bucaran -. -.fi -. -.IP "" 0 -. -.P -To submit a new plugin for registration install the \fBsubmit\fR plugin: -. -.IP "" 4 -. -.nf - -fisher install submit -. -.fi -. -.IP "" 0 -. -.P -For usage see the bundled documentation \fBfisher help submit\fR\. -. -.P -You can also submit a new plugin manually and create a pull request in the index repository (github\.com/fisherman/fisher\-index): -. -.IP "" 4 -. -.nf - -git clone https://github\.com/fisherman/fisher\-index -cd index -echo "$name\en$URL\en$info\en$author\en$tags\en\en" >> index -git push origin master -open http://github\.com -. -.fi -. -.IP "" 0 -. -.SS "CACHE" -Downloaded plugins are stored as Git repositories under \fB$fisher_cache\fR\. See \fBfisher help config\fR to find out about other Fisherman configuration variables\. -. -.P -When you install or uninstall a plugin, Fisherman downloads the repository to the cache and copies only the relevant files from the cache to the loaded function and / or completion path\. In this sense, this location works also like an intermediate \fBstage\fR\. In addition, manual pages are added to the corresponding man directory and if a Makefile is also detected, the command \fBmake\fR is run\. -. -.SS "FISHFILES" -Fishfiles let you share plugin configurations across multiple installations, let plugins declare dependencies and teach Fisherman what plugins are currently enabled / disabled when using \fBfisher \-\-list\fR\. -. -.P -Your fishfile is stored in \fB$fisher_config/fishfile\fR by default, but you can customize its location setting \fB$fisher_file\fR in your user fish configuration file\. -. -.P -Here is an example fishfile inside \fB$fisher_config\fR: -. -.IP "" 4 -. -.nf - -# Ahoy! This is my Fishfile -gitio -fishtape -shark -get -. -.fi -. -.IP "" 0 -. -.P -The fishfile updates as you install / uninstall plugins\. See also \fBfisher help install\fR or \fBfisher help uninstall\fR\. -. -.SS "CONFIGURATION" -Fisherman allows a high level of configuration using \fB$fisher_*\fR variables\. You can customize the home and configuration directories, cache and fishfile location, index source URL, command aliases, etc\. See \fBfisher help config\fR\. -. -.P -You can also extend Fisherman by adding new commands and ship them as plugins\. Fisherman automatically adds completions to \fIcommands\fR based in the function \fIdescription\fR and usage help if provided\. See \fBfisher help help\fR and \fBfisher help commands\fR\. -. -.P -To add completions to standalone utility plugins, use \fBcomplete\fR(1)\. -. -.SS "CLI" -If you are already familiar with other UNIX tools, you\'ll find Fisherman commands behave intuitively\. -. -.P -Most commands read the standard input by default when no options are given and produce easy to parse output, making Fisherman commands ideal for plumbing and building upon each other\. -. -.P -Fisherman also ships with a CLI options parser and a job spinner you can use to implement your own CLIs\. See \fBgetopts\fR(1) and \fBspin\fR(1)\. -. -.SH "COMPATIBILITY" -Fisherman supports Oh My Fish! themes and plugins, but some features are turned off by default for performance reasons\. -. -.P -Oh My Fish! evaluates every \fI\.fish\fR file inside the root directory for every plugin installed during shell start\. This is necessary in order to load any existing \fBinit\fR event functions and immediately invoke them using fish \fBemit\fR(1)\. -. -.P -Since it is not possible to determine whether a file defines an initialization event without evaluating its contents first, Oh My Fish! sources all \fB*\.fish\fR files and then emits events for each plugin\. -. -.P -Not all plugins opt in the initialization mechanism, therefore support for this behavior is turned off by default\. If you would like Fisherman to behave like Oh My Fish! at the start of the shell session, install the \fBlegacy\fR compatibility plugin\. -. -.IP "" 4 -. -.nf - -fisher install legacy -. -.fi -. -.IP "" 0 -. -.P -This plugin also adds definitions for some of Oh My Fish! Core Library functions\. -. -.SH "SEE ALSO" -\fBfisher\fR(1), \fBspin\fR(1), \fBgetopts\fR(1) -. -.br -\fBfisher help\fR -. -.br -\fBfisher help config\fR -. -.br -\fBfisher help plugins\fR -. -.br -\fBfisher help commands\fR -. -.br - diff --git a/man/man7/fisher-tour.md b/man/man7/fisher-tour.md deleted file mode 100644 index c49a0b6..0000000 --- a/man/man7/fisher-tour.md +++ /dev/null @@ -1,206 +0,0 @@ -fisher-tour(7) -- Fisherman Tour -================================ - -## DESCRIPTION - -Fisherman is a blazing fast, modern plugin manager for `fish`(1). - -Fisherman runs virtually no initialization code, making it **as fast as no Fisherman**. The cache mechanism lets you query the index offline and enable or disable plugins as you wish. - -Other features include dependency management, excellent test coverage, plugin search capabilities and full compatibility with Tackle, Oh My Fish! and Wahoo themes and plugins. - -This document describes Fisherman features and their implementation details. For usage and command help see `fisher`(1). - -## FLAT TREE - -The configuration directory structure is optimized to help your shell start new sessions as quickly as possible, regardless of the numbers of plugins or prompts enabled at any given time. - -To explain how this is possible, we need to make a digression and discuss function scope first. In fish, all functions share the same scope and you can use only one name per function. - -In the following example: - -``` -function foo - echo $_ - function bar - end -end - -function bar - echo $_ -end -``` - -*foo* and *bar* are available immediately at the command line prompt and both print their names. But there is a catch, calling *foo* at least once will create a new *bar* function, effectively erasing the previous *bar* definition. Subsequent calls to *bar* will print nothing. - -By convention, functions that start with any number of underscores are *intentionally* private, but there is no mechanism that prevents you from calling them once they are loaded. - -With this in mind, it's possible to improve the slow shell start problem using a *flat* tree structure whose path is loaded only once. - -The overhead of juggling multiple path hierarchies in a per-plugin basis yields no benefits as everything is shared inside the same scope. - -Loading a path simply means adding the desired location to the `$fish_function_path` array. See also `functions`(1). - -Here is a snapshot of an example Fisherman configuration path with a single plugin and prompt: - -``` -$fisher_config -|-- cache/ -|-- conf.d/ -| `-- .config.fish -|-- fishfile -|-- functions/ -| |-- .fish -| |-- fish_prompt.fish -| `-- fish_right_prompt.fish -|-- completions/ -| `-- .fish -`-- man/ - `-- man1/ - `-- .1 -``` - -If you are already familiar in the way Fish handles your user configuration, you will find the above structure similar to `$XDG_CONFIG_HOME/fish`. See `Initialization Files` in `help fish` to learn more about fish configuration. - -`conf.d`, short for configuration directory, is used for initialization files, i.e., files that should run at the start of the shell. Files that follow the naming convention `.config.fish` are added there. If a file does not follow the `.config.fish` convention, `` will be added during the installation process. - -### PLUGINS - -Plugins are components that extend and add features to your shell. To see what plugins are available use `fisher search`. You can also type `fisher install` and hit *tab* once to get formatted plugin information. The same works for `fisher update` and `fisher uninstall`. - -To learn how to create plugins, see `fisher help plugins`. - -You can install a plugin by their name, URL or by indicating the path to a local plugin project. - -In order to install a plugin by *name*, it must be already published in the index database. See `Index`. - -``` -fisher install shark -``` - -You can use an URL too if you have one. - -``` -fisher install simnalamburt/shellder -``` - -If the domain or host is not provided, Fisherman will use `https://github.com` by default. - -In addition, all of the following `owner/repo` variations are accepted: - -* owner/repo `>` https://github.com/owner/repo
-* *github*/owner/repo `>` https://github.com/owner/repo
-* *gh*/owner/repo `>` https://github.com/owner/repo
- -Shortcuts to other common Git repository hosting services are also available: - -* *bb*/owner/repo `>` https://bitbucket.org/owner/repo
-* *gl*/owner/repo `>` https://gitlab.com/owner/repo
-* *omf*/owner/repo `>` https://github.com/oh-my-fish/repo
- -Because of Fisherman's flat tree model, there is no technical distinction between plugins or prompts. Installing a prompt is equivalent to switching themes in other systems. The interface is always *install*, *update* or *uninstall*. - -Throughout this document and other Fisherman manuals you will find the term prompt when referring to the *concept* of a theme, i.e., a plugin that defines a `fish_prompt` / `fish_right_prompt` function/s. - -### INDEX - -You can install, update and uninstall plugins by their name, querying the Fisherman index. The index is a plain text flat database independently managed. You can use a custom index file by setting `$fisher_index` to your own file or URL. Redirection URLs are currently not supported due to security and performance concerns. See `fisher help config`. - -A copy of the index is downloaded each time a search query takes place, `$fisher_update_interval` seconds since the last update. `$fisher_update_interval` is 10 seconds by default if not set. This helps keeping the index up to date and allows you to search the database offline. - -The index itself is a list of records, each consisting of the following fields: - -* `name`, `url`, `info`, one or more `tags` and `author`. - -Fields are separated by a new line `'\n'`. Tags are separated by one *space*. Here is a sample record: - -``` -shark -https://github.com/bucaran/shark -Fantastic Sparkline Generator -chart tool report sparkline graph -bucaran -``` - -To submit a new plugin for registration install the `submit` plugin: - -``` -fisher install submit -``` - -For usage see the bundled documentation `fisher help submit`. - -You can also submit a new plugin manually and create a pull request in the index repository (github.com/fisherman/fisher-index): - -``` -git clone https://github.com/fisherman/fisher-index -cd index -echo "$name\n$URL\n$info\n$author\n$tags\n\n" >> index -git push origin master -open http://github.com -``` - -### CACHE - -Downloaded plugins are stored as Git repositories under `$fisher_cache`. See `fisher help config` to find out about other Fisherman configuration variables. - -When you install or uninstall a plugin, Fisherman downloads the repository to the cache and copies only the relevant files from the cache to the loaded function and / or completion path. In this sense, this location works also like an intermediate `stage`. In addition, manual pages are added to the corresponding man directory and if a Makefile is also detected, the command `make` is run. - -### FISHFILES - -Fishfiles let you share plugin configurations across multiple installations, let plugins declare dependencies and teach Fisherman what plugins are currently enabled / disabled when using `fisher --list`. - -Your fishfile is stored in `$fisher_config/fishfile` by default, but you can customize its location setting `$fisher_file` in your user fish configuration file. - -Here is an example fishfile inside `$fisher_config`: - -``` -# Ahoy! This is my Fishfile -gitio -fishtape -shark -get -``` - -The fishfile updates as you install / uninstall plugins. See also `fisher help install` or `fisher help uninstall`. - - -### CONFIGURATION - -Fisherman allows a high level of configuration using `$fisher_*` variables. You can customize the home and configuration directories, cache and fishfile location, index source URL, command aliases, etc. See `fisher help config`. - -You can also extend Fisherman by adding new commands and ship them as plugins. Fisherman automatically adds completions to *commands* based in the function *description* and usage help if provided. See `fisher help help` and `fisher help commands`. - -To add completions to standalone utility plugins, use `complete`(1). - -### CLI - -If you are already familiar with other UNIX tools, you'll find Fisherman commands behave intuitively. - -Most commands read the standard input by default when no options are given and produce easy to parse output, making Fisherman commands ideal for plumbing and building upon each other. - -Fisherman also ships with a CLI options parser and a job spinner you can use to implement your own CLIs. See `getopts`(1) and `spin`(1). - -## COMPATIBILITY - -Fisherman supports Oh My Fish! themes and plugins, but some features are turned off by default for performance reasons. - -Oh My Fish! evaluates every *.fish* file inside the root directory for every plugin installed during shell start. This is necessary in order to load any existing `init` event functions and immediately invoke them using fish `emit`(1). - -Since it is not possible to determine whether a file defines an initialization event without evaluating its contents first, Oh My Fish! sources all `*.fish` files and then emits events for each plugin. - -Not all plugins opt in the initialization mechanism, therefore support for this behavior is turned off by default. If you would like Fisherman to behave like Oh My Fish! at the start of the shell session, install the `legacy` compatibility plugin. - -``` -fisher install legacy -``` - -This plugin also adds definitions for some of Oh My Fish! Core Library functions. - -## SEE ALSO - -`fisher`(1), `spin`(1), `getopts`(1)
-`fisher help`
-`fisher help config`
-`fisher help plugins`
-`fisher help commands`
diff --git a/man/man7/fisher-tutorial.7 b/man/man7/fisher-tutorial.7 new file mode 100644 index 0000000..d2e74e4 --- /dev/null +++ b/man/man7/fisher-tutorial.7 @@ -0,0 +1,537 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "FISHER\-TUTORIAL" "7" "February 2016" "" "fisherman" +. +.SH "NAME" +\fBfisher\-tutorial\fR \- A tutorial introduction to Fisherman +. +.SH "DESCRIPTION" +This document tells you how to start using Fisherman key features\. +. +.SH "INSTALLING PLUGINS" +Install a plugin\. +. +.IP "" 4 +. +.nf + +fisher install +. +.fi +. +.IP "" 0 +. +.P +\fIplugin\fR can be name registered in the Fisherman index, a URL to a Git repository or a path in the local system\. Plugins are collected in a special location inside the Fisherman\'s configuration directory known as the cache\. +. +.SH "UPDATE AND UNINSTALL" +Update a plugin\. +. +.IP "" 4 +. +.nf + +fisher update +. +.fi +. +.IP "" 0 +. +.P +Uninstall a plugin\. +. +.IP "" 4 +. +.nf + +fisher uninstall +. +.fi +. +.IP "" 0 +. +.SH "LIST AND SEARCH" +The list command displays all the plugins you have installed\. The search command queries the index to show what\'s available to install\. +. +.P +List installed plugins\. +. +.IP "" 4 +. +.nf + +fisher list + debug +* fishtape +> shellder +* spin +@ wipe +. +.fi +. +.IP "" 0 +. +.P +The legend consists of: +. +.P +\fB*\fR Indicate the plugin is currently installed +. +.br +\fB>\fR Indicate the plugin is a prompt +. +.br +\fB@\fR Indicate the plugin is a symbolic link +. +.br +. +.P +Search the index\. +. +.IP "" 4 +. +.nf + +fisher search + \.\.\. +* debug Conditional debug logger + errno POSIX error code/string translator +* fishtape TAP producing test runner + flash Flash\-inspired, thunder prompt + fzf Efficient keybindings for fzf + get Press any key to continue + \.\.\. +> shellder Powerline prompt optimized for speed + \.\.\. +. +.fi +. +.IP "" 0 +. +.P +Get detailed information about a plugin\. +. +.IP "" 4 +. +.nf + +fisher search shellder +> shellder by simnalamburt +Powerline prompt optimized for speed +github\.com/simnalamburt/shellder +. +.fi +. +.IP "" 0 +. +.P +Search plugins using tags\. +. +.IP "" 4 +. +.nf + +fisher search \-\-tag={git,test} + \.\.\. +* fishtape TAP producing test runner + git\-branch\-name Get the name of the current Git branch + git\-is\-repo Test if the current directory is a Git repo + git\-is\-dirty Test if there are changes not staged for commit + git\-is\-stashed Test if there are changes in the stash + \.\.\. +. +.fi +. +.IP "" 0 +. +.SH "PLUMBING" +Fisherman commands are pipe aware\. Plumb one with another to create complex functionality\. +. +.P +Update all the plugins in the cache\. +. +.IP "" 4 +. +.nf + +fisher list | fisher update \- +. +.fi +. +.IP "" 0 +. +.P +Install all the plugins that are currently disabled\. +. +.IP "" 4 +. +.nf + +fisher list \-\-disabled | fisher install +. +.fi +. +.IP "" 0 +. +.SH "DOTFILES" +When you install a plugin, Fisherman updates a file known as \fIfishfile\fR to track what plugins are currently enabled\. +. +.P +To customize its location: +. +.IP "" 4 +. +.nf + +set \-g fisher_file ~/\.dotfiles/fishfile +. +.fi +. +.IP "" 0 +. +.SH "PLUGINS" +Plugins can be utilities, prompts, commands or snippets\. +. +.SS "UTILITIES" +Utilities are plugins that define one or more functions which are mean to be used in the CLI directly by the user\. +. +.P +This example walks you through creating \fIwtc\fR, a plugin based in \fIgithub/ngerakines/commitment\fR random commit message generator\. +. +.IP "\(bu" 4 +Create a directory and initialize a Git repository\. +. +.IP "" 0 +. +.IP "" 4 +. +.nf + +mkdir wtc +cd wtc +git init +git remote add origin https://github\.com//wtc +. +.fi +. +.IP "" 0 +. +.IP "\(bu" 4 +Add the wtc function\. +. +.IP "" 0 +. +.IP "" 4 +. +.nf + +function wtc \-d "Generate a random commit message" + switch "$argv" + case \-h \-\-help + printf "Usage: wtc [\-\-help]\en\en" + printf " \-h \-\-help Show usage help\en" + return + end + curl \-s whatthecommit\.com/index\.txt +end +. +.fi +. +.IP "" 0 +. +.IP "\(bu" 4 +Install the plugin\. +. +.IP "" 0 +. +.IP "" 4 +. +.nf + +fisher install \. +wtc +(\e /) +(O\.o) +(> <) Bunny approves these changes\. +. +.fi +. +.IP "" 0 +. +.IP "\(bu" 4 +Commit changes and push to your remote origin when you are done\. +. +.IP "" 0 +. +.IP "" 4 +. +.nf + +git add \-\-all +git commit \-m "What the commit?" +git push origin master +. +.fi +. +.IP "" 0 +. +.P +To submit wtc to the official index\. +. +.IP "" 4 +. +.nf + +fisher install submit +fisher submit +. +.fi +. +.IP "" 0 +. +.P +This will create a PR in the Fisherman index repository\. Once the PR is approved, Fisherman users will be able to install wtc if they have the latest index\. +. +.IP "" 4 +. +.nf + +fisher install wtc +. +.fi +. +.IP "" 0 +. +.P +See \fBfisher help submit\fR for more submit options\. +. +.P +Create a completions directory and add a completions file\. +. +.IP "" 4 +. +.nf + +mkdir completions +cat > completions/wtc\.fish +complete \-\-command wtc \-\-short h \-\-long help \-\-description "Show usage help" +^ +. +.fi +. +.IP "" 0 +. +.P +Alternatively, use \fB__fisher_complete\fR to create completions from wtc usage output\. +. +.IP "" 4 +. +.nf + +wtc \-\-help | __fisher_complete wtc +. +.fi +. +.IP "" 0 +. +.P +Create a man/man1 directory and add a man(1) page for wtc\. +. +.P +There are utilities that can help you generate man pages from various text formats\. For example, pandoc(1) and ronn(1)\. +. +.P +To create a man page manually\. +. +.IP "" 4 +. +.nf + +mkdir \-p man/man1 +cat > man/man1/wtc\.1 + + \.TH man 1 "Today" "1\.0" "wtc man page" + \.SH NAME + wtc \e\- Generate a random commit message + \.SH SYNOPSIS + wtc [\-\-help] + \.SH OPTIONS + \-h, \-\-help: Display help information\. + \.SH SEE ALSO + https://github\.com/ngerakines/commitment +^C +. +.fi +. +.IP "" 0 +. +.P +A plugin can list dependencies to other plugins using a \fIfishfile\fR\. +. +.P +Create a new file in the root of your project and add the name or URL of your desired dependencies\. +. +.IP "" 4 +. +.nf + +cat > fishfile +my_plugin +https://github\.com/owner/another_plugin +^D +. +.fi +. +.IP "" 0 +. +.SS "PROMPTS" +Prompts, also known as themes, are plugins that modify the appearance of the shell prompt\. +. +.P +Create a \fBfish_prompt\fR function\. +. +.IP "" 4 +. +.nf + +function fish_prompt + printf "%s (%s) >> " (prompt_pwd) Fisherman +end +~ (Fisherman) >> type here +. +.fi +. +.IP "" 0 +. +.P +To add a right prompt, create a \fBfish_right_prompt\fR function\. +. +.IP "" 4 +. +.nf + +function fish_right_prompt + printf "%s" (date +%H:%M:%S) +end +. +.fi +. +.IP "" 0 +. +.P +Save the functions to a directory and install the prompt as a plugin\. +. +.IP "" 4 +. +.nf + +mkdir my_prompt +cd my_prompt +functions fish_prompt > fish_prompt\.fish +functions fish_right_prompt > fish_right_prompt\.fish +fisher install \. +. +.fi +. +.IP "" 0 +. +.SS "COMMANDS" +Commands are plugins that extend the Fisherman CLI adding new \fBfisher \fR\. +. +.P +Create a function \fBfisher_\fR +. +.IP "" 4 +. +.nf + +function fisher_time \-d "Say hello" + printf "It\'s %s\en" (date +%H:%M) +end +. +.fi +. +.IP "" 0 +. +.P +Test it works +. +.IP "" 4 +. +.nf + +fisher time +It\'s 6:30 +. +.fi +. +.IP "" 0 +. +.P +Make it a plugin +. +.IP "" 4 +. +.nf + +fisher install fisher_time +. +.fi +. +.IP "" 0 +. +.P +This creates a new directory fisher_time in the current working directory and installs the plugin\. +. +.P +The following example implements a command to format plugin information into columns\. +. +.IP "" 4 +. +.nf + +function fisher_info \-d "Display information about plugins" + switch "$argv" + case \-h \-\-help + printf "Usage: fisher info [\.\.\.]\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 + +fisher install fisher_info +. +.fi +. +.IP "" 0 +. +.SS "SNIPPETS" +Snippets are plugins that run code at the start of the shell\. Snippets must be placed inside a sub directory named conf\.d\. +. +.P +The following example implements the fish_postexec hook to display the runtime of the last command in milliseconds\. +. +.IP "" 4 +. +.nf + +mkdir \-p runtime/conf\.d +cd runtime +cat > conf\.d/fish_postexec\.fish +function fish_postexec \-\-on\-event fish_postexec + printf "%sms\en" $CMD_DURATION > /dev/stderr +end +^D +fisher install \./postexec +. +.fi +. +.IP "" 0 +. +.SH "SEE ALSO" +fisher(1) diff --git a/man/man7/fisher-tutorial.md b/man/man7/fisher-tutorial.md new file mode 100644 index 0000000..598c807 --- /dev/null +++ b/man/man7/fisher-tutorial.md @@ -0,0 +1,336 @@ +fisher-tutorial(7) -- A tutorial introduction to Fisherman +========================================================== + +## DESCRIPTION + +This document tells you how to start using Fisherman key features. + +## INSTALLING PLUGINS + +Install a plugin. + +``` +fisher install +``` + +*plugin* can be name registered in the Fisherman index, a URL to a Git repository or a path in the local system. Plugins are collected in a special location inside the Fisherman's configuration directory known as the cache. + +## UPDATE AND UNINSTALL + +Update a plugin. + +``` +fisher update +``` + +Uninstall a plugin. + +``` +fisher uninstall +``` + +## LIST AND SEARCH + +The list command displays all the plugins you have installed. The search command queries the index to show what's available to install. + +List installed plugins. + +``` +fisher list + debug +* fishtape +> shellder +* spin +@ wipe +``` + +The legend consists of: + +`*` Indicate the plugin is currently installed
+`>` Indicate the plugin is a prompt
+`@` Indicate the plugin is a symbolic link
+ +Search the index. + +``` +fisher search + ... +* debug Conditional debug logger + errno POSIX error code/string translator +* fishtape TAP producing test runner + flash Flash-inspired, thunder prompt + fzf Efficient keybindings for fzf + get Press any key to continue + ... +> shellder Powerline prompt optimized for speed + ... +``` + +Get detailed information about a plugin. + +``` +fisher search shellder +> shellder by simnalamburt +Powerline prompt optimized for speed +github.com/simnalamburt/shellder +``` + +Search plugins using tags. + +``` +fisher search --tag={git,test} + ... +* fishtape TAP producing test runner + git-branch-name Get the name of the current Git branch + git-is-repo Test if the current directory is a Git repo + git-is-dirty Test if there are changes not staged for commit + git-is-stashed Test if there are changes in the stash + ... +``` + +## PLUMBING + +Fisherman commands are pipe aware. Plumb one with another to create complex functionality. + +Update all the plugins in the cache. + +```fish +fisher list | fisher update - +``` + +Install all the plugins that are currently disabled. + +```fish +fisher list --disabled | fisher install +``` + +## DOTFILES + +When you install a plugin, Fisherman updates a file known as *fishfile* to track what plugins are currently enabled. + +To customize its location: + +```fish +set -g fisher_file ~/.dotfiles/fishfile +``` + +## PLUGINS + +Plugins can be utilities, prompts, commands or snippets. + +### UTILITIES + +Utilities are plugins that define one or more functions which are mean to be used in the CLI directly by the user. + +This example walks you through creating *wtc*, a plugin based in *github/ngerakines/commitment* random commit message generator. + +* Create a directory and initialize a Git repository. + +```fish +mkdir wtc +cd wtc +git init +git remote add origin https://github.com//wtc +``` + +* Add the wtc function. + +```fish +function wtc -d "Generate a random commit message" + switch "$argv" + case -h --help + printf "Usage: wtc [--help]\n\n" + printf " -h --help Show usage help\n" + return + end + curl -s whatthecommit.com/index.txt +end +``` + +* Install the plugin. + +```fish +fisher install . +wtc +(\ /) +(O.o) +(> <) Bunny approves these changes. +``` + +* Commit changes and push to your remote origin when you are done. + +```fish +git add --all +git commit -m "What the commit?" +git push origin master +``` + +#### SUBMIT + +To submit wtc to the official index. + +```fish +fisher install submit +fisher submit +``` + +This will create a PR in the Fisherman index repository. Once the PR is approved, Fisherman users will be able to install wtc if they have the latest index. + +```fish +fisher install wtc +``` + +See `fisher help submit` for more submit options. + +#### COMPLETIONS + +Create a completions directory and add a completions file. + +```fish +mkdir completions +cat > completions/wtc.fish +complete --command wtc --short h --long help --description "Show usage help" +^ +``` + +Alternatively, use `__fisher_complete` to create completions from wtc usage output. + +``` +wtc --help | __fisher_complete wtc +``` + +#### MAN + +Create a man/man1 directory and add a man(1) page for wtc. + +There are utilities that can help you generate man pages from various text formats. For example, pandoc(1) and ronn(1). + +To create a man page manually. + +```fish +mkdir -p man/man1 +cat > man/man1/wtc.1 + + .TH man 1 "Today" "1.0" "wtc man page" + .SH NAME + wtc \- Generate a random commit message + .SH SYNOPSIS + wtc [--help] + .SH OPTIONS + -h, --help: Display help information. + .SH SEE ALSO + https://github.com/ngerakines/commitment +^C +``` + +#### DEPENDENCIES + +A plugin can list dependencies to other plugins using a *fishfile*. + +Create a new file in the root of your project and add the name or URL of your desired dependencies. + +```fish +cat > fishfile +my_plugin +https://github.com/owner/another_plugin +^D +``` + +### PROMPTS + +Prompts, also known as themes, are plugins that modify the appearance of the shell prompt. + +Create a `fish_prompt` function. + +```fish +function fish_prompt + printf "%s (%s) >> " (prompt_pwd) Fisherman +end +~ (Fisherman) >> type here +``` + +To add a right prompt, create a `fish_right_prompt` function. + +```fish +function fish_right_prompt + printf "%s" (date +%H:%M:%S) +end +``` + +Save the functions to a directory and install the prompt as a plugin. + +```fish +mkdir my_prompt +cd my_prompt +functions fish_prompt > fish_prompt.fish +functions fish_right_prompt > fish_right_prompt.fish +fisher install . +``` + +### COMMANDS + +Commands are plugins that extend the Fisherman CLI adding new `fisher `. + +Create a function `fisher_` + +```fish +function fisher_time -d "Say hello" + printf "It's %s\n" (date +%H:%M) +end +``` + +Test it works + +```fish +fisher time +It's 6:30 +``` + +Make it a plugin + + +```fish +fisher install fisher_time +``` + +This creates a new directory fisher_time in the current working directory and installs the plugin. + +The following example implements a command to format plugin information into columns. + +```fish +function fisher_info -d "Display information about plugins" + switch "$argv" + case -h --help + printf "Usage: fisher info [...]\n\n" + printf " -h --help Show usage help\n" + return + end + + for item in $argv + fisher search $item --name --info + end | sed -E 's/;/: /' | column +end + +fisher install fisher_info +``` + +### SNIPPETS + +Snippets are plugins that run code at the start of the shell. Snippets must be placed inside a sub directory named conf.d. + +The following example implements the fish_postexec hook to display the runtime of the last command in milliseconds. + +```fish +mkdir -p runtime/conf.d +cd runtime +cat > conf.d/fish_postexec.fish +function fish_postexec --on-event fish_postexec + printf "%sms\n" $CMD_DURATION > /dev/stderr +end +^D +fisher install ./postexec +``` + +## SEE ALSO + +fisher(1) diff --git a/man/man7/fisher.7 b/man/man7/fisher.7 new file mode 120000 index 0000000..a6d0070 --- /dev/null +++ b/man/man7/fisher.7 @@ -0,0 +1 @@ +/Users/bucaran/c/fisherman/fisherman/man/man7/fisher-tutorial.7 \ No newline at end of file diff --git a/man/man7/fisherman.7 b/man/man7/fisherman.7 new file mode 120000 index 0000000..a6d0070 --- /dev/null +++ b/man/man7/fisherman.7 @@ -0,0 +1 @@ +/Users/bucaran/c/fisherman/fisherman/man/man7/fisher-tutorial.7 \ No newline at end of file diff --git a/test/file.fish b/test/file.fish index bccffc7..b20f88b 100644 --- a/test/file.fish +++ b/test/file.fish @@ -1,9 +1,6 @@ set -l path $DIRNAME/.t-$TESTNAME-(random) set -l manifest $DIRNAME/fixtures/manifest -# __fisher_file parses a fishfile/bundle and writes declared plugins to standard out. -# URLs and paths are returned *as is*. To retrieve the plugin names use fisher --list - test "$TESTNAME - Parse a fishfile/bundle #1" (__fisher_file < $manifest/fishfile) = (cat $manifest/fishfile-parsed) end @@ -13,9 +10,5 @@ test "$TESTNAME - Parse a fishfile/bundle #2" end test "$TESTNAME - Remove `*` and `>` decorators from the input" - - # These characters indicate a plugin is enabled or a plugin is the - # currently selected prompt. - (printf "%s\n" "*plugin" ">theme" | __fisher_file) = plugin theme end diff --git a/test/fisher.fish b/test/fisher.fish index 0293ac2..18f1498 100644 --- a/test/fisher.fish +++ b/test/fisher.fish @@ -33,7 +33,7 @@ test "$TESTNAME - Handle \$fisher_alias aliases" end test "$TESTNAME - Display usage help" - (fisher | sed 1q) = "Usage: fisher [] [--list] [--version]" + (fisher | sed 1q) = "Usage: fisher [] [--help] [--version]" end test "$TESTNAME - Display basic information help info about 'help'" diff --git a/test/fixtures/help/usage.txt b/test/fixtures/help/usage.txt index 0c35998..f9b9299 100644 --- a/test/fixtures/help/usage.txt +++ b/test/fixtures/help/usage.txt @@ -4,18 +4,24 @@ Usage: fisher update [] [--quiet] [--help] -h --help Show usage help Usage: fisher uninstall [] [--force] [--quiet] [--help] - -f --force Delete copy from cache + -f --force Delete copy from the cache -q --quiet Enable quiet mode -h --help Show usage help -Usage: fisher search [] [--format=] [--and|--or] - [--no-color] [--quiet] [--help] +Usage: fisher search [] [--long] [--full] [--no-color] + [--quiet] [--help] - -a --and Join query with AND operator - -o --or Join query with OR operator - --no-color Turn off color display - --format= Use format to display results - -q --quiet Enable quiet mode - -h --help Show usage help + --long Display results in long format + --full Display results in full format + -C --no-color Turn off color display + -q --quiet Enable quiet mode + -h --help Show usage help +Usage: fisher list [] [--enabled] [--disabled] [--bare] [--link] + + -b --bare List plugin without decorators + -l --link List plugins that are symbolic links + --enabled List plugins that are enabled + --disabled List plugins that are disabled + -h --help Show usage help Usage: fisher install [] [--force] [--quiet] [--help] -f --force Reinstall given plugin/s @@ -23,7 +29,6 @@ Usage: fisher install [] [--force] [--quiet] [--help] -h --help Show usage help Usage: fisher help [] [--all] [--guides] [--help] - -a --all List available documentation - -g --guides List available guides - -h --help Show usage help - --usage[=] Display command usage + -a --all List all the documentation + -g --guides List available guides + -h --help Show usage help diff --git a/test/fixtures/manifest/fishfile b/test/fixtures/manifest/fishfile index 4ac6aad..34950e5 100644 --- a/test/fixtures/manifest/fishfile +++ b/test/fixtures/manifest/fishfile @@ -2,7 +2,7 @@ # # The fishfile is your ship's log and tells your adventures across the # 7 seas and beyond. The old Fisherman will keep track of your plugins -# in this file. Plugins can be names, urls or paths. +# in this file. Plugins can be names, URLs or paths. # # Comments and empty lines are never removed. You are the captain! # @@ -14,20 +14,12 @@ # If you would like to restore a previous Fisherman installation, you # can do so too: # -# fisher install < you/old/fishfile -# -# If you have upgraded from an Oh My Fish! setup, you can feed bundle -# file instead of a fishfile too. Fisherman will take care of it. +# fisher install < your/good/old/fishfile foo bar baz -# Oh My Bundle? Add 'plugin-' or 'theme-' prefixes. - -package norf -theme zerg - # Plugins installed from unknown URLs look like this. https://github.com/quux/quux diff --git a/test/fixtures/manifest/fishfile-no-comments b/test/fixtures/manifest/fishfile-no-comments index 36e51f3..0c11b42 100644 --- a/test/fixtures/manifest/fishfile-no-comments +++ b/test/fixtures/manifest/fishfile-no-comments @@ -1,8 +1,6 @@ foo bar baz -package norf -theme zerg https://github.com/quux/quux https://github.com/quux/pkg-hoge https://github.com/quux/omf-theme-foobar diff --git a/test/fixtures/manifest/fishfile-parsed b/test/fixtures/manifest/fishfile-parsed index 1604190..2c6fd60 100644 --- a/test/fixtures/manifest/fishfile-parsed +++ b/test/fixtures/manifest/fishfile-parsed @@ -1,8 +1,6 @@ foo bar baz -https://github.com/oh-my-fish/plugin-norf -https://github.com/oh-my-fish/theme-zerg https://github.com/quux/quux https://github.com/quux/pkg-hoge https://github.com/quux/omf-theme-foobar diff --git a/test/list-fishfile.fish b/test/list-fishfile.fish index 9bd89c7..d29558a 100644 --- a/test/list-fishfile.fish +++ b/test/list-fishfile.fish @@ -2,10 +2,10 @@ set -l manifest $DIRNAME/fixtures/manifest set -l plugins foo bar baz norf zerg quux hoge foobar fred thud chomp boo loo gisty -test "$TESTNAME - Parse fishfile and retrieve plugin names with fisher --list=fishfile" +test "$TESTNAME - Parse fishfile and retrieve plugin names with fisher list fishfile" - # We use fisher --list= to parse and then extract the plugin's name + # We use fisher list to parse and then extract the plugin's name # as it will be used by the CLI. See also `test/name.fish`. - (fisher --list=$manifest/fishfile) = $plugins + (fisher list $manifest/fishfile) = $plugins end diff --git a/test/list.fish b/test/list.fish index 0729007..bf0deec 100644 --- a/test/list.fish +++ b/test/list.fish @@ -11,7 +11,7 @@ function -S setup set -g fisher_cache $path/cache # Fisherman uses the Fishfile to keep track of what plugins are currently installed - # so we need to create one in order to test all of fisher --list=. + # so we need to create one in order to test all of fisher list=. # See also `list-fishfile.fish`. @@ -26,73 +26,61 @@ function -S teardown functions -e git end -test "$TESTNAME - Wrap fisher -l with __fisher_list" - (__fisher_list) = (fisher -l) -end - -test "$TESTNAME - Wrap fisher --list=cache with fisher --list" - (fisher --list) = (fisher --list=cache) -end - -test "$TESTNAME - Wrap fisher --list with --list=all " - (fisher --list) = (fisher --list=all) -end - test "$TESTNAME - Append > to active theme" - (fisher --list | sed -n '/>.*/p') = ">theme" + (fisher list | sed -n '/>.*/p') = "> theme" end test "$TESTNAME - Append * to active plugins" - (fisher --list | sed -n '/\*.*/p' | xargs) = "*bar *baz *foo" + (fisher list | sed -n '/\*.*/p' | xargs) = "* bar * baz * foo" end test "$TESTNAME - Add one space indentation to disabled plugins to align with > and *" - (fisher --list | sed '/^[\*>].*/d') = " norf" + (fisher list | sed '/^[\*>].*/d') = " norf" end test "$TESTNAME - Do not add indentation when no plugins are enabled" - (rm $path/fishfile; fisher --list) = ( + (rm $path/fishfile; fisher list) = ( for plugin in foo bar baz norf theme echo $plugin end ) end -test "$TESTNAME - Wrap fisher --list=bare with __fisher_cache_list" - (fisher --list=bare) = (__fisher_cache_list) +test "$TESTNAME - Wrap fisher list=bare with __fisher_cache_list" + (fisher list --bare) = (__fisher_cache_list) end -test "$TESTNAME - Get URL from path (__fisher_url_from_path) with fisher --list=url" - (fisher --list=url) = ( - for plugin in foo bar baz theme norf - switch "$plugin" - case theme - echo $path/theme - case norf - echo $plugin@https://gist.github.com/$plugin - case \* - echo https://github.com/$plugin/$plugin - end - end - ) -end +# test "$TESTNAME - Get URL from path (__fisher_url_from_path) with fisher list=url" +# (fisher list --url) = ( +# for plugin in foo bar baz theme norf +# switch "$plugin" +# case theme +# echo $path/theme +# case norf +# echo $plugin@https://gist.github.com/$plugin +# case \* +# echo https://github.com/$plugin/$plugin +# end +# end +# ) +# end -test "$TESTNAME - Show active / enabled plugins/prompts with fisher --list=enabled" - foo bar baz theme = (fisher --list=enabled) +test "$TESTNAME - Show active / enabled plugins/prompts with fisher list=enabled" + foo bar baz theme = (fisher list --enabled) end -test "$TESTNAME - Show disabled/inactive plugins/prompts with fisher --list=disabled" - (fisher --list=disabled) = norf +test "$TESTNAME - Show disabled/inactive plugins/prompts with fisher list=disabled" + (fisher list --disabled) = norf end -test "$TESTNAME - Shadow fisher --list=theme to fisher --list=prompt" - (fisher --list=theme) = (fisher --list=prompt) -end - -test "$TESTNAME - Return the contents of \$fisher_prompt fisher --list=theme|prompt" - (fisher --list=prompt) = theme -end +# test "$TESTNAME - Shadow fisher list=theme to fisher list=prompt" +# (fisher list=theme) = (fisher list=prompt) +# end +# +# test "$TESTNAME - Return the contents of \$fisher_prompt fisher list=theme|prompt" +# (fisher list=prompt) = theme +# end -test "$TESTNAME - Parse a fishfile and display plugins with fisher --list=" - foo bar baz theme = (fisher --list=$fisher_file) +test "$TESTNAME - Parse a fishfile and display plugins with fisher list=" + foo bar baz theme = (fisher list $fisher_file) end diff --git a/test/plugin-unlink.fish b/test/plugin-unlink.fish index 1ed35a4..62258e7 100644 --- a/test/plugin-unlink.fish +++ b/test/plugin-unlink.fish @@ -6,7 +6,7 @@ function -S setup echo "function foo; end" > $path/foo.fish source $path/foo.fish - __fisher_plugin_unlink foo $path/foo.fish + __fisher_plugin_unlink $path/foo.fish foo end function -S teardown diff --git a/test/search.fish b/test/search.fish index 86a653b..4d74db9 100644 --- a/test/search.fish +++ b/test/search.fish @@ -41,10 +41,6 @@ test "$TESTNAME - Get only authors from index" foosmith barsmith bazsmith foobarson = (fisher search --author) end -test "$TESTNAME - Get full record" - "foo" "https://github.com/foo" "about foo" "foo" "foosmith" = (fisher search --format=raw --name=foo --no-color) -end - test "$TESTNAME - Match name and get name" "foo" = (fisher search --name=foo --name) end @@ -100,7 +96,3 @@ end test "$TESTNAME - Match field and get multiple fields #2" "foosmith;foo" "foobarson;bar" = (fisher search --name~/^f/ --author --tags) end - -test "$TESTNAME - Get full index" - (fisher search --format=raw) = (cat $fisher_cache/.index) -end diff --git a/test/validate-file.fish b/test/validate-path.fish similarity index 83% rename from test/validate-file.fish rename to test/validate-path.fish index f5bd467..8c0f758 100644 --- a/test/validate-file.fish +++ b/test/validate-path.fish @@ -34,11 +34,14 @@ test "$TESTNAME - Clean up unusual paths" end test "$TESTNAME - Fail phoney paths" - -z (__fisher_plugin_validate /(random)/(random)) + 1 -eq ( + __fisher_plugin_validate /(random)/(random) > /dev/null + echo $status + ) end for invalid_path in ".." "../" test "$TESTNAME - Do not allow to install '$invalid_path' like paths" - -z (__fisher_plugin_validate $invalid_path) + "../" = (__fisher_plugin_validate $invalid_path) end end