mirror of
https://github.com/jorgebucaran/fisher
synced 2024-11-09 07:10:27 +00:00
Introducting Fisherman's official website:
www.fisherman.sh Still a WIP. Powered by Jekyll and hosted by GitHub pages. * Refactor fisher install / fisher uninstall by extracting the logic to enable / disable plugins into __fisher_plugin. The algorithm to enable/disable plugins is essentially the same. The only difference is enable, copies/symlinks files and disable removes them from $fisher_config/.... Closes #45. * Add support for legacy oh-my-fish! plugins using .load initialization files. Closes #35. * Add support for Tackle Fish framework initialization modules. Closes #35. * Add support for plugins that share scripts in languages like Python or Perl. For example oh-my-fish/plugin-vi-mode assumes there is a vi-mode-impl.py file in the same path of the running script. This opens the door for including code snippets in other languages. * Any files inside a share directory, except for *.md or *.fish files, are copied to $fisher_config/functions. This allows you to run legacy plugins that retrieve the currently running script path with (dirname (status -f)) out of the box. * A cleaner alternative is using the new $fisher_share variable like this: python $fisher_share/my_plugin_script.py. * $fisher_share points to $fisher_config/share by default, but you may change this in your user config.fish. This path contains copies (or symbolic links) to the same script files copied to $fisher_config/functions. * Introduce the $fisher_share_extensions variable to let you customize what extensions Fisherman is aware of. Only extensions in this array will be processed during the install process. The default is py rb php pl awk sed. * .fish and .md extensions are always ignored. * Remove ad-hoc debug d function created by mistake in the Fisherman config.fish file. Closes #34. * Remove almost useless fisher --alias. You can still create aliases using $fisher_alias. It's difficult to add auto-complete to this feature, and even if we do so, it is slow. * Fix bug introduced in the previous release caused by swapping the lines that calculate the index of the current plugin being installed/updated/uninstalled and the line that displays the value, causing the CLI to show incorrect values. Closes #36. Thanks @kballard * Add cache, enabled and disabled options to fisher --list. Now you can type fisher -l enabled to get a list of what plugins are currently enabled. * Add new $fisher_plugins universal variable to keep track of what plugins are enabled / disabled. * Update completions after a plugin is installed, updated or uninstalled. * Improve autocomplete speed by removing the descriptions from plugins installed with custom URLs. * fisher --list displays nothing and returns 1 when there are no plugins installed. Closes #38. * fisher uninstall does not attempt to uninstall plugins already disabled by looking at the $fisher_plugins array. --force will bypass this. Closes #40
This commit is contained in:
parent
22eca42e57
commit
eae01edf51
@ -1,3 +1,4 @@
|
||||
# Authors
|
||||
* Jorge Bucaran <[j@bucaran.me](mailto:j@bucaran.me)>
|
||||
* Hyeon Kim <[simnalamburt@gmail.com](mailto:simnalamburt@gmail.com)>
|
||||
* Kevin Ballard <[kevin@sb.org](mailto:kevin@sb.org)>
|
||||
|
68
CHANGELOG.md
68
CHANGELOG.md
@ -1,11 +1,59 @@
|
||||
# Change Log
|
||||
|
||||
+ [0.4.0](#040) :gem:
|
||||
* [0.3.1](#031)
|
||||
* [0.3.0](#030)
|
||||
* [0.2.0](#020)
|
||||
* [0.1.0](#010)
|
||||
|
||||
|
||||
## [0.4.0][v040] - 2016-01-11
|
||||
|
||||
:anchor: Introducting Fisherman's official website :construction:
|
||||
|
||||
<a href="http://fisherman.sh">
|
||||
<img src="https://cloud.githubusercontent.com/assets/8317250/12229311/c0eea838-b889-11e5-94eb-280d95fbdd49.png">
|
||||
</a>
|
||||
|
||||
. Powered by Jekyll and hosted by GitHub pages.
|
||||
|
||||
* Refactor `fisher install` / `fisher uninstall` by extracting the logic to enable / disable plugins into `__fisher_plugin`. The algorithm to enable/disable plugins is essentially the same. The only difference is _enable_, copies/symlinks files and disable removes them from `$fisher_config/...`. Closes #45.
|
||||
|
||||
* Add support for legacy oh-my-fish! plugins using `.load` initialization files. Closes #35.
|
||||
|
||||
* Add support for [Tackle](https://github.com/justinmayer/tackle) Fish framework initialization modules. Closes #35.
|
||||
|
||||
* :gem: Add support for plugins that share scripts in languages like Python or Perl. For example `oh-my-fish/plugin-vi-mode` assumes there is a `vi-mode-impl.py` file in the same path of the running script. This opens the door for including code snippets in other languages.
|
||||
|
||||
* Any files inside a `share` directory, except for `*.md` or `*.fish` files, are copied to `$fisher_config/functions`. This allows you to run legacy plugins that retrieve the currently running script path with `(dirname (status -f))` out of the box.
|
||||
|
||||
* A cleaner alternative is using the new `$fisher_share` variable like this: `python $fisher_share/my_plugin_script.py`.
|
||||
|
||||
* `$fisher_share` points to `$fisher_config/share` by default, but you may change this in your user `config.fish`. This path contains copies (or symbolic links) to the same script files copied to `$fisher_config/functions`.
|
||||
|
||||
* Introduce the `$fisher_share_extensions` variable to let you customize what extensions Fisherman is aware of. Only extensions in this array will be processed during the install process. The default is `py rb php pl awk sed`.
|
||||
|
||||
* `.fish` and `.md` extensions are always ignored.
|
||||
|
||||
|
||||
* Remove ad-hoc debug `d` function created by mistake in the Fisherman config.fish file. Closes #34.
|
||||
|
||||
* Remove almost useless `fisher --alias`. You can still create aliases using `$fisher_alias`. It's difficult to add auto-complete to this feature, and even if we do so, it is slow.
|
||||
|
||||
* Fix bug introduced in the previous release caused by swapping the lines that calculate the index of the current plugin being installed/updated/uninstalled and the line that displays the value, causing the CLI to show incorrect values. Closes #36. Thanks @kballard
|
||||
|
||||
* Add `cache`, `enabled` and `disabled` options to `fisher --list`. Now you can type `fisher -l enabled` to get a list of what plugins are currently enabled.
|
||||
|
||||
* Add new `$fisher_plugins` universal variable to keep track of what plugins are enabled / disabled.
|
||||
|
||||
* Update completions after a plugin is installed, updated or uninstalled.
|
||||
|
||||
* Improve autocomplete speed by removing the descriptions from plugins installed with custom URLs.
|
||||
|
||||
* `fisher --list` displays nothing and returns 1 when there are no plugins installed. Closes #38.
|
||||
|
||||
* `fisher uninstall` does not attempt to uninstall plugins already disabled by looking at the `$fisher_plugins` array. `--force` will bypass this. Closes #40
|
||||
|
||||
## [0.3.1][v031] - 2016-01-10
|
||||
|
||||
> This patch contains several amends for 0.3.0 and other minor documentation corrections.
|
||||
@ -43,13 +91,13 @@
|
||||
|
||||
* Add feature to Makefile to download the index for the first time in order to provide auto-complete before the user can install/update/search, actions which would case the index to be updated.
|
||||
|
||||
* Add link to Slack [room][wharf] in README. Thanks @simnalamburt.
|
||||
* Add link to Slack [room](http://fisherman-wharf.herokuapp.com/) in README. Thanks @simnalamburt.
|
||||
|
||||
* Add new `$fisher_timeout` configuration variable that lets you specify `curl(1)` `--max-time` option. Without this, `curl` could hang for a long time if you are in a bad connection.
|
||||
|
||||
* Add `fisher install --link` to allow installing plugins creating a symbolic link to each of the relevant files to be copied during the install process. If you use ***`--link`*** to install a plugin that is a _path to a directory_ or file, a symbolic link to the directory will be created making local testing more convenient as you are not required to update the plugin's repository to test changes within Fisherman. If you are testing using [Fishtape][fishtape] you do not even need to reset the shell session.
|
||||
* Add `fisher install --link` to allow installing plugins creating a symbolic link to each of the relevant files to be copied during the install process. If you use ***`--link`*** to install a plugin that is a _path to a directory_ or file, a symbolic link to the directory will be created making local testing more convenient as you are not required to update the plugin's repository to test changes within Fisherman. If you are testing using [Fishtape](https://github.com/fisherman/fishtape) you do not even need to reset the shell session.
|
||||
|
||||
* Add `fisher --alias[=<command>=<alias>]` to simplify creating new aliases for `fisher` commands. Use `fisher --alias` without arguments to list the current set of aliases. Also add auto-complete for aliases to install, update or uninstall. Note that aliases are **not** persisted this way. To save your aliases use `$fisher_alias` as described in `fisher help config`. Also note that aliases are only auto-complete if you call `fisher --alias`. To auto-complete aliases saved to `$fisher_alias` you can do `fisher --alias (fisher --alias)`.
|
||||
* ~~Add `fisher --alias[=<command>=<alias>]` to simplify creating new aliases for `fisher` commands. Use `fisher --alias` without arguments to list the current set of aliases. Also add auto-complete for aliases to install, update or uninstall. Note that aliases are **not** persisted this way. To save your aliases use `$fisher_alias` as described in `fisher help config`. Also note that aliases are only auto-complete if you call `fisher --alias`. To auto-complete aliases saved to `$fisher_alias` you can do `fisher --alias (fisher --alias)`.~~
|
||||
|
||||
* Add short options for new and old fisher flags:
|
||||
|
||||
@ -104,11 +152,11 @@
|
||||
|
||||
* Fix a bug where `mktemp` would fail in some systems. Closes #7. Thanks @tobywf.
|
||||
|
||||
* Add [CODE_OF_CONDUCT][code_of_conduct]. Closes #6.
|
||||
* Add [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md). Closes #6.
|
||||
|
||||
* Fisherman can now unload themes within the same shell, without having to restart the session. Closes #5.
|
||||
|
||||
* Fisherman can now load themes within the same shell, without having to restart the session using `exec fish`. Shoddy themes, for example those failing to declare global variables with the `-g` flag still require the session to be reset. See [**related**][bobthefish-19]. Closes #4.
|
||||
* Fisherman can now load themes within the same shell, without having to restart the session using `exec fish`. Shoddy themes, for example those failing to declare global variables with the `-g` flag still require the session to be reset. See [**related**](https://github.com/oh-my-fish/theme-bobthefish/pull/19). Closes #4.
|
||||
|
||||
* Move `getopts` implementation to `share/getopts.awk`. Closes #3.
|
||||
|
||||
@ -126,6 +174,8 @@
|
||||
|
||||
<!-- Links -->
|
||||
|
||||
[v040]: https://
|
||||
|
||||
[v031]: https://github.com/fisherman/fisherman/commit/a0fe0b339df2fe70a0ba1a5e28dcd7449582742b
|
||||
|
||||
[v030]: https://github.com/fisherman/fisherman/commit/19758f98ab349e81d73fa8d813d06ee00a0fcb24
|
||||
@ -133,11 +183,3 @@
|
||||
[v020]: https://github.com/fisherman/fisherman/commit/54212e1cbce66c7671baa045653efe912dbb4b77
|
||||
|
||||
[v010]: https://github.com/fisherman/fisherman/commit/3386ed052ae4a84338c340d37b98c1742f8a45f6
|
||||
|
||||
[bobthefish-19]: https://github.com/oh-my-fish/theme-bobthefish/pull/19
|
||||
|
||||
[code_of_conduct]: CODE_OF_CONDUCT.md
|
||||
|
||||
[fishtape]: https://github.com/fisherman/fishtape
|
||||
|
||||
[wharf]: http://fisherman-wharf.herokuapp.com/
|
||||
|
@ -1,7 +1,5 @@
|
||||
# Contributing to Fisherman
|
||||
|
||||
[![Wharf][wharf-badge]][wharf-link]
|
||||
|
||||
If you are looking for ways to help, peruse the [open issues][issues]. If you are already working on something, feel free to send us a PR.
|
||||
|
||||
## Guidelines
|
||||
@ -14,32 +12,24 @@ If you are looking for ways to help, peruse the [open issues][issues]. If you ar
|
||||
|
||||
* Follow the [seven rules][seven-rules] of a great git commit message.
|
||||
|
||||
|
||||
## Plugins
|
||||
|
||||
Third-party plugins are essential for keeping this project exciting. To learn how to create your own plugins and other extensions see `fisher help plugins`.
|
||||
|
||||
To browse the available content use `fisher search` or see the [Fisherman Index][fisher-index].
|
||||
|
||||
|
||||
:anchor:
|
||||
|
||||
|
||||
<!-- Links -->
|
||||
|
||||
[org]: https://github.com/fisherman
|
||||
|
||||
[bugs]: https://github.com/fisherman/fisherman/issues
|
||||
|
||||
[issues]: https://github.com/fisherman/fisherman/issues?q=is%3Aopen+is%3Aissue
|
||||
|
||||
[fishtape]: https://github.com/fisherman/fishtape
|
||||
|
||||
[fish-docs]: http://fishshell.com/docs/current/index.html
|
||||
|
||||
[seven-rules]: http://chris.beams.io/posts/git-commit/#seven-rules
|
||||
|
||||
[fisher-index]: https://github.com/fisherman/fisher-index
|
||||
|
||||
[wharf-link]: https://fisherman-wharf.herokuapp.com/
|
||||
|
||||
[wharf-badge]: https://img.shields.io/badge/wharf-join%20the%20chat-00cc99.svg?style=flat-square
|
||||
|
2
Makefile
2
Makefile
@ -28,7 +28,7 @@ all: $(FISH_CONFIG) $(FISHER_CACHE) $(AUTHORS) $(DOCS)
|
||||
echo "Downloading the index for the first time...";\
|
||||
fish -c "fisher_update --index";\
|
||||
fi
|
||||
@$(call MSG,"Reset your shell and type 'fisher <command>' to use Fisherman")
|
||||
@$(call MSG,"Ahoy! Reset your shell and type 'fisher <command>'")
|
||||
@fish -c "fisher help -a" | sed -n '3,$$p'
|
||||
|
||||
test:
|
||||
|
46
README.md
46
README.md
@ -1,22 +1,24 @@
|
||||
<p align="center">
|
||||
<a href="http://github.com/fisherman/fisherman">
|
||||
<a href="http://fisherman.sh">
|
||||
<img alt="Fisherman" width=620px src="https://cloud.githubusercontent.com/assets/8317250/10865127/daa0e138-8044-11e5-91f9-f72228974552.png">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
|
||||
[![Build Status][travis-badge]][travis-link]
|
||||
![Fisherman Version][fisherman-version]
|
||||
[![Wharf][wharf-badge]][wharf-link]
|
||||
|
||||
## About
|
||||
|
||||
Fisherman is a plugin manager for [fish][fish] that lets you share and reuse code, prompts and configurations easily.
|
||||
Fisherman is a plugin manager and CLI toolkit for [Fish][fish] to help you build powerful utilities and share your code easily.
|
||||
|
||||
Features include a flat tree structure, external self-managed database, cache system, plugin dependencies and compatibility with Oh My Fish! packages.
|
||||
Fisherman uses a [flat tree][flat-tree] structure that adds no cruft to your shell, making it as fast as no Fisherman. The cache mechanism lets you query the index offline and enable or disable plugins as you wish.
|
||||
|
||||
+ See [FAQ][faq].
|
||||
+ See [Screencasts][screencasts].
|
||||
Other features include dependency management, great plugin search capabilities and full compatibility with [Tackle][tackle], [Wahoo][wahoo] and [oh-my-fish][oh-my-fish] themes and packages.
|
||||
|
||||
+ [FAQ][faq]
|
||||
+ [Screencasts][screencasts]
|
||||
+ [An Introduction to Fisherman][intro]
|
||||
|
||||
|
||||
## Install
|
||||
@ -27,13 +29,10 @@ cd fisherman
|
||||
make
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Check out the [contribution](CONTRIBUTING.md) guidelines.
|
||||
## Documentation
|
||||
|
||||
## Help
|
||||
|
||||
See [`fisher(1)`][fisher-1] and [`fisher(7)`][fisher-7] for usage and documentation. For support and feedback join the Slack [room][wharf-link] or browse the [issues][issues].
|
||||
See [`fisher help`][fisher-1] and [`fisher help tour`][fisher-tour] for command usage help. For support and feedback join the Slack [room][wharf-link] or browse the [issues][issues].
|
||||
|
||||
|
||||
:anchor:
|
||||
@ -41,14 +40,19 @@ See [`fisher(1)`][fisher-1] and [`fisher(7)`][fisher-7] for usage and documentat
|
||||
|
||||
<!-- Links -->
|
||||
|
||||
[fish]: https://github.com/fish-shell/fish-shell
|
||||
[faq]: https://github.com/fisherman/fisherman/wiki/FAQ
|
||||
[issues]: http://github.com/fisherman/fisherman/issues
|
||||
[wharf-link]: https://fisherman-wharf.herokuapp.com/
|
||||
[wharf-badge]: https://img.shields.io/badge/wharf-join%20the%20chat-00cc99.svg?style=flat-square
|
||||
[screencasts]: https://github.com/fisherman/fisherman/wiki/Screencasts
|
||||
[fisher-1]: man/man1/fisher.md
|
||||
[fisher-7]: man/man7/fisher.md
|
||||
[travis-link]: https://travis-ci.org/fisherman/fisherman
|
||||
[travis-badge]: https://img.shields.io/travis/fisherman/fisherman.svg?style=flat-square
|
||||
[faq]: https://github.com/fisherman/fisherman/wiki/FAQ
|
||||
[fish]: https://github.com/fish-shell/fish-shell
|
||||
[intro]: ...
|
||||
[wahoo]: https://github.com/bucaran/wahoo
|
||||
[issues]: http://github.com/fisherman/fisherman/issues
|
||||
[tackle]: https://github.com/justinmayer/tackle
|
||||
[fisher-1]: man/man1/fisher.md
|
||||
[flat-tree]: https://github.com/fisherman/fisherman/blob/master/man/man7/fisher.md#flat-tree
|
||||
[oh-my-fish]: https://github.com/oh-my-fish/oh-my-fish/
|
||||
[wharf-link]: https://fisherman-wharf.herokuapp.com/
|
||||
[fisher-tour]: man/man7/fisher.md
|
||||
[wharf-badge]: https://img.shields.io/badge/wharf-join%20the%20chat-00cc99.svg?style=flat-square
|
||||
[screencasts]: https://github.com/fisherman/fisherman/wiki/Screencasts
|
||||
[travis-link]: https://travis-ci.org/fisherman/fisherman
|
||||
[travis-badge]: https://img.shields.io/travis/fisherman/fisherman.svg?style=flat-square
|
||||
[fisherman-version]: https://img.shields.io/badge/fisherman-v0.3.1-00B9FF.svg?style=flat-square
|
||||
|
@ -1,29 +1,40 @@
|
||||
complete -xc fisher -d "Ahoy! Fisherman"
|
||||
|
||||
complete -c fisher -n "__fish_seen_subcommand_from search" -a "\t"
|
||||
complete -c fisher -n "__fish_use_subcommand" -s l -l list -d "List plugins in the cache"
|
||||
complete -c fisher -n "__fish_use_subcommand" -s f -l file -d "Read a fishfile"
|
||||
complete -c fisher -n "__fish_use_subcommand" -s h -l help -d "Display help"
|
||||
complete -c fisher -n "__fish_use_subcommand" -s a -l alias -d "Define command aliases"
|
||||
complete -c fisher -n "__fish_use_subcommand" -s v -l version -d "Show version information"
|
||||
|
||||
set -l IFS ";"
|
||||
|
||||
for option in commands guides
|
||||
fisher_help --$option=bare | sed -E 's/^ *([^ ]+) *(.*)/\1;\2/' | while read -l cmd info
|
||||
|
||||
complete -c fisher -n "__fish_seen_subcommand_from help" -a $cmd -d "$info"
|
||||
|
||||
if test $option = guides
|
||||
continue
|
||||
end
|
||||
if test $option != guides
|
||||
complete -c fisher -n "__fish_use_subcommand" -a $cmd -d "$info"
|
||||
|
||||
complete -c fisher -n "__fish_use_subcommand" -a $cmd -d "$info"
|
||||
|
||||
fisher_help --usage=$cmd | __fisher_complete OFS=';' | while read -l 1 2 3
|
||||
complete -c fisher -n "__fish_seen_subcommand_from $cmd" -s "$3" -l "$2" -d "$1"
|
||||
fisher_help --usage=$cmd | __fisher_parse_help OFS=';' | while read -l 1 2 3
|
||||
complete -c fisher -n "__fish_seen_subcommand_from $cmd" -s "$3" -l "$2" -d "$1"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
__fisher_complete_cache update uninstall
|
||||
__fisher_complete_remote install
|
||||
begin
|
||||
|
||||
for plugin in (__fisher_list)
|
||||
printf "%s;%s\n" $plugin ""
|
||||
end
|
||||
|
||||
awk -F '\n' -v RS='' -v OFS=';' '/^ *#/ { next } { print $1, $3 }' $fisher_cache/.index
|
||||
|
||||
end | while read -l name info
|
||||
if contains -- $name $fisher_plugins
|
||||
complete -c fisher -n "__fish_seen_subcommand_from u update un uninstall" -a "$name" -d "$info"
|
||||
else
|
||||
complete -c fisher -n "__fish_seen_subcommand_from install i" -a "$name" -d "$info"
|
||||
end
|
||||
end
|
||||
|
||||
complete -c fisher -n "__fish_seen_subcommand_from search" -a "\t"
|
||||
complete -c fisher -n "__fish_use_subcommand" -s l -l list -d "List plugins in the cache"
|
||||
complete -c fisher -n "__fish_use_subcommand" -s f -l file -d "Read fishfiles"
|
||||
complete -c fisher -n "__fish_use_subcommand" -s h -l help -d "Display help"
|
||||
complete -c fisher -n "__fish_use_subcommand" -s v -l version -d "Show version information"
|
||||
|
||||
complete -xc fisher -d "Ahoy! Fisherman"
|
||||
|
@ -5,6 +5,6 @@ complete -xc wait -d "Run commands and wait with a spin"
|
||||
complete -xc wait -n "not __fish_seen_subcommand_from --spin" -a "\t"
|
||||
|
||||
set -l IFS \t
|
||||
wait -h | __fisher_complete | while read -l 1 2 3
|
||||
wait -h | __fisher_parse_help | while read -l 1 2 3
|
||||
complete -c wait -s "$3" -l "$2" -d "$1"
|
||||
end
|
||||
|
19
config.fish
19
config.fish
@ -1,17 +1,12 @@
|
||||
set fisher_cache $fisher_config/cache
|
||||
set fisher_index https://raw.githubusercontent.com/fisherman/fisher-index/master/INDEX
|
||||
set -g fisher_cache $fisher_config/cache
|
||||
set -g fisher_share $fisher_config/share
|
||||
set -g fisher_index https://raw.githubusercontent.com/fisherman/fisher-index/master/INDEX
|
||||
|
||||
set fisher_error_log $fisher_cache/.debug_log
|
||||
set -g fisher_error_log $fisher_cache/.debug_log
|
||||
|
||||
set fisher_timeout 5
|
||||
set -g fish_function_path {$fisher_config,$fisher_home}/functions $fish_function_path
|
||||
set -g fish_complete_path {$fisher_config,$fisher_home}/completions $fish_complete_path
|
||||
|
||||
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
|
||||
for file in $fisher_config/conf.d/*.fish
|
||||
source $file
|
||||
end
|
||||
|
||||
function d
|
||||
printf "((%s))\n" $argv >&2
|
||||
end
|
||||
|
@ -1,35 +0,0 @@
|
||||
function __fisher_alias -a value -d "Define command aliases"
|
||||
switch "$value"
|
||||
case ""
|
||||
if test -z "$fisher_alias"
|
||||
return 1
|
||||
end
|
||||
|
||||
printf "%s\n" $fisher_alias | sed 's/[=,]/ /g'
|
||||
|
||||
case \*
|
||||
for value in $argv
|
||||
if contains -- $fisher_alias $value
|
||||
continue
|
||||
end
|
||||
|
||||
set -g fisher_alias $fisher_alias $value
|
||||
|
||||
set -l index $fisher_cache/.index
|
||||
|
||||
if not test -e $index
|
||||
continue
|
||||
end
|
||||
|
||||
for alias in (__fisher_alias)
|
||||
switch $alias
|
||||
case install\*
|
||||
__fisher_complete_remote $alias
|
||||
|
||||
case update\* uninstall\*
|
||||
__fisher_complete_cache $alias
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -1,7 +0,0 @@
|
||||
function __fisher_complete_cache -d "Add auto-complete for cached plugins"
|
||||
set -l IFS ";"
|
||||
fisher_search --index=$fisher_cache/.index --select=cache --name --info \
|
||||
| while read -l name info
|
||||
complete -c fisher -n "__fish_seen_subcommand_from $argv" -a "$name" -d "$info"
|
||||
end
|
||||
end
|
@ -1,7 +0,0 @@
|
||||
function __fisher_complete_remote -d "Add auto-complete for remote plugins"
|
||||
set -l IFS ";"
|
||||
fisher_search --index=$fisher_cache/.index --select=remote --name --info \
|
||||
| while read -l name info
|
||||
complete -c fisher -n "__fish_seen_subcommand_from $argv" -a "$name" -d "$info"
|
||||
end
|
||||
end
|
7
functions/__fisher_copy.fish
Normal file
7
functions/__fisher_copy.fish
Normal file
@ -0,0 +1,7 @@
|
||||
function __fisher_copy -a option source target -d "cp/ln wrapper"
|
||||
if test "$option" = link
|
||||
ln -sfF $source $target
|
||||
else
|
||||
cp -f $source $target
|
||||
end
|
||||
end
|
@ -1,19 +1,15 @@
|
||||
function __fisher_file -a file -d "Read a fishfiles"
|
||||
switch "$file"
|
||||
case ""
|
||||
set file $fisher_config/fishfile
|
||||
|
||||
case "-"
|
||||
set file /dev/stdin
|
||||
end
|
||||
|
||||
function __fisher_file -d "read one or more fishfiles"
|
||||
awk '
|
||||
!/^ *(#.*)*$/ {
|
||||
gsub("#.*", "")
|
||||
|
||||
if (/^ *package .+/) $1 = $2
|
||||
if (/^ *package .+/) {
|
||||
$1 = $2
|
||||
}
|
||||
|
||||
if (!duplicates[$1]++) printf("%s\n", $1)
|
||||
if (!duplicates[$1]++) {
|
||||
printf("%s\n", $1)
|
||||
}
|
||||
}
|
||||
' $argv
|
||||
end
|
||||
|
@ -1,7 +1,23 @@
|
||||
function __fisher_list -d "List plugins in the cache"
|
||||
for file in $fisher_cache/*
|
||||
if test -d $file
|
||||
basename $file
|
||||
end
|
||||
function __fisher_list -a category -d "list local plugins by category"
|
||||
set index $fisher_cache/.index
|
||||
|
||||
switch "$category"
|
||||
case enabled installed on
|
||||
printf "%s\n" $fisher_plugins
|
||||
|
||||
case \*
|
||||
for file in $fisher_cache/*
|
||||
set -l name (basename $file)
|
||||
|
||||
switch "$category"
|
||||
case disabled off
|
||||
if not contains -- $name $fisher_plugins
|
||||
printf "%s\n" $name
|
||||
end
|
||||
|
||||
case \*
|
||||
printf "%s\n" $name
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,3 +1,3 @@
|
||||
function __fisher_name -d "Create pretty name from a plugin path or URL"
|
||||
function __fisher_name -d "get plugin name from url or path"
|
||||
sed -E 's|.*/(.*)|\1|; s/^(plugin|theme|pkg|omf|fish|fisher)-//'
|
||||
end
|
||||
|
@ -1,13 +1,4 @@
|
||||
# Usage
|
||||
# __fisher_complete [<awk var>=value] [--help]
|
||||
#
|
||||
# Example
|
||||
# set -l IFS \t
|
||||
# STDIN | __fisher_complete | while read -l d l s
|
||||
# complete -c <command> -s -l -d
|
||||
# end
|
||||
|
||||
function __fisher_complete -d "Parse usage help output"
|
||||
function __fisher_parse_help -d "parse usage help output"
|
||||
switch "$argv"
|
||||
case \*OFS=\*
|
||||
case \*
|
156
functions/__fisher_plugin.fish
Normal file
156
functions/__fisher_plugin.fish
Normal file
@ -0,0 +1,156 @@
|
||||
function __fisher_plugin -a enable name path -d "enable or disable plugins"
|
||||
set -l batch
|
||||
set -l option
|
||||
|
||||
switch $enable
|
||||
case --disable
|
||||
set -e enable
|
||||
end
|
||||
|
||||
if test -L $path
|
||||
set option link
|
||||
end
|
||||
|
||||
for file in $path/*.load
|
||||
set -l base (basename $file).fish
|
||||
|
||||
if set -q enable
|
||||
__fisher_copy "$option" $file $fisher_config/conf.d/$base
|
||||
set batch $batch $fisher_config/conf.d/$base
|
||||
else
|
||||
rm -f $fisher_config/conf.d/$base
|
||||
end
|
||||
end
|
||||
|
||||
for file in $path/{*,{conf.d,modules}/*,functions/**}.fish
|
||||
set -l base (basename $file)
|
||||
|
||||
if test $base = uninstall.fish
|
||||
if not set -q enable
|
||||
set batch $batch $file
|
||||
end
|
||||
|
||||
continue
|
||||
end
|
||||
|
||||
switch $file
|
||||
case \?\*/{conf.d,modules}/\?\*
|
||||
switch "$base"
|
||||
case \*$name\*
|
||||
case \*
|
||||
set base $name.$base
|
||||
end
|
||||
|
||||
if set -q enable
|
||||
__fisher_copy "$option" $file $fisher_config/conf.d/$base
|
||||
set batch $batch $fisher_config/conf.d/$base
|
||||
else
|
||||
rm -f $fisher_config/conf.d/$base
|
||||
end
|
||||
|
||||
case \*
|
||||
switch $base
|
||||
case {$name,fish_{,right_}prompt}.fish
|
||||
if set -q enable
|
||||
source $file
|
||||
__fisher_copy "$option" $file $fisher_config/functions/$base
|
||||
else
|
||||
functions -e (basename $base .fish)
|
||||
rm -f $fisher_config/functions/$base
|
||||
|
||||
if test "$base" = fish_prompt.fish
|
||||
source $__fish_datadir/functions/fish_prompt.fish ^ /dev/null
|
||||
end
|
||||
end
|
||||
|
||||
case \*\?.config.fish
|
||||
if set -q enable
|
||||
__fisher_copy "$option" $file $fisher_config/conf.d/$base
|
||||
set batch $batch $fisher_config/conf.d/$base
|
||||
else
|
||||
rm -f $fisher_config/conf.d/$base
|
||||
end
|
||||
|
||||
case {,before.}init.fish
|
||||
set base $name.$base
|
||||
if set -q enable
|
||||
__fisher_copy "$option" $file $fisher_config/conf.d/$base
|
||||
set batch $batch $fisher_config/conf.d/$base
|
||||
else
|
||||
rm -f $fisher_config/conf.d/$base
|
||||
end
|
||||
|
||||
case \*
|
||||
if set -q enable
|
||||
__fisher_copy "$option" $file $fisher_config/functions/$base
|
||||
else
|
||||
rm -f $fisher_config/functions/$base
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if not set -q fisher_share_extensions[1]
|
||||
set fisher_share_extensions py rb php pl awk sed
|
||||
end
|
||||
|
||||
for file in $path/{share/,}*.$fisher_share_extensions
|
||||
set -l base (basename $file)
|
||||
|
||||
switch $file
|
||||
case \*.md \*.fish
|
||||
continue
|
||||
end
|
||||
|
||||
if set -q enable
|
||||
__fisher_copy "$option" $file $fisher_config/functions/$base
|
||||
__fisher_copy "$option" $file $fisher_share/$base
|
||||
else
|
||||
rm -f {$fisher_config/functions,$fisher_share}/$base
|
||||
end
|
||||
end
|
||||
|
||||
for file in $path/completions/*.fish
|
||||
if set -q enable
|
||||
__fisher_copy "$option" $file $fisher_config/completions/(basename $file)
|
||||
else
|
||||
rm -f $fisher_config/completions/(basename $file)
|
||||
end
|
||||
end
|
||||
|
||||
for n in (seq 9)
|
||||
if test -d $path/man/man$n
|
||||
mkdir -p $fisher_config/man/man$n
|
||||
end
|
||||
|
||||
for file in $path/man/man$n/*.$n
|
||||
if set -q enable
|
||||
__fisher_copy "$option" $file $fisher_config/man/man$n
|
||||
else
|
||||
rm -f $fisher_config/man/man$n/(basename $file)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if set -q batch[1]
|
||||
for file in $batch
|
||||
source $file
|
||||
end
|
||||
end
|
||||
|
||||
set -l index (contains -i -- $name $fisher_plugins)
|
||||
|
||||
if set -q enable
|
||||
if test -z "$index"
|
||||
set -U fisher_plugins $fisher_plugins $name
|
||||
end
|
||||
else
|
||||
if test "$index" -ge 1
|
||||
set -e fisher_plugins[$index]
|
||||
end
|
||||
end
|
||||
|
||||
complete -ec fisher
|
||||
|
||||
source $fisher_home/completions/fisher.fish
|
||||
end
|
@ -1,4 +1,4 @@
|
||||
function __fisher_cache -a error -d "Get plugin in cache from a name, url or path"
|
||||
function __fisher_resolve_plugin -a error -d "resolve path to a plugin"
|
||||
if test -z "$error"
|
||||
set error /dev/stderr
|
||||
end
|
@ -1,4 +1,4 @@
|
||||
function __fisher_validate -d "Validate a name, url or path"
|
||||
function __fisher_validate -d "validate a name, url or path"
|
||||
set -l id "[A-Za-z0-9_]+([.-]?[A-Za-z0-9_])*"
|
||||
|
||||
if not set -q fisher_default_host
|
||||
|
@ -6,8 +6,6 @@ function fisher -d "Fish Shell Plugin Manager"
|
||||
|
||||
set -l option
|
||||
set -l value
|
||||
set -l quiet -E .
|
||||
set -l alias
|
||||
|
||||
getopts $argv | while read -l 1 2
|
||||
switch "$1"
|
||||
@ -16,16 +14,13 @@ function fisher -d "Fish Shell Plugin Manager"
|
||||
set value $2
|
||||
break
|
||||
|
||||
case a alias
|
||||
set option alias
|
||||
set alias $alias $2
|
||||
|
||||
case h help
|
||||
set option help
|
||||
set value $value $2
|
||||
|
||||
case l list
|
||||
set option list
|
||||
set value $2
|
||||
|
||||
case f file
|
||||
set option file
|
||||
@ -40,9 +35,6 @@ function fisher -d "Fish Shell Plugin Manager"
|
||||
case v version
|
||||
set option version
|
||||
|
||||
case q quiet
|
||||
set quiet -q .
|
||||
|
||||
case \*
|
||||
printf "fisher: Ahoy! '%s' is not a valid option\n" $1 >& 2
|
||||
fisher --help >& 2
|
||||
@ -52,7 +44,7 @@ function fisher -d "Fish Shell Plugin Manager"
|
||||
|
||||
switch "$option"
|
||||
case command
|
||||
__fisher_alias | while read -la alias
|
||||
printf "%s\n" $fisher_alias | sed 's/[=,]/ /g' | while read -la alias
|
||||
if set -q alias[2]
|
||||
switch "$value"
|
||||
case $alias[2..-1]
|
||||
@ -75,13 +67,20 @@ function fisher -d "Fish Shell Plugin Manager"
|
||||
end
|
||||
|
||||
case list
|
||||
__fisher_list
|
||||
if not __fisher_list $value
|
||||
return 1
|
||||
end
|
||||
|
||||
case file
|
||||
__fisher_file "$value"
|
||||
if test -z "$value"
|
||||
set value $fisher_config/fishfile
|
||||
end
|
||||
|
||||
case alias
|
||||
__fisher_alias $alias
|
||||
if test value = -
|
||||
set value /dev/stdin
|
||||
end
|
||||
|
||||
__fisher_file $value
|
||||
|
||||
case version
|
||||
sed 's/^/fisher version /;q' $fisher_home/VERSION
|
||||
|
@ -42,7 +42,7 @@ function fisher_install -d "Install Plugins"
|
||||
if set -q items[1]
|
||||
printf "%s\n" $items
|
||||
else
|
||||
__fisher_file -
|
||||
__fisher_file /dev/stdin
|
||||
end | __fisher_validate | while read -l item
|
||||
|
||||
switch "$item"
|
||||
@ -73,11 +73,12 @@ function fisher_install -d "Install Plugins"
|
||||
printf ">> %s\n" $name > $error
|
||||
|
||||
case \*
|
||||
set index (math $index + 1)
|
||||
printf "(%s of %s) >> %s\n" $index $total $name > $error
|
||||
set index (math $index + 1)
|
||||
end
|
||||
|
||||
mkdir -p $fisher_config/{cache,functions,completions,conf.d,man}
|
||||
mkdir -p $fisher_config/{functions,completions,conf.d,man}
|
||||
mkdir -p $fisher_cache $fisher_share
|
||||
|
||||
set -l path $fisher_cache/$name
|
||||
|
||||
@ -104,10 +105,6 @@ function fisher_install -d "Install Plugins"
|
||||
end
|
||||
end
|
||||
|
||||
if test -L $path
|
||||
set option link
|
||||
end
|
||||
|
||||
set -l bundle $path/fishfile
|
||||
|
||||
if test -e $path/bundle
|
||||
@ -139,55 +136,7 @@ function fisher_install -d "Install Plugins"
|
||||
functions -e fish_{,right_}prompt
|
||||
end
|
||||
|
||||
for file in $path/{*,functions{/*,/**}}.fish
|
||||
set -l base (basename $file)
|
||||
|
||||
switch $base
|
||||
case {$name,fish_{,right_}prompt}.fish
|
||||
source $file
|
||||
|
||||
case {init,uninstall}.fish
|
||||
set base $name.(basename $base .fish).config.fish
|
||||
end
|
||||
|
||||
switch $base
|
||||
case \*\?.config.fish
|
||||
if test "$option" = link
|
||||
ln -sfF $file $fisher_config/conf.d/$base
|
||||
else
|
||||
cp -f $file $fisher_config/conf.d/$base
|
||||
end
|
||||
|
||||
case \*
|
||||
if test "$option" = link
|
||||
ln -sfF $file $fisher_config/functions/$base
|
||||
else
|
||||
cp -f $file $fisher_config/functions/$base
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if test "$option" = link
|
||||
for file in $path/completions/*.fish
|
||||
ln -sfF $file $fisher_config/completions/(basename $file)
|
||||
end
|
||||
else
|
||||
cp -f $path/completions/*.fish $fisher_config/completions/ ^ /dev/null
|
||||
end
|
||||
|
||||
for n in (seq 9)
|
||||
if test -d $path/man/man$n
|
||||
mkdir -p $fisher_config/man/man$n
|
||||
end
|
||||
|
||||
for file in $path/man/man$n/*.$n
|
||||
if test "$option" = link
|
||||
ln -sfF $file $fisher_config/man/man$n
|
||||
else
|
||||
cp -f $file $fisher_config/man/man$n
|
||||
end
|
||||
end
|
||||
end
|
||||
__fisher_plugin --enable $name $path
|
||||
|
||||
set count (math $count + 1)
|
||||
|
||||
|
@ -46,12 +46,18 @@ function fisher_uninstall -d "Uninstall Plugins"
|
||||
if set -q items[1]
|
||||
printf "%s\n" $items
|
||||
else
|
||||
__fisher_file -
|
||||
__fisher_file /dev/stdin
|
||||
|
||||
end | __fisher_validate | __fisher_cache $error | while read -l path
|
||||
end | __fisher_validate | __fisher_resolve_plugin $error | while read -l path
|
||||
|
||||
set -l name (printf "%s\n" $path | __fisher_name)
|
||||
|
||||
if not contains -- $name $fisher_plugins
|
||||
if not contains -- force $option
|
||||
continue
|
||||
end
|
||||
end
|
||||
|
||||
printf "Uninstalling " > $error
|
||||
|
||||
switch $total
|
||||
@ -59,39 +65,11 @@ function fisher_uninstall -d "Uninstall Plugins"
|
||||
printf ">> %s\n" $name > $error
|
||||
|
||||
case \*
|
||||
printf "(%s of %s) >> %s\n" $index $total $name > $error
|
||||
set index (math $index + 1)
|
||||
printf "(%s of %s) >> %s\n" (math 1 + $index) $total $name > $error
|
||||
end
|
||||
|
||||
for file in $path/{*,functions{/*,/**/*}}.fish
|
||||
set -l base (basename $file)
|
||||
|
||||
switch $base
|
||||
case {$name,fish_{,right_}prompt}.fish
|
||||
functions -e (basename $base .fish)
|
||||
|
||||
if test "$base" = fish_prompt.fish
|
||||
source $__fish_datadir/functions/fish_prompt.fish ^ /dev/null
|
||||
end
|
||||
|
||||
case {init,before.init,uninstall}.fish
|
||||
set base $name.(basename $base .fish).config.fish
|
||||
end
|
||||
|
||||
rm -f $fisher_config/{functions,conf.d}/$base
|
||||
end
|
||||
|
||||
for file in $path/completions/*.fish
|
||||
rm -f $fisher_config/completions/(basename $file)
|
||||
end
|
||||
|
||||
for n in (seq 9)
|
||||
if test -d $path/man/man$n
|
||||
for file in $path/man/man$n/*.$n
|
||||
rm -f $fisher_config/man/man$n/(basename $file)
|
||||
end
|
||||
end
|
||||
end
|
||||
__fisher_plugin --disable $name $path
|
||||
|
||||
git -C $path ls-remote --get-url ^ /dev/null | __fisher_validate | read -l url
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
function fisher_update -d "Update Plugins and Fisherman"
|
||||
function fisher_update -d "Update Fisherman or Plugins"
|
||||
set -l path
|
||||
set -l items
|
||||
set -l option self
|
||||
@ -65,6 +65,10 @@ function fisher_update -d "Update Plugins and Fisherman"
|
||||
mkdir -p $fisher_cache
|
||||
set -l index $fisher_cache/.index.tmp
|
||||
|
||||
if not set -q fisher_timeout
|
||||
set fisher_timeout 5
|
||||
end
|
||||
|
||||
if wait --spin=pipe --log=$fisher_error_log "
|
||||
curl --max-time $fisher_timeout -sS $fisher_index > $index
|
||||
"
|
||||
@ -81,8 +85,8 @@ function fisher_update -d "Update Plugins and Fisherman"
|
||||
printf "Updating >> Fisherman\n" > $error
|
||||
|
||||
if not fisher_update --path=$fisher_home --quiet=$error
|
||||
printf "fisher: Could not update Fisherman.\n" > $error
|
||||
sed -E 's/.*(error:.*)/\1/' $fisher_error_log > $error
|
||||
printf "fisher: Arrr! Could not update Fisherman.\n" > $error
|
||||
sed -E 's/.*error: (.*)/\1/' $fisher_error_log > $error
|
||||
return 1
|
||||
end
|
||||
|
||||
@ -97,9 +101,9 @@ function fisher_update -d "Update Plugins and Fisherman"
|
||||
if set -q items[1]
|
||||
printf "%s\n" $items
|
||||
else
|
||||
__fisher_file -
|
||||
__fisher_file /dev/stdin
|
||||
|
||||
end | __fisher_validate | __fisher_cache $error | while read -l path
|
||||
end | __fisher_validate | __fisher_resolve_plugin $error | while read -l path
|
||||
|
||||
set -l name (printf "%s\n" $path | __fisher_name)
|
||||
|
||||
@ -110,8 +114,8 @@ function fisher_update -d "Update Plugins and Fisherman"
|
||||
printf ">> %s\n" $name > $error
|
||||
|
||||
case \*
|
||||
set index (math $index + 1)
|
||||
printf "(%s of %s) >> %s\n" $index $total $name > $error
|
||||
set index (math $index + 1)
|
||||
end
|
||||
|
||||
if not fisher_update --path=$path --quiet
|
||||
|
@ -25,5 +25,5 @@ function getopts -d "Parse CLI options"
|
||||
}
|
||||
}
|
||||
END { while (len) out(pop()) }
|
||||
'
|
||||
'
|
||||
end
|
||||
|
@ -2,7 +2,7 @@ function wait -d "Run commands and wait with a spin"
|
||||
set -l option
|
||||
set -l commands
|
||||
set -l spinners
|
||||
set -l time 0.03
|
||||
set -l time 0.02
|
||||
set -l log
|
||||
set -l format "@\r"
|
||||
|
||||
|
@ -38,7 +38,7 @@ fisher \fBsearch\fR \fIowner/repo\fR
|
||||
.br
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
Search the Fisherman index database\. You can use a custom index file by setting \fB$fisher_index\fR to your preferred URL or file\. See \fBfisher help config\fR and \fIIndex\fR in \fBfisher(7)\fR\.
|
||||
Search the Fisherman index database\. You can use a custom index file by setting \fB$fisher_index\fR to your preferred URL or file\. See \fBfisher help config\fR and \fIIndex\fR in \fBfisher help tour\fR\.
|
||||
.
|
||||
.P
|
||||
A copy of the index is downloaded every time a search query happens, keeping the index up to date all the time\.
|
||||
|
@ -18,7 +18,7 @@ fisher `search` *owner/repo*<br>
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Search the Fisherman index database. You can use a custom index file by setting `$fisher_index` to your preferred URL or file. See `fisher help config` and *Index* in `fisher(7)`.
|
||||
Search the Fisherman index database. You can use a custom index file by setting `$fisher_index` to your preferred URL or file. See `fisher help config` and *Index* in `fisher help tour`.
|
||||
|
||||
A copy of the index is downloaded every time a search query happens, keeping the index up to date all the time.
|
||||
|
||||
|
@ -32,7 +32,7 @@ Uninstall one or more plugins, by name, URL or local path\. If no arguments are
|
||||
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\.
|
||||
.
|
||||
.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(7)\fR\.
|
||||
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\.
|
||||
.
|
||||
.SH "OPTIONS"
|
||||
.
|
||||
|
@ -18,7 +18,7 @@ Uninstall one or more plugins, by name, URL or local path. If no arguments are g
|
||||
|
||||
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(7)`.
|
||||
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`.
|
||||
|
||||
## OPTIONS
|
||||
|
||||
|
@ -10,10 +10,7 @@
|
||||
\fBfisher\fR \fIcommand\fR [\fIoptions\fR] [\fB\-\-version\fR] [\fB\-\-help\fR]
|
||||
.
|
||||
.br
|
||||
\fBfisher\fR \fB\-\-list\fR
|
||||
.
|
||||
.br
|
||||
\fBfisher\fR \fB\-\-alias\fR[=\fIcommand\fR=[\fIalias\fR[,\.\.\.]]]
|
||||
\fBfisher\fR \fB\-\-list=cache|enabled|disabled\fR
|
||||
.
|
||||
.br
|
||||
\fBfisher\fR \fB\-\-file\fR=\fIfishfile\fR
|
||||
@ -21,24 +18,20 @@
|
||||
.br
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
Fisherman is a plugin manager for \fBfish(1)\fR that lets you share and reuse code, prompts and configurations easily\.
|
||||
Fisherman is a plugin manager and CLI toolkit for \fBfish(1)\fR to help you build powerful utilities and share your code easily\.
|
||||
.
|
||||
.P
|
||||
The following commands are available: \fIinstall\fR, \fIuninstall\fR, \fIupdate\fR, \fIsearch\fR and \fIhelp\fR\. See \fBfisher\fR help \fIcommand\fR for information about each command\.
|
||||
The following commands are available out of the box: \fIinstall\fR, \fIuninstall\fR, \fIupdate\fR, \fIsearch\fR and \fIhelp\fR\. See \fBfisher help <command>\fR for information about each command\.
|
||||
.
|
||||
.SH "OPTIONS"
|
||||
.
|
||||
.TP
|
||||
\fB\-\-list\fR
|
||||
List plugins in the \fB$fisher_cache\fR\. Includes plugins installed using a custom URL\.
|
||||
.
|
||||
.TP
|
||||
\fB\-a \-\-alias[=command=[alias[,\.\.\.]]]\fR
|
||||
Define one or more comma\-separated \fIalias\fR for \fIcommand\fR using \fB$fisher_alias\fR\. If no value is given, lists all existing aliases\.
|
||||
\fB\-\-list=cache|enabled|disabled\fR
|
||||
List plugins according to the given category\.
|
||||
.
|
||||
.TP
|
||||
\fB\-f \-\-file=fishfile\fR
|
||||
Read \fIfishfile\fR and display its contents\. If \fIfishfile\fR is null or an empty string, your user \fIfishfile\fR in \fB$fisher_config/fishfile\fR will be used instead\. Use a dash \fB\-\fR to force reading from the standard input\. oh\-my\-fish bundle files are supported as well\.
|
||||
Read \fIfishfile\fR and display its contents\. If \fIfishfile\fR is null or an empty string, your user \fIfishfile\fR in \fB$fisher_config/fishfile\fR will be shown instead\. Use a dash \fB\-\fR to read from the standard input\. Other formats such as the oh\-my\-fish bundle files are supported as well\.
|
||||
.
|
||||
.TP
|
||||
\fB\-v \-\-version\fR
|
||||
@ -49,7 +42,7 @@ Show version information\. Fisherman\'s current version can be found in the VERS
|
||||
Show usage help\.
|
||||
.
|
||||
.SH "CUSTOM COMMANDS"
|
||||
A Fisherman command is a function that you can invoke using the \fBfisher\fR utility\. By convention, any function like \fBfisher_<my_command>\fR is registered 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\.
|
||||
A Fisherman command is a function that you invoke using the \fBfisher\fR CLI utility\. By convention, any function like \fBfisher_<my_command>\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"
|
||||
.
|
||||
@ -76,21 +69,7 @@ Install plugins from a \fIfishfile\fR or bundle:
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher \-\-file=path/to/shared/fishfile | fisher install
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.TP
|
||||
Define a few aliases:
|
||||
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher \-a uninstall=rm,u,del
|
||||
fisher \-\-file=path/to/bundle | fisher install
|
||||
.
|
||||
.fi
|
||||
.
|
||||
@ -100,37 +79,37 @@ fisher \-a uninstall=rm,u,del
|
||||
Fisherman was created by Jorge Bucaran \fIj@bucaran\.me\fR\.
|
||||
.
|
||||
.P
|
||||
See AUTHORS file for a more complete list of contributors\.
|
||||
See AUTHORS file for the complete list of contributors\.
|
||||
.
|
||||
.SH "SEE ALSO"
|
||||
fisher(7)
|
||||
fisher help tour
|
||||
.
|
||||
.br
|
||||
fisher help
|
||||
fisher help help
|
||||
.
|
||||
.br
|
||||
fisher update
|
||||
fisher help update
|
||||
.
|
||||
.br
|
||||
fisher search
|
||||
fisher help search
|
||||
.
|
||||
.br
|
||||
fisher config
|
||||
fisher help config
|
||||
.
|
||||
.br
|
||||
fisher install
|
||||
fisher help install
|
||||
.
|
||||
.br
|
||||
fisher plugins
|
||||
fisher help plugins
|
||||
.
|
||||
.br
|
||||
fisher commands
|
||||
fisher help commands
|
||||
.
|
||||
.br
|
||||
fisher fishfile
|
||||
fisher help fishfile
|
||||
.
|
||||
.br
|
||||
fisher uninstall
|
||||
fisher help uninstall
|
||||
.
|
||||
.br
|
||||
|
||||
|
@ -4,26 +4,22 @@ fisher(1) -- Fish Plugin Manager
|
||||
## SYNOPSIS
|
||||
|
||||
`fisher` *command* [*options*] [`--version`] [`--help`]<br>
|
||||
`fisher` `--list`<br>
|
||||
`fisher` `--alias`[=*command*=[*alias*[,...]]]<br>
|
||||
`fisher` `--list=cache|enabled|disabled`<br>
|
||||
`fisher` `--file`=*fishfile*<br>
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Fisherman is a plugin manager for `fish(1)` that lets you share and reuse code, prompts and configurations easily.
|
||||
Fisherman is a plugin manager and CLI toolkit for `fish(1)` to help you build powerful utilities and share your code easily.
|
||||
|
||||
The following commands are available: *install*, *uninstall*, *update*, *search* and *help*. See `fisher` help *command* for information about each command.
|
||||
The following commands are available out of the box: *install*, *uninstall*, *update*, *search* and *help*. See `fisher help <command>` for information about each command.
|
||||
|
||||
## OPTIONS
|
||||
|
||||
* `--list`:
|
||||
List plugins in the `$fisher_cache`. Includes plugins installed using a custom URL.
|
||||
|
||||
* `-a --alias[=command=[alias[,...]]]`:
|
||||
Define one or more comma-separated *alias* for *command* using `$fisher_alias`. If no value is given, lists all existing aliases.
|
||||
* `--list=cache|enabled|disabled`:
|
||||
List plugins according to the given category.
|
||||
|
||||
* `-f --file=fishfile`:
|
||||
Read *fishfile* and display its contents. If *fishfile* is null or an empty string, your user *fishfile* in `$fisher_config/fishfile` will be used instead. Use a dash `-` to force reading from the standard input. oh-my-fish bundle files are supported as well.
|
||||
Read *fishfile* and display its contents. If *fishfile* is null or an empty string, your user *fishfile* in `$fisher_config/fishfile` will be shown instead. Use a dash `-` to read from the standard input. Other formats such as the oh-my-fish bundle files are supported as well.
|
||||
|
||||
* `-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 releases.
|
||||
@ -33,7 +29,7 @@ The following commands are available: *install*, *uninstall*, *update*, *search*
|
||||
|
||||
## CUSTOM COMMANDS
|
||||
|
||||
A Fisherman command is a function that you can invoke using the `fisher` utility. By convention, any function like `fisher_<my_command>` is registered 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.
|
||||
A Fisherman command is a function that you invoke using the `fisher` CLI utility. By convention, any function like `fisher_<my_command>` 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.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
@ -46,30 +42,24 @@ fisher install fishtape shark
|
||||
* Install plugins from a *fishfile* or bundle:
|
||||
|
||||
```
|
||||
fisher --file=path/to/shared/fishfile | fisher install
|
||||
```
|
||||
|
||||
* Define a few aliases:
|
||||
|
||||
```
|
||||
fisher -a uninstall=rm,u,del
|
||||
fisher --file=path/to/bundle | fisher install
|
||||
```
|
||||
|
||||
## AUTHORS
|
||||
|
||||
Fisherman was created by Jorge Bucaran *j@bucaran.me*.
|
||||
|
||||
See AUTHORS file for a more complete list of contributors.
|
||||
See AUTHORS file for the complete list of contributors.
|
||||
|
||||
## SEE ALSO
|
||||
|
||||
fisher(7)<br>
|
||||
fisher help<br>
|
||||
fisher update<br>
|
||||
fisher search<br>
|
||||
fisher config<br>
|
||||
fisher install<br>
|
||||
fisher plugins<br>
|
||||
fisher commands<br>
|
||||
fisher fishfile<br>
|
||||
fisher uninstall<br>
|
||||
fisher help tour<br>
|
||||
fisher help help<br>
|
||||
fisher help update<br>
|
||||
fisher help search<br>
|
||||
fisher help config<br>
|
||||
fisher help install<br>
|
||||
fisher help plugins<br>
|
||||
fisher help commands<br>
|
||||
fisher help fishfile<br>
|
||||
fisher help uninstall<br>
|
||||
|
@ -46,7 +46,7 @@ Plugins may declare any number of dependencies to other plugins in a fishfile at
|
||||
By default, when Fisherman installs a plugin, it will also fetch and install its dependencies\. If a dependency is already installed, it will not be updated as this could potentially break other plugins using an older version\. For the same reason, uninstalling a plugin does not remove its dependencies\.
|
||||
.
|
||||
.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(7)\fR\.
|
||||
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"
|
||||
fisher(1)
|
||||
|
@ -32,7 +32,7 @@ Plugins may declare any number of dependencies to other plugins in a fishfile at
|
||||
|
||||
By default, when Fisherman installs a plugin, it will also fetch and install its dependencies. If a dependency is already installed, it will not be updated as this could potentially break other plugins using an older version. For the same reason, uninstalling a plugin does not remove its dependencies.
|
||||
|
||||
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(7)`.
|
||||
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
|
||||
|
||||
|
@ -70,7 +70,7 @@ end
|
||||
fisher(1)
|
||||
.
|
||||
.br
|
||||
fisher(7)
|
||||
fisher help tour
|
||||
.
|
||||
.br
|
||||
funcsave(1)
|
||||
|
@ -47,6 +47,6 @@ end
|
||||
## SEE ALSO
|
||||
|
||||
fisher(1)<br>
|
||||
fisher(7)<br>
|
||||
fisher help tour<br>
|
||||
funcsave(1)<br>
|
||||
fisher help plugins<br>
|
||||
|
@ -37,7 +37,7 @@ The cache directory\. Plugins are first downloaded here and installed to \fB$fis
|
||||
.
|
||||
.TP
|
||||
\fB$fisher_index\fR
|
||||
Index source URL or file\. To use a different index set this to a file or URL\. Redirect urls are not supported due to security and performance concerns\. The underlying request and fetch mechanism is based in \fBcurl(1)\fR\. See also \fBIndex\fR in \fBfisher(7)\fR\.
|
||||
Index source URL or file\. To use a different index set this to a file or URL\. Redirect urls are not supported due to security and performance concerns\. The underlying request and fetch mechanism is based in \fBcurl(1)\fR\. See also \fBIndex\fR in \fBfisher help tour\fR\.
|
||||
.
|
||||
.TP
|
||||
\fB$fisher_error_log\fR
|
||||
@ -51,6 +51,14 @@ Use this variable to define custom aliases for fisher commands\. See \fBExamples
|
||||
\fB$fisher_default_host\fR
|
||||
Use this variable to define your preferred git host\. Fisherman uses this value to convert short urls like \fBowner/repo\fR to \fBhttps://host/owner/repo\fR\. The default host is \fIgithub\.com\fR\.
|
||||
.
|
||||
.TP
|
||||
\fB$fisher_share\fR
|
||||
Used to share scripts other than \fB\.fish\fR files between plugins\. Use \fB$fisher_share_extensions\fR to customize what extensions are used\.
|
||||
.
|
||||
.TP
|
||||
\fB$fisher_share_extensions\fR
|
||||
Customize what file extensions are copied to \fB$fisher_config\fR when sharing scripts\. By default \fBpy rb php pl awk sed\fR are used\.
|
||||
.
|
||||
.SH "EXAMPLES"
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
@ -85,4 +93,4 @@ set fisher_default_host bitbucket\.org
|
||||
.IP "" 0
|
||||
.
|
||||
.SH "SEE ALSO"
|
||||
fisher(7)
|
||||
fisher help tour
|
||||
|
@ -27,7 +27,7 @@ You can also customize the debug log path, cache location, index source URL, com
|
||||
The cache directory. Plugins are first downloaded here and installed to `$fisher_config/functions` afterwards. The cache is `$fisher_config/cache` by default.
|
||||
|
||||
* `$fisher_index`:
|
||||
Index source URL or file. To use a different index set this to a file or URL. Redirect urls are not supported due to security and performance concerns. The underlying request and fetch mechanism is based in `curl(1)`. See also `Index` in `fisher(7)`.
|
||||
Index source URL or file. To use a different index set this to a file or URL. Redirect urls are not supported due to security and performance concerns. The underlying request and fetch mechanism is based in `curl(1)`. See also `Index` in `fisher help tour`.
|
||||
|
||||
* `$fisher_error_log`:
|
||||
This file keeps a log of the most recent crash stack trace. `$fisher_cache/.debug_log` by default.
|
||||
@ -38,6 +38,13 @@ You can also customize the debug log path, cache location, index source URL, com
|
||||
* `$fisher_default_host`:
|
||||
Use this variable to define your preferred git host. Fisherman uses this value to convert short urls like `owner/repo` to `https://host/owner/repo`. The default host is *github.com*.
|
||||
|
||||
* `$fisher_share`:
|
||||
Used to share scripts other than `.fish` files between plugins. Use `$fisher_share_extensions` to customize what extensions are used.
|
||||
|
||||
* `$fisher_share_extensions`:
|
||||
Customize what file extensions are copied to `$fisher_config` when sharing scripts. By default `py rb php pl awk sed` are used.
|
||||
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
* Create aliases for fisher `install` to *i*, *in* and *inst*; and for fisher `update` to *up*.
|
||||
@ -55,4 +62,4 @@ set fisher_default_host bitbucket.org
|
||||
|
||||
## SEE ALSO
|
||||
|
||||
fisher(7)
|
||||
fisher help tour
|
||||
|
@ -64,7 +64,7 @@ fisher install omf/plugin\-{rbenv,tab} omf/theme\-scorphish
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
You can use the same mechanism to install any valid plugin from any given URL\. See also \fBCompatibility\fR in \fBfisher(7)\fR\.
|
||||
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\.
|
||||
@ -88,7 +88,7 @@ end
|
||||
See \fB$fisher_home/config\.fish\fR for the full code\.
|
||||
.
|
||||
.SS "How is Fisherman faster than oh\-my\-fish/Wahoo, etc?"
|
||||
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(7)\fR\.
|
||||
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 "Why don\'t you contribute your improvements back to oh\-my\-fish instead of creating a new project?"
|
||||
I have contributed back to oh\-my\-fish extensively\. See also oh\-my\-fish history for August 27, 2015 when another project, Wahoo, was entirely merged with oh\-my\-fish\.
|
||||
@ -97,7 +97,7 @@ I have contributed back to oh\-my\-fish extensively\. See also oh\-my\-fish hist
|
||||
In addition, Fisherman was built from the ground up using a completely different design, implementation and set of principles\.
|
||||
.
|
||||
.P
|
||||
Some features include: UNIX familiarity, minimalistic design, flat tree structure, unified plugin architecture, external self\-managed database, cache system, dependency manifest file and compatibility with oh\-my\-fish, etc\. See \fBfisher(7)\fR\.
|
||||
Some features include: UNIX familiarity, minimalistic design, flat tree structure, unified plugin architecture, external self\-managed database, cache system, dependency manifest file and compatibility with oh\-my\-fish, etc\. See \fBfisher help tour\fR\.
|
||||
.
|
||||
.SS "How can I upgrade from an existing oh\-my\-fish or Wahoo installation?"
|
||||
Install Fisherman\.
|
||||
|
@ -58,7 +58,7 @@ 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(7)`.
|
||||
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?
|
||||
@ -79,7 +79,7 @@ See `$fisher_home/config.fish` for the full code.
|
||||
|
||||
### How is Fisherman faster than oh-my-fish/Wahoo, etc?
|
||||
|
||||
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(7)`.
|
||||
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`.
|
||||
|
||||
### Why don't you contribute your improvements back to oh-my-fish instead of creating a new project?
|
||||
|
||||
@ -87,7 +87,7 @@ I have contributed back to oh-my-fish extensively. See also oh-my-fish history f
|
||||
|
||||
In addition, Fisherman was built from the ground up using a completely different design, implementation and set of principles.
|
||||
|
||||
Some features include: UNIX familiarity, minimalistic design, flat tree structure, unified plugin architecture, external self-managed database, cache system, dependency manifest file and compatibility with oh-my-fish, etc. See `fisher(7)`.
|
||||
Some features include: UNIX familiarity, minimalistic design, flat tree structure, unified plugin architecture, external self-managed database, cache system, dependency manifest file and compatibility with oh-my-fish, etc. See `fisher help tour`.
|
||||
|
||||
|
||||
### How can I upgrade from an existing oh-my-fish or Wahoo installation?
|
||||
|
@ -1,19 +1,19 @@
|
||||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "FISHER" "7" "January 2016" "" "fisherman"
|
||||
.TH "FISHER\-FEATURES" "7" "January 2016" "" "fisherman"
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBfisher\fR \- An Introduction to Fisherman
|
||||
\fBfisher\-features\fR \- Fisherman Features
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
Fisherman is a plugin manager for \fBfish(1)\fR that lets you share and reuse code, prompts and configurations easily\.
|
||||
.
|
||||
.P
|
||||
Some features include: minimalistic design, flat tree structure, unified plugin architecture, external self\-managed database, cache system, dependency manifest file and compatibility with oh\-my\-fish and other frameworks\.
|
||||
The main features are a minimalistic design, flat tree structure, unified plugin architecture, external self\-managed database, cache system, dependency manifest file and compatibility with oh\-my\-fish, Tackle and Wahoo plugins, themes and modules\.
|
||||
.
|
||||
.P
|
||||
This document describes Fisherman features and some of their implementation details\. For usage and command help see also \fBfisher(1)\fR\.
|
||||
This document describes Fisherman features and their implementation details\. For usage and command help see \fBfisher(1)\fR\. For a general introduction to Fisherman see \fBfisher help tour\fR\.
|
||||
.
|
||||
.SH "FLAT TREE"
|
||||
The configuration directory structure is optimized to help fish start new sessions as quickly as possible, regardless of the numbers of plugins or prompts enabled at any given time\.
|
@ -105,7 +105,7 @@ end
|
||||
.IP "" 0
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Add completions\. \fIwtc\fR is simple enough that you could get away without \fB__fisher_complete\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_complete\fR, your command must provide a \fB\-\-help\fR option that prints usage information to standard output\.
|
||||
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
|
||||
.
|
||||
@ -117,7 +117,7 @@ mkdir completions
|
||||
cat > completions/wtc\.fish
|
||||
|
||||
set \-l IFS ";"
|
||||
wtc \-\-help | __fisher_complete | while read \-l info long short
|
||||
wtc \-\-help | __fisher_parse_help | while read \-l info long short
|
||||
complete \-c wtc \-s "$short" \-l "$long" \-d "$info"
|
||||
end
|
||||
^C
|
||||
@ -170,7 +170,7 @@ git push origin master
|
||||
.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(7)\fR\.
|
||||
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
|
||||
.
|
||||
|
@ -69,14 +69,14 @@ end
|
||||
^C
|
||||
```
|
||||
|
||||
* Add completions. *wtc* is simple enough that you could get away without `__fisher_complete`, but more complex utilities, or utilities whose CLI evolves over time, can benefit using automatic completion generation. Note that in order to use `__fisher_complete`, your command must provide a `--help` option that prints usage information to standard output.
|
||||
* 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.
|
||||
|
||||
```
|
||||
mkdir completions
|
||||
cat > completions/wtc.fish
|
||||
|
||||
set -l IFS ";"
|
||||
wtc --help | __fisher_complete | while read -l info long short
|
||||
wtc --help | __fisher_parse_help | while read -l info long short
|
||||
complete -c wtc -s "$short" -l "$long" -d "$info"
|
||||
end
|
||||
^C
|
||||
@ -108,7 +108,7 @@ 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(7)`.
|
||||
* 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`.
|
||||
|
||||
```
|
||||
fisher install github/*owner*/wtc
|
||||
|
352
man/man7/fisher-tour.7
Normal file
352
man/man7/fisher-tour.7
Normal file
@ -0,0 +1,352 @@
|
||||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "FISHER\-TOUR" "7" "January 2016" "" "fisherman"
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBfisher\-tour\fR \- Fisherman Feature Tour
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
Fisherman is a plugin manager and CLI toolkit for Fish to help you build powerful utilities and share your code easily\.
|
||||
.
|
||||
.P
|
||||
Fisherman uses a flat tree structure that adds no cruft to your shell, making it as fast as no Fisherman\. The cache mechanism lets you query the index offline and enable or disable plugins as you wish\.
|
||||
.
|
||||
.P
|
||||
Other features include dependency management, great plugin search capabilities and full compatibility with Tackle, Wahoo and oh\-my\-fish themes and packages\.
|
||||
.
|
||||
.P
|
||||
This document describes Fisherman features and their implementation details\. For usage and command help see \fBfisher(1)\fR\.
|
||||
.
|
||||
.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\. An old saying goes that Fisherman is as fast as no Fisherman\.
|
||||
.
|
||||
.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 at any time once 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 in the same scope\.
|
||||
.
|
||||
.P
|
||||
Loading a path simply means adding the desired location to the \fB$fish_function_path\fR array\. See also \fBfunctions(1)\fR\.
|
||||
.
|
||||
.P
|
||||
Here is a snapshot of a typical configuration path with a single plugin and prompt:
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
$fisher_config
|
||||
|\-\- cache/
|
||||
|\-\- conf\.d/
|
||||
|\-\- |\-\- my_plugin\.config\.fish
|
||||
|\-\- functions/
|
||||
| |\-\- my_plugin\.fish
|
||||
| |\-\- fish_prompt\.fish
|
||||
| |\-\- fish_right_prompt\.fish
|
||||
|\-\- completions/
|
||||
| |\-\- my_plugin\.fish
|
||||
|\-\- man/
|
||||
|\-\- man1/
|
||||
|\-\- my_plugin\.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<name>\.config\.fish\fR are added there\.
|
||||
.
|
||||
.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 path to a local project\.
|
||||
.
|
||||
.P
|
||||
If you use a \fIname\fR, this must be listed 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 any value in \fB$fisher_default_host\fR to guess the full URL\. The default value is \fBhttps://github\.com\fR\.
|
||||
.
|
||||
.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 and / or \fBfish_right_prompt\fR functions\.
|
||||
.
|
||||
.SS "INDEX"
|
||||
You can install, update and uninstall plugins by name, querying the Fisherman index, or by URL using several of the variations described in \fBPlugins\fR\. The index is a plain text flat database \fIindependent\fR from Fisherman\. You can use a custom index file by setting \fB$fisher_index\fR to your own file or URL\. Redirection urls are not supported due to security and performance concerns\. See \fBfisher help config\fR\.
|
||||
.
|
||||
.P
|
||||
A copy of the index is downloaded each time a query happens\. This keeps the index up to date and allows you to search the database offline\.
|
||||
.
|
||||
.P
|
||||
The index is a list of records, each consisting of the following fields:
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
\fBname\fR, \fBurl\fR, \fBinfo\fR, \fBauthor\fR and one or more \fBtags\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
|
||||
Sparklines for your Fish
|
||||
graph spark data
|
||||
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\.
|
||||
.
|
||||
.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
|
||||
.
|
||||
.P
|
||||
Now you can create a new pull request in the upstream repository\.
|
||||
.
|
||||
.SS "CACHE"
|
||||
Downloaded plugins are tracked 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 addition, man pages are added to the corresponding man directory and if a Makefile is detected, the command \fBmake\fR is run\.
|
||||
.
|
||||
.P
|
||||
The cache also provides a location for a local copy of the Index\.
|
||||
.
|
||||
.SS "FISHFILES"
|
||||
Dependency manifest file, or fishfiles for short, let you share plugin configurations across multiple installations, allow plugins to declare dependencies, and prevent information loss in case of system failure\. See \fBfisher help fishfile\fR\.
|
||||
.
|
||||
.P
|
||||
Here is an example fishfile inside \fB$fisher_config\fR:
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
# my plugins
|
||||
gitio
|
||||
fishtape
|
||||
|
||||
# my links
|
||||
github/bucaran/shark
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
The fishfile updates as you install / uninstall plugins\. See also \fBfisher help install\fR or \fBfisher help uninstall\fR\.
|
||||
.
|
||||
.P
|
||||
Plugins may list any number of dependencies to other plugins in a fishfile at the root of each project\. By default, when Fisherman installs a plugin, it will also fetch and install its dependencies\. If a dependency is already installed, it will not be updated as this could potentially break other plugins using an older version\. For the same reasons, uninstalling a plugin does not remove its dependencies\. See \fBfisher help update\fR\.
|
||||
.
|
||||
.SS "CONFIGURATION"
|
||||
Fisherman allows a high level of configuration using \fB$fisher_*\fR variables\. You can customize the home and configuration directories, debug log file, cache 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 as well\. 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(1)\fR\.
|
||||
.
|
||||
.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 background job wait spinner that you can use to implement your own commands CLI\. See \fBgetopts(1)\fR and \fBwait(1)\fR\.
|
||||
.
|
||||
.SH "COMPATIBILITY"
|
||||
Fisherman supports oh\-my\-fish (Wahoo) themes and plugins by default, but some features are turned off due to performance considerations\.
|
||||
.
|
||||
.P
|
||||
oh\-my\-fish evaluates every \fI\.fish\fR file inside the root directory of every plugin during initialization\. This is necessary in order to register any existing \fBinit\fR events and invoke them using fish \fBemit(1)\fR\.
|
||||
.
|
||||
.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 every session, install the \fBomf\fR compatibility plugin\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
fisher install omf
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
This plugin also adds definitions for some of oh\-my\-fish Core Library functions\.
|
||||
.
|
||||
.SH "SEE ALSO"
|
||||
fisher(1)
|
||||
.
|
||||
.br
|
||||
fisher help
|
||||
.
|
||||
.br
|
||||
fisher help config
|
||||
.
|
||||
.br
|
||||
fisher help plugins
|
||||
.
|
||||
.br
|
||||
fisher help commands
|
||||
.
|
||||
.br
|
||||
wait(1)
|
||||
.
|
||||
.br
|
||||
getopts(1)
|
||||
.
|
||||
.br
|
||||
|
@ -1,17 +1,19 @@
|
||||
fisher(7) -- An Introduction to Fisherman
|
||||
=========================================
|
||||
fisher-tour(7) -- Fisherman Feature Tour
|
||||
========================================
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Fisherman is a plugin manager for `fish(1)` that lets you share and reuse code, prompts and configurations easily.
|
||||
Fisherman is a plugin manager and CLI toolkit for Fish to help you build powerful utilities and share your code easily.
|
||||
|
||||
Some features include: minimalistic design, flat tree structure, unified plugin architecture, external self-managed database, cache system, dependency manifest file and compatibility with oh-my-fish and other frameworks.
|
||||
Fisherman uses a flat tree structure that adds no cruft to your shell, making it as fast as no Fisherman. The cache mechanism lets you query the index offline and enable or disable plugins as you wish.
|
||||
|
||||
This document describes Fisherman features and some of their implementation details. For usage and command help see also `fisher(1)`.
|
||||
Other features include dependency management, great plugin search capabilities and full compatibility with Tackle, Wahoo and oh-my-fish themes and packages.
|
||||
|
||||
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 fish start new sessions as quickly as possible, regardless of the numbers of plugins or prompts enabled at any given time.
|
||||
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. An old saying goes that Fisherman is as fast as no Fisherman.
|
||||
|
||||
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.
|
||||
|
||||
@ -61,23 +63,25 @@ If you are already familiar in the way fish handles your user configuration, you
|
||||
|
||||
### 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 full name completions and plugin information. The same works for `fisher update` and `fisher uninstall`.
|
||||
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`.
|
||||
|
||||
To install a plugin, you can use their *name* if they are listed in `$fisher_index`.
|
||||
You can install a plugin by their name, URL or path to a local project.
|
||||
|
||||
If you use a *name*, this must be listed in the index database. See `Index`.
|
||||
|
||||
```
|
||||
fisher install shark
|
||||
```
|
||||
|
||||
Otherwise, you can use the repository remote *URL*.
|
||||
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 any value in `$fisher_default_host`. The default value is `https://github.com`.
|
||||
If the domain or host is not provided, Fisherman will use any value in `$fisher_default_host` to guess the full URL. The default value is `https://github.com`.
|
||||
|
||||
In addition, all of the following `owner/repo` variations are accepted:
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "fisherman",
|
||||
"version": "0.2.0",
|
||||
"version": "0.4.0",
|
||||
"description": "fish plugin manager",
|
||||
"main": "index.js",
|
||||
"directories": {
|
||||
|
@ -61,8 +61,8 @@ for name in $names
|
||||
-e $fisher_config/conf.d/$name.config.fish
|
||||
end
|
||||
|
||||
test "add init files to conf.d as <name>.init.config"
|
||||
-e $fisher_config/conf.d/$name.init.config.fish
|
||||
test "add init files to conf.d as <name>.init"
|
||||
-e $fisher_config/conf.d/$name.init.fish
|
||||
end
|
||||
|
||||
test "add manual pages to config/man/"
|
||||
|
Loading…
Reference in New Issue
Block a user