mirror of
https://github.com/jorgebucaran/fisher
synced 2024-10-09 09:36:53 +02:00
Fisherman v0.2.0
* Improved README, added links to screencasts, updated documentation with new changes and fixed other typos and composition errors. * Removed `fisher update --cache` in favor of `fisher --cache | fisher update` and `fisher uninstall --all` in favor of `fisher --cache | fisher uninstall`. * Fisherman does not move initialization / configuration files following the convention `name`.config.fish to `$fisher_config/functions`, but to `$fisher_config/conf.d` now and evaluates each `*.config.fish` inside at shell start as usual. Closes #13. * Added `fisher --cache[=base]` option to retrieve contents in `$fisher_cache`, eliminating flaky usage of `find(1)`. Closes #11. * Fisherman now generates information about plugins installed via custom URLs. For the description, a shortened version of the URL is used. For the URL the full URL is used. For tags, the URL is fuzzily checked and tags such as _theme_, _plugin_, _config_ and _omf_ are added. The tag _orphan_ is added by default as well. Finally, the author is generated by retrieving the e-mail or username of the author of the first commit in the plugin's repository. Closes #9 and #14. * Changed `--path-in-cache` to `--translate.` This function translates an name or supported URL/URL variation into a path inside `$fisher_cache`. This allows you to treat plugins installed via custom URLs almost like regular plugins if they are installed. Closes #8. * Fixed a bug with `mktemp` failing on some systems. Closes #7. Thanks @tobywf. * Added [CODE_OF_CONDUCT][code_of_conduct]. 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. * Move `getopts` implementation to `share/getopts.awk`. Closes #3. * Support dots inside URIs in `fisher --validate`. Closes #2.
This commit is contained in:
parent
3e2e1ed27a
commit
54212e1cbc
90 changed files with 934 additions and 607 deletions
42
CHANGELOG.md
42
CHANGELOG.md
|
@ -1,7 +1,45 @@
|
||||||
# Changelog
|
# Change Log
|
||||||
|
|
||||||
|
* [0.2.0](#020)
|
||||||
* [0.1.0](#010)
|
* [0.1.0](#010)
|
||||||
|
|
||||||
## 0.1.0 - 2016-01-01
|
## 0.2.0 - 2016-01-05
|
||||||
|
|
||||||
|
* Improved README, added links to screencasts, updated documentation with new changes and fixed other typos and composition errors.
|
||||||
|
|
||||||
|
* :warning: Removed `fisher update --cache` in favor of `fisher --cache | fisher update` and `fisher uninstall --all` in favor of `fisher --cache | fisher uninstall`.
|
||||||
|
|
||||||
|
* :warning: Fisherman does not move initialization / configuration files following the convention `name`.config.fish to `$fisher_config/functions`, but to `$fisher_config/conf.d` now and evaluates each `*.config.fish` inside at shell start as usual. Closes #13.
|
||||||
|
|
||||||
|
* Added `fisher --cache[=base]` option to retrieve contents in `$fisher_cache`, eliminating flaky usage of `find(1)`. Closes #11.
|
||||||
|
|
||||||
|
* Fisherman now generates information about plugins installed via custom URLs. For the description, a shortened version of the URL is used. For the URL the full URL is used. For tags, the URL is fuzzily checked and tags such as _theme_, _plugin_, _config_ and _omf_ are added. The tag _orphan_ is added by default as well. Finally, the author is generated by retrieving the e-mail or username of the author of the first commit in the plugin's repository. Closes #9 and #14.
|
||||||
|
|
||||||
|
* Changed `--path-in-cache` to `--translate.` This function translates an name or supported URL/URL variation into a path inside `$fisher_cache`. This allows you to treat plugins installed via custom URLs almost like regular plugins if they are installed. Closes #8.
|
||||||
|
|
||||||
|
* Fixed a bug with `mktemp` failing on some systems. Closes #7. Thanks @tobywf.
|
||||||
|
|
||||||
|
* Added [CODE_OF_CONDUCT][code_of_conduct]. 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.
|
||||||
|
|
||||||
|
* Move `getopts` implementation to `share/getopts.awk`. Closes #3.
|
||||||
|
|
||||||
|
* Support dots inside URIs in `fisher --validate`. Closes #2.
|
||||||
|
|
||||||
|
* Refactored and improved tests for `install`, `update` and `uninstall`.
|
||||||
|
|
||||||
|
## [0.1.0][v010] - 2016-01-01
|
||||||
|
|
||||||
* Initial commit.
|
* Initial commit.
|
||||||
|
|
||||||
|
|
||||||
|
:anchor:
|
||||||
|
|
||||||
|
<!-- Links -->
|
||||||
|
|
||||||
|
[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
|
||||||
|
|
55
CODE_OF_CONDUCT.md
Normal file
55
CODE_OF_CONDUCT.md
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
# Contributor 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.
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
* The use of sexualized language or imagery
|
||||||
|
* Personal attacks
|
||||||
|
* Trolling or insulting/derogatory comments
|
||||||
|
* Public or private harassment
|
||||||
|
* Publishing other's private information, such as physical or electronic
|
||||||
|
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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
|
reported by contacting a project maintainer at [Fisherman][email]. 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][homepage],
|
||||||
|
version 1.3.0, available at
|
||||||
|
[http://contributor-covenant.org/version/1/3/0/][version]
|
||||||
|
|
||||||
|
:anchor:
|
||||||
|
|
||||||
|
<!-- Links -->
|
||||||
|
|
||||||
|
[email]: mailto:j@bucaran.me
|
||||||
|
[version]: http://contributor-covenant.org/version/1/3/0/
|
||||||
|
[homepage]: http://contributor-covenant.org
|
|
@ -4,7 +4,7 @@ You can start contributing right away:
|
||||||
|
|
||||||
* [Join][join] the community.
|
* [Join][join] the community.
|
||||||
* [Spread][tweet] the voice.
|
* [Spread][tweet] the voice.
|
||||||
* [Bugs][bugs]? :beetle:
|
* Report [bugs][bugs].
|
||||||
|
|
||||||
If you are looking for other ways to help, peruse [open issues][issues]. If you are already working on something, feel free to send us a PR.
|
If you are looking for other ways to help, peruse [open issues][issues]. If you are already working on something, feel free to send us a PR.
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ If you are looking for other ways to help, peruse [open issues][issues]. If you
|
||||||
|
|
||||||
* Fork the repo and create your feature branch from master.
|
* Fork the repo and create your feature branch from master.
|
||||||
|
|
||||||
* Test before you push. Get familiar with [Fishtape][fishtape].
|
* Test before you push. Get familiar with **[Fishtape][fishtape]**.
|
||||||
|
|
||||||
* If you've changed APIs, update the documentation.
|
* If you've changed APIs, update the documentation.
|
||||||
|
|
||||||
|
@ -25,14 +25,17 @@ Third-party plugins are essential for keeping this project exciting. To learn ho
|
||||||
|
|
||||||
To browse the available content use `fisher search` or see the [Fisherman Index][fisher-index].
|
To browse the available content use `fisher search` or see the [Fisherman Index][fisher-index].
|
||||||
|
|
||||||
<!-- -->
|
<!-- Links -->
|
||||||
|
|
||||||
[org]: https://github.com/fisherman
|
[org]: https://github.com/fisherman
|
||||||
[fishtape]: https://github.com/fisherman/fishtape
|
|
||||||
[join]: https://gitter.im/fisherman/wharf
|
[join]: https://gitter.im/fisherman/wharf
|
||||||
[bugs]: https://github.com/fisherman/fisherman/issues
|
[bugs]: https://github.com/fisherman/fisherman/issues
|
||||||
[issues]: https://github.com/fisherman/fisherman/issues?q=is%3Aopen+is%3Aissue
|
[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
|
[fish-docs]: http://fishshell.com/docs/current/index.html
|
||||||
[seven-rules]: http://chris.beams.io/posts/git-commit/#seven-rules
|
[seven-rules]: http://chris.beams.io/posts/git-commit/#seven-rules
|
||||||
[tweet]: https://twitter.com/intent/tweet?url=https%3A%2F%2Fgit.io%2Ffisher&via=jbucaran&text=Check+out+%23Fisherman+for+the+%23fishshell
|
|
||||||
[fisher-index]: https://github.com/fisherman/fisher-index
|
[fisher-index]: https://github.com/fisherman/fisher-index
|
||||||
|
|
||||||
|
[tweet]: https://twitter.com/intent/tweet?url=https%3A%2F%2Fgit.io%2Ffisher&via=jbucaran&text=Check+out+%23Fisherman+for+the+%23fishshell
|
||||||
|
|
||||||
|
:anchor:
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -56,7 +56,7 @@ $(FISH_CONFIG):
|
||||||
@echo "set fisher_home $(FISHER_HOME)" | sed "s|/$$||;s|$$HOME|~|" > $@.fisher
|
@echo "set fisher_home $(FISHER_HOME)" | sed "s|/$$||;s|$$HOME|~|" > $@.fisher
|
||||||
@echo "set fisher_config $(FISHER_CONFIG)" | sed "s|$$HOME|~|" >> $@.fisher
|
@echo "set fisher_config $(FISHER_CONFIG)" | sed "s|$$HOME|~|" >> $@.fisher
|
||||||
@echo "source \$$fisher_home/config.fish" >> $@.fisher
|
@echo "source \$$fisher_home/config.fish" >> $@.fisher
|
||||||
@awk '!config[$$0]++' $@.fisher $@ > $@.tmp
|
@awk '!config[$$0]++ || /^$$/' $@.fisher $@ > $@.tmp
|
||||||
@mv $@.tmp $@ && rm $@.fisher
|
@mv $@.tmp $@ && rm $@.fisher
|
||||||
|
|
||||||
$(FISHER_CACHE):
|
$(FISHER_CACHE):
|
||||||
|
|
15
README.md
15
README.md
|
@ -10,11 +10,13 @@
|
||||||
|
|
||||||
## About
|
## About
|
||||||
|
|
||||||
Fisherman is a shell manager for [fish][fish] that lets you share and reuse code, prompts and configurations easily.
|
Fisherman is a plugin manager for [fish][fish] that lets you share and reuse code, prompts and configurations easily.
|
||||||
|
|
||||||
Features include a flat tree structure, unified plugin architecture, external self-managed database, cache system, plugin dependencies and compatibility with Oh My Fish!
|
Features include a flat tree structure, external self-managed database, cache system, plugin dependencies and compatibility with Oh My Fish! packages.
|
||||||
|
|
||||||
|
+ See [FAQ][faq].
|
||||||
|
+ See [Screencasts][screencasts].
|
||||||
|
|
||||||
See [FAQ][faq].
|
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
|
@ -22,6 +24,7 @@ See [FAQ][faq].
|
||||||
git clone https://github.com/fisherman/fisherman
|
git clone https://github.com/fisherman/fisherman
|
||||||
cd fisherman
|
cd fisherman
|
||||||
make
|
make
|
||||||
|
fisher help
|
||||||
```
|
```
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
@ -30,7 +33,10 @@ Check out the [contribution](CONTRIBUTING.md) guidelines.
|
||||||
|
|
||||||
## Help
|
## Help
|
||||||
|
|
||||||
See [`fisherman(1)`][fisherman-1] and [`fisherman(7)`][fisherman-7] for usage and documentation. For support and feedback join the [Gitter room][wharf] or browse the [issues][issues].
|
See [`fisherman(1)`][fisherman-1] and [`fisherman(7)`][fisherman-7] for usage and documentation. For support and feedback join the Gitter [room][wharf] or browse the [issues][issues].
|
||||||
|
|
||||||
|
|
||||||
|
:anchor:
|
||||||
|
|
||||||
|
|
||||||
<!-- Links -->
|
<!-- Links -->
|
||||||
|
@ -39,6 +45,7 @@ See [`fisherman(1)`][fisherman-1] and [`fisherman(7)`][fisherman-7] for usage an
|
||||||
[faq]: https://github.com/fisherman/fisherman/wiki/FAQ
|
[faq]: https://github.com/fisherman/fisherman/wiki/FAQ
|
||||||
[issues]: http://github.com/fisherman/fisherman/issues
|
[issues]: http://github.com/fisherman/fisherman/issues
|
||||||
[wharf]: https://gitter.im/fisherman/wharf
|
[wharf]: https://gitter.im/fisherman/wharf
|
||||||
|
[screencasts]: https://github.com/fisherman/fisherman/wiki/Screencasts
|
||||||
[fisherman-1]: man/man1/fisher.md
|
[fisherman-1]: man/man1/fisher.md
|
||||||
[fisherman-7]: man/man7/fisher.md
|
[fisherman-7]: man/man7/fisher.md
|
||||||
[travis-link]: https://travis-ci.org/fisherman/fisherman
|
[travis-link]: https://travis-ci.org/fisherman/fisherman
|
||||||
|
|
|
@ -1,31 +1,13 @@
|
||||||
|
complete -xc fisher -d "Fisherman"
|
||||||
|
complete -c fisher -n "__fish_seen_subcommand_from search" -a "\t"
|
||||||
complete -c fisher -n "__fish_use_subcommand" -s v -l version -d "Show version information"
|
complete -c fisher -n "__fish_use_subcommand" -s v -l version -d "Show version information"
|
||||||
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 "Display help"
|
||||||
complete -c fisher -n "__fish_use_subcommand" -s f -l file -d "Read fishfile"
|
complete -c fisher -n "__fish_use_subcommand" -s f -l file -d "Read fishfile"
|
||||||
|
|
||||||
if test -e $fisher_cache/.index
|
set -l index $fisher_cache/.index
|
||||||
set -l cache (for file in $fisher_cache/*
|
set -l IFS ";"
|
||||||
if test -d $file
|
|
||||||
basename $file
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
awk -v FS='\n' -v RS='' -v OFS=' ' '/^ *#/ { next } { print $1,$3 }' $fisher_cache/.index \
|
|
||||||
| while read -l name info
|
|
||||||
switch "$name"
|
|
||||||
case $cache
|
|
||||||
for cmd in update uninstall
|
|
||||||
complete -c fisher -n "__fish_seen_subcommand_from $cmd" -a "$name" -d "$info"
|
|
||||||
end
|
|
||||||
|
|
||||||
case \*
|
|
||||||
complete -c fisher -n "__fish_seen_subcommand_from install" -a "$name" -d "$info"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
for option in commands guides
|
for option in commands guides
|
||||||
set -l IFS ";"
|
|
||||||
|
|
||||||
fisher help --$option=bare | sed -E 's/^ *([^ ]+) *(.*)/\1;\2/' | while read -l func info
|
fisher help --$option=bare | sed -E 's/^ *([^ ]+) *(.*)/\1;\2/' | while read -l func info
|
||||||
|
|
||||||
complete -c fisher -n "__fish_seen_subcommand_from help" -a $func -d "$info"
|
complete -c fisher -n "__fish_seen_subcommand_from help" -a $func -d "$info"
|
||||||
|
@ -42,5 +24,14 @@ for option in commands guides
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
complete -c fisher -n "__fish_seen_subcommand_from search" -a "\t"
|
if test -e $fisher_cache/.index
|
||||||
complete -xc fisher -d "Fisherman"
|
fisher search --index=$index --select=cache --name --info | while read -l name info
|
||||||
|
for command in update uninstall
|
||||||
|
complete -c fisher -n "__fish_seen_subcommand_from $command" -a "$name" -d "$info"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
fisher search --index=$index --select=remote --name --info | while read -l name info
|
||||||
|
complete -c fisher -n "__fish_seen_subcommand_from install" -a "$name" -d "$info"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
|
@ -6,6 +6,6 @@ set fisher_error_log $fisher_cache/.debug_log
|
||||||
set fish_function_path {$fisher_config,$fisher_home}/functions $fish_function_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
|
set fish_complete_path {$fisher_config,$fisher_home}/completions $fish_complete_path
|
||||||
|
|
||||||
for file in $fisher_config/functions/*.config.fish
|
for file in $fisher_config/conf.d/*.config.fish
|
||||||
source $file
|
source $file
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
function fisher -d "Fish Shell Manager"
|
function fisher -d "Fish plugin manager"
|
||||||
if not set -q argv[1]
|
if not set -q argv[1]
|
||||||
fisher --help
|
fisher --help
|
||||||
return 1
|
return 1
|
||||||
|
@ -19,8 +19,12 @@ function fisher -d "Fish Shell Manager"
|
||||||
set option help
|
set option help
|
||||||
set value $value $2
|
set value $value $2
|
||||||
|
|
||||||
case path-in-cache
|
case cache
|
||||||
set option path-in-cache
|
set option cache
|
||||||
|
set value $2
|
||||||
|
|
||||||
|
case translate
|
||||||
|
set option translate
|
||||||
set value $2
|
set value $2
|
||||||
|
|
||||||
case f file
|
case f file
|
||||||
|
@ -78,22 +82,36 @@ function fisher -d "Fish Shell Manager"
|
||||||
set fisher_default_host https://github.com
|
set fisher_default_host https://github.com
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l id "[A-Za-z0-9_-]"
|
set -l id "[A-Za-z0-9_.-]"
|
||||||
|
|
||||||
sed -En "
|
sed -En "
|
||||||
s#/\$##
|
s#/\$##
|
||||||
s#\.git\$##
|
s#\.git\$##
|
||||||
s#^(https?):*/* *(.*\$)#\1://\2#p
|
s#^(https?):*/* *(.*\$)#\1://\2#p
|
||||||
s#^(@|(gh:)|(github(.com)?[/:]))/?($id+)/($id+)\$#https://github.com/\5/\6#p
|
s#^(@|(gh[:/])|(github(.com)?[/:]))/?($id+)/($id+)\$#https://github.com/\5/\6#p
|
||||||
s#^(bb:)/?($id+)/($id+)\$#https://bitbucket.org/\2/\3#p
|
s#^(bb[:/])/*($id+)/($id+)\$#https://bitbucket.org/\2/\3#p
|
||||||
s#^(gl:)/?($id+)/($id+)\$#https://gitlab.com/\2/\3#p
|
s#^(gl[:/])/*($id+)/($id+)\$#https://gitlab.com/\2/\3#p
|
||||||
|
s#^(omf[:/])/*($id+)\$#https://github.com/oh-my-fish/\2#p
|
||||||
s#^($id+)/($id+)\$#$fisher_default_host/\1/\2#p
|
s#^($id+)/($id+)\$#$fisher_default_host/\1/\2#p
|
||||||
/^file:\/\/\/.*/p
|
/^file:\/\/\/.*/p
|
||||||
/^[a-z]+([._-]?[a-z0-9]+)*\$/p
|
/^[a-z]+([._-]?[a-z0-9]+)*\$/p
|
||||||
" | grep $quiet
|
" | grep $quiet
|
||||||
|
|
||||||
case path-in-cache
|
case cache
|
||||||
while read --prompt= -l item
|
for file in $fisher_cache/*
|
||||||
|
if test -d $file
|
||||||
|
switch "$value"
|
||||||
|
case base
|
||||||
|
basename $file
|
||||||
|
|
||||||
|
case \*
|
||||||
|
printf "%s\n" $file
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
case translate
|
||||||
|
while read --prompt="" -l item
|
||||||
switch "$item"
|
switch "$item"
|
||||||
case \*/\*
|
case \*/\*
|
||||||
for file in $fisher_cache/*
|
for file in $fisher_cache/*
|
||||||
|
|
|
@ -11,7 +11,7 @@ function fisher_install -d "Enable / Install Plugins"
|
||||||
set error /dev/null
|
set error /dev/null
|
||||||
|
|
||||||
case h help
|
case h help
|
||||||
printf "usage: fisher install [<name | url> ...] [--quiet] [--help]\n\n"
|
printf "usage: fisher install [<name or url> ...] [--quiet] [--help]\n\n"
|
||||||
|
|
||||||
printf " -q --quiet Enable quiet mode\n"
|
printf " -q --quiet Enable quiet mode\n"
|
||||||
printf " -h --help Show usage help\n"
|
printf " -h --help Show usage help\n"
|
||||||
|
@ -25,8 +25,8 @@ function fisher_install -d "Enable / Install Plugins"
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l count 0
|
set -l count 0
|
||||||
set -l duration (date +%s)
|
|
||||||
set -l total (count $items)
|
set -l total (count $items)
|
||||||
|
set -l elapsed (date +%s)
|
||||||
|
|
||||||
if set -q items[1]
|
if set -q items[1]
|
||||||
printf "%s\n" $items
|
printf "%s\n" $items
|
||||||
|
@ -38,14 +38,14 @@ function fisher_install -d "Enable / Install Plugins"
|
||||||
switch "$item"
|
switch "$item"
|
||||||
case \*/\*
|
case \*/\*
|
||||||
printf "%s %s\n" $item (
|
printf "%s %s\n" $item (
|
||||||
if not fisher_search --url=$item --field=name
|
if not fisher_search --url=$item --name
|
||||||
printf "%s" $item | sed -E '
|
printf "%s" $item | sed -E '
|
||||||
s/.*\/(.*)/\1/
|
s/.*\/(.*)/\1/
|
||||||
s/^(plugin|theme|pkg|fish)-//'
|
s/^(plugin|theme|pkg|omf|fish|fisher)-//'
|
||||||
end)
|
end)
|
||||||
|
|
||||||
case \*
|
case \*
|
||||||
if set -l url (fisher_search --name=$item --field=url)
|
if set -l url (fisher_search --name=$item --url)
|
||||||
printf "%s %s\n" $url $item
|
printf "%s %s\n" $url $item
|
||||||
|
|
||||||
else if test -d $fisher_cache/$item
|
else if test -d $fisher_cache/$item
|
||||||
|
@ -68,7 +68,7 @@ function fisher_install -d "Enable / Install Plugins"
|
||||||
printf "(%s of %s) >> %s\n" (math 1 + $count) $total $name > $error
|
printf "(%s of %s) >> %s\n" (math 1 + $count) $total $name > $error
|
||||||
end
|
end
|
||||||
|
|
||||||
mkdir -p $fisher_config/{cache,functions,completions,man}
|
mkdir -p $fisher_config/{cache,functions,completions,conf.d,man}
|
||||||
|
|
||||||
set -l path $fisher_cache/$name
|
set -l path $fisher_cache/$name
|
||||||
|
|
||||||
|
@ -91,7 +91,8 @@ function fisher_install -d "Enable / Install Plugins"
|
||||||
printf "Resolving dependencies in %s\n" $name/(basename $bundle) > $error
|
printf "Resolving dependencies in %s\n" $name/(basename $bundle) > $error
|
||||||
|
|
||||||
set -l deps (fisher --file=$bundle \
|
set -l deps (fisher --file=$bundle \
|
||||||
| fisher_install ^&1 | sed -En 's/([0-9]+) plugin\/s.*/\1/p')
|
| fisher_install ^&1 \
|
||||||
|
| sed -En 's/([0-9]+) plugin\/s.*/\1/p')
|
||||||
|
|
||||||
set count (math $count + 0$deps)
|
set count (math $count + 0$deps)
|
||||||
end
|
end
|
||||||
|
@ -108,18 +109,28 @@ function fisher_install -d "Enable / Install Plugins"
|
||||||
|
|
||||||
if test -e $path/fish_prompt.fish -o -e $path/fish_right_prompt.fish
|
if test -e $path/fish_prompt.fish -o -e $path/fish_right_prompt.fish
|
||||||
rm -f $fisher_config/functions/{fish_prompt,fish_right_prompt}.fish
|
rm -f $fisher_config/functions/{fish_prompt,fish_right_prompt}.fish
|
||||||
|
functions -e fish_{,right_}prompt
|
||||||
end
|
end
|
||||||
|
|
||||||
for file in $path/{*,functions{/*,/**/*}}.fish
|
for file in $path/{*,functions{/*,/**/*}}.fish
|
||||||
set -l base (basename $file)
|
set -l base (basename $file)
|
||||||
|
|
||||||
switch $base
|
switch $base
|
||||||
|
case {$name,fish_{,right_}prompt}.fish
|
||||||
|
source $file
|
||||||
|
|
||||||
case {init,uninstall}.fish
|
case {init,uninstall}.fish
|
||||||
set base $name.config.$base
|
set base $name.(basename $base .fish).config.fish
|
||||||
end
|
|
||||||
cp -f $file $fisher_config/functions/$base
|
|
||||||
end
|
end
|
||||||
|
|
||||||
source $fisher_config/functions/$name.fish > /dev/null ^& 1
|
switch $base
|
||||||
|
case \*\?.config.fish
|
||||||
|
cp -f $file $fisher_config/conf.d/$base
|
||||||
|
|
||||||
|
case \*
|
||||||
|
cp -f $file $fisher_config/functions/$base
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
cp -f $path/completions/*.fish $fisher_config/completions/ ^ /dev/null
|
cp -f $path/completions/*.fish $fisher_config/completions/ ^ /dev/null
|
||||||
|
|
||||||
|
@ -147,11 +158,10 @@ function fisher_install -d "Enable / Install Plugins"
|
||||||
end
|
end
|
||||||
|
|
||||||
printf "%s\n" "$name" >> $file
|
printf "%s\n" "$name" >> $file
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
printf "%d plugin/s installed (%0.fs)\n" (math $count) (
|
printf "%d plugin/s installed (%0.fs)\n" (math $count) (
|
||||||
math (date +%s) - $duration) > $error
|
math (date +%s) - $elapsed) > $error
|
||||||
|
|
||||||
if not test $count -gt 0
|
if not test $count -gt 0
|
||||||
return 1
|
return 1
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
function fisher_search -d "Search Fisherman Index"
|
function fisher_search -d "Search Fisherman Index"
|
||||||
set -l index $fisher_cache/.index
|
|
||||||
|
|
||||||
set -l select all
|
set -l select all
|
||||||
set -l fields
|
set -l fields
|
||||||
set -l join "||"
|
set -l join "||"
|
||||||
set -l query
|
set -l query
|
||||||
set -l quiet 0
|
set -l quiet 0
|
||||||
|
set -l index
|
||||||
|
|
||||||
getopts $argv | while read -l 1 2 3
|
getopts $argv | while read -l 1 2 3
|
||||||
switch "$1"
|
switch "$1"
|
||||||
|
@ -69,11 +68,14 @@ function fisher_search -d "Search Fisherman Index"
|
||||||
case Q query
|
case Q query
|
||||||
set query $query $2
|
set query $query $2
|
||||||
|
|
||||||
|
case index
|
||||||
|
set index $2
|
||||||
|
|
||||||
case q quiet
|
case q quiet
|
||||||
set quiet 1
|
set quiet 1
|
||||||
|
|
||||||
case h help
|
case h help
|
||||||
printf "usage: fisher search [<name | url>] [--select=<source>] [--field=<field>]\n"
|
printf "usage: fisher search [<name or url>] [--select=<source>] [--field=<field>]\n"
|
||||||
printf " [--or|--and] [--quiet] [--help]\n\n"
|
printf " [--or|--and] [--quiet] [--help]\n\n"
|
||||||
|
|
||||||
printf " -s --select=<source> Select all, cache or remote plugins \n"
|
printf " -s --select=<source> Select all, cache or remote plugins \n"
|
||||||
|
@ -91,7 +93,7 @@ function fisher_search -d "Search Fisherman Index"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not set -q fields[1]
|
if test -z "$fields[1]"
|
||||||
set fields '$0'
|
set fields '$0'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -100,33 +102,88 @@ function fisher_search -d "Search Fisherman Index"
|
||||||
|
|
||||||
switch "$select"
|
switch "$select"
|
||||||
case all
|
case all
|
||||||
if not fisher_update --quiet --index
|
if test -z "$index"
|
||||||
|
set index $fisher_cache/.index
|
||||||
|
|
||||||
if test -s $fisher_index
|
if test -s $fisher_index
|
||||||
set index $fisher_index
|
set index $fisher_index
|
||||||
|
else
|
||||||
|
fisher_update --quiet --index
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not cat $index ^ /dev/null
|
if not test -s $index
|
||||||
printf "fisher: '%s' invalid path or url\n" $index >& 2
|
printf "fisher: '%s' invalid path or url\n" $index >& 2
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
set -l cache (fisher --cache=base)
|
||||||
|
awk -v FS='\n' -v RS='' -v cache_items="$cache" '
|
||||||
|
|
||||||
|
BEGIN {
|
||||||
|
split(cache_items, cache, " ")
|
||||||
|
}
|
||||||
|
|
||||||
|
/^ *#/ { next } {
|
||||||
|
for (i in cache) {
|
||||||
|
if (cache[i] == $1) {
|
||||||
|
delete cache[i]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
END {
|
||||||
|
for (i in cache) {
|
||||||
|
printf("%s\n", cache[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
' $index | while read -l orphan
|
||||||
|
git -C $fisher_cache/$orphan ls-remote --get-url \
|
||||||
|
| read -l url
|
||||||
|
|
||||||
|
printf "%s\n" $url \
|
||||||
|
| sed -E '
|
||||||
|
s|^https?://||
|
||||||
|
s|^github\.com||
|
||||||
|
s|^bitbucket.org|bb:|
|
||||||
|
s|^gitlab.com|gl:|
|
||||||
|
s|^/||' \
|
||||||
|
| read -l info
|
||||||
|
|
||||||
|
git -C $fisher_cache/$orphan show -s --format='%ae;%an' (
|
||||||
|
git -C $fisher_cache/$orphan rev-list --max-parents=0 HEAD) \
|
||||||
|
| awk -v FS=';' '{ printf("%s\n", ($1 ? $1 : $2 ? $2 : "unknown")) }' \
|
||||||
|
| read -l author
|
||||||
|
|
||||||
|
set -l tags orphan
|
||||||
|
|
||||||
|
for tag in theme plugin oh-my-fish config
|
||||||
|
if printf "%s" "$url" | grep -q $tag
|
||||||
|
switch "$tag"
|
||||||
|
case oh-my-fish
|
||||||
|
set tag omf
|
||||||
|
end
|
||||||
|
set tags $tag $tags
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
printf "\n%s\n%s\n%s\n%s\n%s\n\n" "$orphan" "$url" "$info" "$tags" "$author"
|
||||||
|
end
|
||||||
|
|
||||||
|
cat $index
|
||||||
|
|
||||||
case remote
|
case remote
|
||||||
fisher_search -a --name!=(
|
fisher_search --index=$index --and --name!=(fisher --cache=base)
|
||||||
fisher_search --field=name --select=cache)
|
|
||||||
|
|
||||||
case cache
|
case cache
|
||||||
set -l names (for file in $fisher_cache/*
|
fisher --cache=base | read -laz cache
|
||||||
if test -d $file
|
|
||||||
basename $file
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
if test -z "$names"
|
if test -z "$cache"
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
fisher_search --select=all --name=$names
|
fisher_search --index=$index --select=all --name=$cache
|
||||||
|
|
||||||
end | awk -F'\n' -v RS='' -v OFS=';' (
|
end | awk -F'\n' -v RS='' -v OFS=';' (
|
||||||
if test "$fields" = '$0'
|
if test "$fields" = '$0'
|
||||||
|
@ -164,10 +221,10 @@ function fisher_search -d "Search Fisherman Index"
|
||||||
$query {
|
$query {
|
||||||
print $fields
|
print $fields
|
||||||
}
|
}
|
||||||
" | sed '${/^$/d;}' | awk -v q=$quiet '
|
" | sed '${/^$/d;}' | awk -v quiet=$quiet '
|
||||||
!/^ *$/ { ret = 1 }
|
!/^ *$/ { notEmpty = 1 }
|
||||||
!q { print }
|
!quiet { print }
|
||||||
q && !ret { exit !ret }
|
quiet && !notEmpty { exit !notEmpty }
|
||||||
END { exit !ret }
|
END { exit !notEmpty }
|
||||||
'
|
'
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,10 +18,8 @@ function fisher_uninstall -d "Disable / Uninstall Plugins"
|
||||||
set error /dev/null
|
set error /dev/null
|
||||||
|
|
||||||
case help h
|
case help h
|
||||||
printf "usage: fisher uninstall [<name | url> ...] [--all] [--force] [--quiet]\n"
|
printf "usage: fisher uninstall [<name or url> ...] [--force] [--quiet] [--help]\n\n"
|
||||||
printf " [--help]\n\n"
|
|
||||||
|
|
||||||
printf " -a --all Uninstall all plugins \n"
|
|
||||||
printf " -f --force Delete copy from cache \n"
|
printf " -f --force Delete copy from cache \n"
|
||||||
printf " -q --quiet Enable quiet mode \n"
|
printf " -q --quiet Enable quiet mode \n"
|
||||||
printf " -h --help Show usage help \n"
|
printf " -h --help Show usage help \n"
|
||||||
|
@ -38,21 +36,12 @@ function fisher_uninstall -d "Disable / Uninstall Plugins"
|
||||||
set -l duration (date +%s)
|
set -l duration (date +%s)
|
||||||
set -l total (count $items)
|
set -l total (count $items)
|
||||||
|
|
||||||
switch all
|
|
||||||
case $option
|
|
||||||
set -l cache (find $fisher_cache/* -maxdepth 0 -type d)
|
|
||||||
set total (count $cache)
|
|
||||||
printf "%s\n" $cache
|
|
||||||
|
|
||||||
case \*
|
|
||||||
if set -q items[1]
|
if set -q items[1]
|
||||||
printf "%s\n" $items
|
printf "%s\n" $items
|
||||||
else
|
else
|
||||||
fisher --file=-
|
fisher --file=-
|
||||||
|
|
||||||
end | fisher --validate | fisher --path-in-cache
|
end | fisher --validate | fisher --translate | while read -l path
|
||||||
|
|
||||||
end | while read -l path
|
|
||||||
|
|
||||||
if not test -d "$path"
|
if not test -d "$path"
|
||||||
printf "fisher: '%s' not found\n" $path > $error
|
printf "fisher: '%s' not found\n" $path > $error
|
||||||
|
@ -73,17 +62,22 @@ function fisher_uninstall -d "Disable / Uninstall Plugins"
|
||||||
|
|
||||||
set count (math $count + 1)
|
set count (math $count + 1)
|
||||||
|
|
||||||
functions -e $name
|
|
||||||
|
|
||||||
for file in $path/{*,functions{/*,/**/*}}.fish
|
for file in $path/{*,functions{/*,/**/*}}.fish
|
||||||
set -l base (basename $file)
|
set -l base (basename $file)
|
||||||
|
|
||||||
switch $base
|
switch $base
|
||||||
case {init,before.init,uninstall}.fish
|
case {$name,fish_{,right_}prompt}.fish
|
||||||
set base $name.$base
|
functions -e (basename $base .fish)
|
||||||
|
|
||||||
|
if test "$base" = fish_prompt.fish
|
||||||
|
source $__fish_datadir/functions/fish_prompt.fish ^ /dev/null
|
||||||
end
|
end
|
||||||
|
|
||||||
rm -f $fisher_config/functions/$base
|
case {init,before.init,uninstall}.fish
|
||||||
|
set base $name.(basename $base .fish).config.fish
|
||||||
|
end
|
||||||
|
|
||||||
|
rm -f $file $fisher_config/{functions,conf.d}/$base
|
||||||
end
|
end
|
||||||
|
|
||||||
for file in $path/completions/*.fish
|
for file in $path/completions/*.fish
|
||||||
|
@ -111,7 +105,7 @@ function fisher_uninstall -d "Disable / Uninstall Plugins"
|
||||||
continue
|
continue
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l tmp (mktemp)
|
set -l tmp (mktemp -t fisher.XXX)
|
||||||
|
|
||||||
if not sed -E '/^ *'(printf "%s|%s" $name $url | sed 's|/|\\\/|g'
|
if not sed -E '/^ *'(printf "%s|%s" $name $url | sed 's|/|\\\/|g'
|
||||||
)'([ #].*)*$/d' < $file > $tmp
|
)'([ #].*)*$/d' < $file > $tmp
|
||||||
|
|
|
@ -10,32 +10,27 @@ function fisher_update -d "Fisherman Update Manager"
|
||||||
set items $items $2
|
set items $items $2
|
||||||
|
|
||||||
case index
|
case index
|
||||||
set option $option index
|
set option index
|
||||||
|
|
||||||
case s {,it,my,one}self fisher{,man}
|
|
||||||
set option $option self
|
|
||||||
|
|
||||||
case c cache
|
|
||||||
set option $option cache
|
|
||||||
|
|
||||||
case path
|
case path
|
||||||
set option path
|
set option path
|
||||||
set path $2
|
set path $2
|
||||||
|
|
||||||
|
case m me self fisher{,man}
|
||||||
|
set option $option me
|
||||||
|
|
||||||
case q quiet
|
case q quiet
|
||||||
if test -z "$2"
|
if test -z "$2"
|
||||||
set 2 /dev/null
|
set 2 /dev/null
|
||||||
end
|
end
|
||||||
|
|
||||||
set error $2
|
set error $2
|
||||||
|
|
||||||
case help h
|
case help h
|
||||||
printf "usage: fisher update [<name | url> ...] [--self] [--cache]\n"
|
printf "usage: fisher update [<name or url> ...] [--me] [--quiet] [--help]\n\n"
|
||||||
printf " [--path=<path>] [--quiet] [--help]\n\n"
|
|
||||||
|
|
||||||
printf " -s --self Update Fisherman \n"
|
printf " -m --me Update Fisherman\n"
|
||||||
printf " -c --cache Update cached plugins \n"
|
printf " -q --quiet Enable quiet mode\n"
|
||||||
printf " --path=<path> Update repository at given path \n"
|
|
||||||
printf " -q --quiet Enable quiet mode \n"
|
|
||||||
printf " -h --help Show usage help \n"
|
printf " -h --help Show usage help \n"
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -46,8 +41,8 @@ function fisher_update -d "Fisherman Update Manager"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
switch path
|
switch "$option"
|
||||||
case $option
|
case path
|
||||||
if not test -d $path
|
if not test -d $path
|
||||||
printf "fisher: '%s' invalid path\n" $path > $error
|
printf "fisher: '%s' invalid path\n" $path > $error
|
||||||
return 1
|
return 1
|
||||||
|
@ -57,26 +52,17 @@ function fisher_update -d "Fisherman Update Manager"
|
||||||
git -C $path checkout --quiet master ^/dev/null
|
git -C $path checkout --quiet master ^/dev/null
|
||||||
git -C $path pull --quiet --rebase origin master"
|
git -C $path pull --quiet --rebase origin master"
|
||||||
|
|
||||||
return
|
case index
|
||||||
end
|
|
||||||
|
|
||||||
switch index
|
|
||||||
case $option
|
|
||||||
mkdir -p $fisher_cache
|
mkdir -p $fisher_cache
|
||||||
set -l index $fisher_cache/.(random)
|
set -l index $fisher_cache/.index.tmp
|
||||||
|
|
||||||
if not wait --spin=pipe --log=$fisher_error_log "curl -sS $fisher_index > $index"
|
|
||||||
rm -f $index
|
|
||||||
cat $fisher_error_log > $error
|
|
||||||
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
|
|
||||||
|
if curl -s $fisher_index > $index
|
||||||
mv -f $index $fisher_cache/.index
|
mv -f $index $fisher_cache/.index
|
||||||
end
|
end
|
||||||
|
|
||||||
switch self
|
rm -f $index
|
||||||
case $option
|
|
||||||
|
case me
|
||||||
set -l elap (date +%s)
|
set -l elap (date +%s)
|
||||||
|
|
||||||
printf "Updating >> Fisherman\n" > $error
|
printf "Updating >> Fisherman\n" > $error
|
||||||
|
@ -86,35 +72,17 @@ function fisher_update -d "Fisherman Update Manager"
|
||||||
end
|
end
|
||||||
|
|
||||||
printf "Done without errors (%0.fs)\n" (math (date +%s) - $elap) > $error
|
printf "Done without errors (%0.fs)\n" (math (date +%s) - $elap) > $error
|
||||||
end
|
|
||||||
|
|
||||||
|
case \*
|
||||||
set -l elap (date +%s)
|
set -l elap (date +%s)
|
||||||
set -l count 0
|
set -l count 0
|
||||||
set -l total (count $items)
|
set -l total (count $items)
|
||||||
|
|
||||||
switch cache
|
|
||||||
case $option
|
|
||||||
set -l cache (find $fisher_cache/* -maxdepth 0 -type d)
|
|
||||||
set total (count $cache)
|
|
||||||
printf "%s\n" $cache
|
|
||||||
|
|
||||||
case \*
|
|
||||||
if set -q items[1]
|
if set -q items[1]
|
||||||
printf "%s\n" $items
|
printf "%s\n" $items
|
||||||
else
|
else
|
||||||
|
|
||||||
if contains -- $option self
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if contains -- $option index
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
fisher --file=-
|
fisher --file=-
|
||||||
end | fisher --validate | fisher --path-in-cache
|
end | fisher --validate | fisher --translate | while read -l path
|
||||||
|
|
||||||
end | while read -l path
|
|
||||||
|
|
||||||
if not test -d "$path"
|
if not test -d "$path"
|
||||||
printf "fisher: '%s' not found\n" $path > $error
|
printf "fisher: '%s' not found\n" $path > $error
|
||||||
|
@ -146,4 +114,5 @@ function fisher_update -d "Fisherman Update Manager"
|
||||||
printf "%d plugin/s updated (%0.fs)\n" $count (math (date +%s) - $elap) > $error
|
printf "%d plugin/s updated (%0.fs)\n" $count (math (date +%s) - $elap) > $error
|
||||||
|
|
||||||
test $count -gt 0
|
test $count -gt 0
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,28 +6,5 @@ function getopts -d "Parse CLI options"
|
||||||
printf "%s\n" $argv | sed -E '
|
printf "%s\n" $argv | sed -E '
|
||||||
s/^-([A-Za-z]+)/- \1 /
|
s/^-([A-Za-z]+)/- \1 /
|
||||||
s/^--([A-Za-z0-9_-]+)(!?)=?(.*)/-- \1 \3 \2 /' | \
|
s/^--([A-Za-z0-9_-]+)(!?)=?(.*)/-- \1 \3 \2 /' | \
|
||||||
awk '
|
awk -f $fisher_home/share/getopts.awk
|
||||||
function add(k, v) { if (seen[k v]++) return; print k (v == "" ? "" : " "v) }
|
|
||||||
function pop() { return size <= 0 ? "_" : stack[size--] }
|
|
||||||
function push(k) { stack[++size] = k }
|
|
||||||
function flush() { while (size) add(pop()) }
|
|
||||||
|
|
||||||
$0 == "" { next }
|
|
||||||
done { add("_" , $1$2$3); next }
|
|
||||||
|
|
||||||
$1 == "--" && !$2 { done = 1 ; next }
|
|
||||||
$1 !~ /^-|^--/ { add( pop(), $0 ) ; next }
|
|
||||||
|
|
||||||
size { flush() }
|
|
||||||
$3 { for (i = 4; i <= NF; i++) $3 = $3" "$i }
|
|
||||||
|
|
||||||
$1 == "--" { if ($3 == "") push($2); else add($2, $3) }
|
|
||||||
$1 == "-" {
|
|
||||||
if ($2 == "") { print $1; next } else n = split($2, keys, "")
|
|
||||||
if ($3 == "") push(keys[n]); else add(keys[n], $3)
|
|
||||||
for (i = 1; i < n; i++) add(keys[i])
|
|
||||||
}
|
|
||||||
|
|
||||||
END { flush() }
|
|
||||||
'
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -90,7 +90,7 @@ function wait -d "Run commands and wait with a spin"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l tmp (mktemp)
|
set -l tmp (mktemp -t wait.XXX)
|
||||||
|
|
||||||
fish -c "$commands" ^ $tmp &
|
fish -c "$commands" ^ $tmp &
|
||||||
|
|
||||||
|
|
|
@ -69,8 +69,12 @@ Display usage help for \fIcommand\fR\. To supply usage help with a command, \fIc
|
||||||
Show usage help\.
|
Show usage help\.
|
||||||
.
|
.
|
||||||
.SH "EXAMPLES"
|
.SH "EXAMPLES"
|
||||||
|
.
|
||||||
|
.IP "\(bu" 4
|
||||||
Display usage help for all Fisherman commands\.
|
Display usage help for all Fisherman commands\.
|
||||||
.
|
.
|
||||||
|
.IP "" 0
|
||||||
|
.
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
.
|
.
|
||||||
.nf
|
.nf
|
||||||
|
|
|
@ -48,7 +48,7 @@ There are utilities that can help you generate man pages from other text formats
|
||||||
|
|
||||||
## EXAMPLES
|
## EXAMPLES
|
||||||
|
|
||||||
Display usage help for all Fisherman commands.
|
* Display usage help for all Fisherman commands.
|
||||||
|
|
||||||
```
|
```
|
||||||
fisher help --commands=bare | fisher help --usage
|
fisher help --commands=bare | fisher help --usage
|
||||||
|
|
|
@ -21,13 +21,56 @@ fisher \fBinstall\fR \fIowner/repo\fR \.\.\.
|
||||||
Install one or \fImore\fR plugins by \fIname\fR, searching \fB$fisher_index\fR or by \fIurl\fR\. If no arguments are given, read the standard input\.
|
Install one or \fImore\fR plugins by \fIname\fR, searching \fB$fisher_index\fR or by \fIurl\fR\. If no arguments are given, read the standard input\.
|
||||||
.
|
.
|
||||||
.P
|
.P
|
||||||
If a copy of the plugin already exists in \fB$fisher_cache\fR, the relevant files are copied to \fB$fisher_config\fR/functions, otherwise the plugin repository is first downloaded\. If you wish to update a plugin, use \fBfisher update\fR instead\.
|
If the domain or host is not provided, Fisherman will use any value in \fB$fisher_default_host\fR\. The default is \fBhttps://github\.com\fR\.
|
||||||
.
|
.
|
||||||
.P
|
.P
|
||||||
If the plugin declares any dependencies, they will be installed as well\. If any dependencies are already installed they will not be updated in order to prevent mismatching version issues\. See \fBfisher help fishfile\fR#{\fBPlugins\fR}\.
|
In addition, all of the following variations are accepted:
|
||||||
|
.
|
||||||
|
.IP "\(bu" 4
|
||||||
|
\fBgithub\fR/owner/repo \fB\->\fR https://github\.com/owner/repo
|
||||||
|
.
|
||||||
|
.br
|
||||||
|
|
||||||
|
.
|
||||||
|
.IP "\(bu" 4
|
||||||
|
\fBgh:\fRowner/repo \fB\->\fR https://github\.com/owner/repo
|
||||||
|
.
|
||||||
|
.br
|
||||||
|
|
||||||
|
.
|
||||||
|
.IP "" 0
|
||||||
.
|
.
|
||||||
.P
|
.P
|
||||||
If a plugin includes either a fish_prompt\.\fBfish\fR or fish_right_prompt\.\fBfish\fR, both files are first removed from \fB$fisher_config\fR/functions and then the new one\fIs\fR are copied\.
|
Shortcuts for other common Git repository hosting services are also available:
|
||||||
|
.
|
||||||
|
.IP "\(bu" 4
|
||||||
|
\fBbb:\fR/owner/repo \fB\->\fR https://bitbucket\.org/owner/repo
|
||||||
|
.
|
||||||
|
.br
|
||||||
|
|
||||||
|
.
|
||||||
|
.IP "\(bu" 4
|
||||||
|
\fBgl:\fR/owner/repo \fB\->\fR https://gitlab\.com/owner/repo
|
||||||
|
.
|
||||||
|
.br
|
||||||
|
|
||||||
|
.
|
||||||
|
.IP "\(bu" 4
|
||||||
|
\fBomf:\fR/owner/repo \fB\->\fR https://github\.com/oh\-my\-fish/repo
|
||||||
|
.
|
||||||
|
.br
|
||||||
|
|
||||||
|
.
|
||||||
|
.IP "" 0
|
||||||
|
.
|
||||||
|
.P
|
||||||
|
If a copy of the plugin already exists in \fB$fisher_cache\fR, the relevant files will be copied to \fB$fisher_config\fR/functions, otherwise the plugin repository is first downloaded\. If you wish to update a plugin, use \fBfisher update\fR \fIplugin\fR instead\.
|
||||||
|
.
|
||||||
|
.P
|
||||||
|
If the plugin declares dependencies, these will be installed as well\. If any dependencies are already installed they will not be updated in order to prevent version issues\. See \fBfisher help fishfile\fR#{\fBPlugins\fR}\.
|
||||||
|
.
|
||||||
|
.P
|
||||||
|
If a plugin includes either a fish_prompt\.fish or fish_right_prompt\.fish, both files are first removed from \fB$fisher_config\fR/functions and then the new ones are copied\.
|
||||||
.
|
.
|
||||||
.SH "OPTIONS"
|
.SH "OPTIONS"
|
||||||
.
|
.
|
||||||
|
@ -101,7 +144,7 @@ Here is the \fIplugin\fR tree inside the cache:
|
||||||
.br
|
.br
|
||||||
.
|
.
|
||||||
.P
|
.P
|
||||||
And here is how files are copied from \fB$fisher_cache\fR/plugin to \fB$fisher_config\fR:
|
And thisi is how the files are copied from \fB$fisher_cache\fR/plugin to \fB$fisher_config\fR:
|
||||||
.
|
.
|
||||||
.IP "1." 4
|
.IP "1." 4
|
||||||
\fIplugin\fR\.fish \fB\->\fR $fisher_config/functions
|
\fIplugin\fR\.fish \fB\->\fR $fisher_config/functions
|
||||||
|
|
|
@ -14,11 +14,24 @@ fisher `install` *owner/repo* ...<br>
|
||||||
|
|
||||||
Install one or *more* plugins by *name*, searching `$fisher_index` or by *url*. If no arguments are given, read the standard input.
|
Install one or *more* plugins by *name*, searching `$fisher_index` or by *url*. If no arguments are given, read the standard input.
|
||||||
|
|
||||||
If a copy of the plugin already exists in `$fisher_cache`, the relevant files are copied to `$fisher_config`/functions, otherwise the plugin repository is first downloaded. If you wish to update a plugin, use `fisher update` instead.
|
If the domain or host is not provided, Fisherman will use any value in `$fisher_default_host`. The default is `https://github.com`.
|
||||||
|
|
||||||
If the plugin declares any dependencies, they will be installed as well. If any dependencies are already installed they will not be updated in order to prevent mismatching version issues. See `fisher help fishfile`#{`Plugins`}.
|
In addition, all of the following variations are accepted:
|
||||||
|
|
||||||
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 one*s* are copied.
|
* `github`/owner/repo `->` https://github.com/owner/repo<br>
|
||||||
|
* `gh:`owner/repo `->` https://github.com/owner/repo<br>
|
||||||
|
|
||||||
|
Shortcuts for other common Git repository hosting services are also available:
|
||||||
|
|
||||||
|
* `bb:`/owner/repo `->` https://bitbucket.org/owner/repo<br>
|
||||||
|
* `gl:`/owner/repo `->` https://gitlab.com/owner/repo<br>
|
||||||
|
* `omf:`/owner/repo `->` https://github.com/oh-my-fish/repo<br>
|
||||||
|
|
||||||
|
If a copy of the plugin already exists in `$fisher_cache`, the relevant files will be copied to `$fisher_config`/functions, otherwise the plugin repository is first downloaded. If you wish to update a plugin, use `fisher update` *plugin* instead.
|
||||||
|
|
||||||
|
If the plugin declares dependencies, these will be installed as well. If any dependencies are already installed they will not be updated in order to prevent version issues. See `fisher help fishfile`#{`Plugins`}.
|
||||||
|
|
||||||
|
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
|
## OPTIONS
|
||||||
|
|
||||||
|
@ -55,7 +68,7 @@ Here is the *plugin* tree inside the cache:
|
||||||
|-- *plugin*.1<br>
|
|-- *plugin*.1<br>
|
||||||
|
|
||||||
|
|
||||||
And here is how files are copied from `$fisher_cache`/plugin to `$fisher_config`:
|
And thisi is how the files are copied from `$fisher_cache`/plugin to `$fisher_config`:
|
||||||
|
|
||||||
1. *plugin*.fish `->` $fisher_config/functions
|
1. *plugin*.fish `->` $fisher_config/functions
|
||||||
2. functions/plugin_helper.fish `->` $fisher_config/functions
|
2. functions/plugin_helper.fish `->` $fisher_config/functions
|
||||||
|
|
|
@ -71,19 +71,19 @@ See #{\fBOutput\fR} for more information\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-s\fR \fB\-\-select\fR[=\fIall\fR|\fIcache\fR|\fIremote\fR]
|
\fB\-s\fR \fB\-\-select\fR[=\fIall\fR|\fIcache\fR|\fIremote\fR]
|
||||||
Select record set\. \-\-select=\fIcache\fR queries only local plugins, i\.e\., those inside \fB$fisher_cache\fR\. \-\-select=\fIremote\fR queries all plugins not in the cache\. \-\-select=\fIall\fR queries everything\.
|
Select the record source\. \-\-select=\fIcache\fR queries only local plugins, i\.e\., those inside \fB$fisher_cache\fR\. \-\-select=\fIremote\fR queries all plugins not in the cache, i\.e, those available to install\. \-\-select=\fIall\fR queries everything\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-f\fR \fB\-\-field\fR=\fIname\fR|\fIurl\fR|\fIinfo\fR|\fItag\fR|\fIauthor\fR
|
\fB\-f\fR \fB\-\-field\fR=\fIname\fR|\fIurl\fR|\fIinfo\fR|\fItag\fR|\fIauthor\fR
|
||||||
Display only given fields from the result record set\. Use \fB\-\-select\fR to filter the record set\. Use \-\-\fIfield\fR instead as a shortcut, i\.e\., \fB\-\-name\fR is equivalent to \fB\-\-field\fR=name\.
|
Display only the given fields from the selected records\. Use \-\-\fIfield\fR instead as a shortcut for \fB\-\-field\fR=name\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\-\-\fIfield\fR[=\fImatch\fR]
|
\-\-\fIfield\fR[=\fImatch\fR]
|
||||||
Filter the result set by \fIfield\fR=\fImatch\fR, where \fIfield\fR can be any of \fBname\fR, \fBurl\fR, \fBinfo\fR, \fBtag\fR or \fBauthor\fR\. If \fImatch\fR is not given, this is equivalent to \fB\-\-select\fR=\fIfield\fR\. Use \fB!=\fR to negate the query\.
|
Filter the result set by \fIfield\fR=\fImatch\fR, where \fIfield\fR can be one or more of \fBname\fR, \fBurl\fR, \fBinfo\fR, \fBtag\fR or \fBauthor\fR\. If \fImatch\fR is not given, this is equivalent to \fB\-\-select\fR=\fIfield\fR\. Use \fB!=\fR to negate the query\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\-\-\fIfield\fR[~\fB/\fR\fIregex\fR\fB/\fR]
|
\-\-\fIfield\fR[~\fB/\fR\fIregex\fR\fB/\fR]
|
||||||
Essentially the same as \-\-\fIfield\fR=\fImatch\fR, but with Regular Expression support\. \-\-\fIfield\fR~\fB/\fR\fIregex\fR\fB/\fR filters the result set using the given \fB/\fR\fIregex\fR\fB/\fR\. For example, \-\-name=\fB/\fR^\fImatch\fR$\fB/\fR is essentially the same as \-\-\fIfield\fR=\fImatch\fR and \-\-url~\fB/\fRoh\-my\-fish\fB/\fR selects only Oh My Fish! plugins\. Use \fB!~\fR to negate the query\.
|
Essentially the same as \-\-\fIfield\fR=\fImatch\fR, but with Regular Expression support\. \-\-\fIfield\fR~\fB/\fR\fIregex\fR\fB/\fR filters the result set using the given \fB/\fR\fIregex\fR\fB/\fR\. For example, \-\-name=\fB/\fR^\fImatch\fR$\fB/\fR is the same as \-\-\fIfield\fR=\fImatch\fR and \-\-url~\fB/\fRoh\-my\-fish\fB/\fR selects only Oh My Fish! plugins\. Use \fB!~\fR to negate the query\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-a\fR \fB\-\-and\fR
|
\fB\-a\fR \fB\-\-and\fR
|
||||||
|
@ -112,7 +112,7 @@ The default behavior is to print the result set to standard output in its origin
|
||||||
.
|
.
|
||||||
.nf
|
.nf
|
||||||
|
|
||||||
fisher search bobthefish shark
|
fisher search shark
|
||||||
.
|
.
|
||||||
.fi
|
.fi
|
||||||
.
|
.
|
||||||
|
@ -125,12 +125,6 @@ fisher search bobthefish shark
|
||||||
.
|
.
|
||||||
.nf
|
.nf
|
||||||
|
|
||||||
bobthefish
|
|
||||||
https://github\.com/oh\-my\-fish/theme\-bobthefish
|
|
||||||
A Powerline\-style, Git\-aware fish theme optimized for awesome
|
|
||||||
theme powerline awesome
|
|
||||||
bobthecow
|
|
||||||
|
|
||||||
shark
|
shark
|
||||||
https://github\.com/bucaran/shark
|
https://github\.com/bucaran/shark
|
||||||
Sparklines for your Fish
|
Sparklines for your Fish
|
||||||
|
@ -148,7 +142,7 @@ Search is optimized for parsing when using filters: \fB\-\-name\fR, \fB\-\-url\f
|
||||||
.
|
.
|
||||||
.nf
|
.nf
|
||||||
|
|
||||||
fisher search bobthefish shark \-\-name \-\-url
|
fisher search shark \-\-name \-\-url
|
||||||
.
|
.
|
||||||
.fi
|
.fi
|
||||||
.
|
.
|
||||||
|
@ -161,7 +155,6 @@ fisher search bobthefish shark \-\-name \-\-url
|
||||||
.
|
.
|
||||||
.nf
|
.nf
|
||||||
|
|
||||||
bobthefish;https://github\.com/oh\-my\-fish/theme\-bobthefish
|
|
||||||
shark;https://github\.com/bucaran/shark
|
shark;https://github\.com/bucaran/shark
|
||||||
.
|
.
|
||||||
.fi
|
.fi
|
||||||
|
@ -172,8 +165,12 @@ shark;https://github\.com/bucaran/shark
|
||||||
The result set above consists of single line \fB\'\en\'\fR separated records where each record consists of one or more of the given fields separated by a semicolon \fB\';\'\fR\.
|
The result set above consists of single line \fB\'\en\'\fR separated records where each record consists of one or more of the given fields separated by a semicolon \fB\';\'\fR\.
|
||||||
.
|
.
|
||||||
.SH "EXAMPLES"
|
.SH "EXAMPLES"
|
||||||
|
.
|
||||||
|
.IP "\(bu" 4
|
||||||
Display all plugins by name and format into multiple columns\.
|
Display all plugins by name and format into multiple columns\.
|
||||||
.
|
.
|
||||||
|
.IP "" 0
|
||||||
|
.
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
.
|
.
|
||||||
.nf
|
.nf
|
||||||
|
@ -184,9 +181,11 @@ fisher search \-\-name | column
|
||||||
.
|
.
|
||||||
.IP "" 0
|
.IP "" 0
|
||||||
.
|
.
|
||||||
.P
|
.IP "\(bu" 4
|
||||||
Display all plugins by url, sans \fIhttps://github\.com/\fR and format into multiple columns\.
|
Display all plugins by url, sans \fIhttps://github\.com/\fR and format into multiple columns\.
|
||||||
.
|
.
|
||||||
|
.IP "" 0
|
||||||
|
.
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
.
|
.
|
||||||
.nf
|
.nf
|
||||||
|
@ -197,9 +196,11 @@ fisher search \-\-field=url \-\-select=all | sed \'s|https://github\.com/||\' |
|
||||||
.
|
.
|
||||||
.IP "" 0
|
.IP "" 0
|
||||||
.
|
.
|
||||||
.P
|
.IP "\(bu" 4
|
||||||
Display all remote plugins by name tagged as \fIa\fR or \fIb\fR\.
|
Display all remote plugins by name tagged as \fIa\fR or \fIb\fR\.
|
||||||
.
|
.
|
||||||
|
.IP "" 0
|
||||||
|
.
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
.
|
.
|
||||||
.nf
|
.nf
|
||||||
|
@ -210,9 +211,11 @@ fisher search \-\-select=remote \-\-name \-\-tag=github \-\-or \-\-tag=tool
|
||||||
.
|
.
|
||||||
.IP "" 0
|
.IP "" 0
|
||||||
.
|
.
|
||||||
.P
|
.IP "\(bu" 4
|
||||||
Search plugins from a list of one or more urls and / or names and display their authors\.
|
Search plugins from a list of one or more urls and / or names and display their authors\.
|
||||||
.
|
.
|
||||||
|
.IP "" 0
|
||||||
|
.
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
.
|
.
|
||||||
.nf
|
.nf
|
||||||
|
@ -223,9 +226,11 @@ fisher search $urls $names \-\-url
|
||||||
.
|
.
|
||||||
.IP "" 0
|
.IP "" 0
|
||||||
.
|
.
|
||||||
.P
|
.IP "\(bu" 4
|
||||||
Search all plugins in the cache whose name does not start with the letter \fBs\fR\.
|
Search all plugins in the cache whose name does not start with the letter \fBs\fR\.
|
||||||
.
|
.
|
||||||
|
.IP "" 0
|
||||||
|
.
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
.
|
.
|
||||||
.nf
|
.nf
|
||||||
|
|
|
@ -39,16 +39,16 @@ See #{`Output`} for more information.
|
||||||
## OPTIONS
|
## OPTIONS
|
||||||
|
|
||||||
* `-s` `--select`[=*all*|*cache*|*remote*]:
|
* `-s` `--select`[=*all*|*cache*|*remote*]:
|
||||||
Select record set. --select=*cache* queries only local plugins, i.e., those inside `$fisher_cache`. --select=*remote* queries all plugins not in the cache. --select=*all* queries everything.
|
Select the record source. --select=*cache* queries only local plugins, i.e., those inside `$fisher_cache`. --select=*remote* queries all plugins not in the cache, i.e, those available to install. --select=*all* queries everything.
|
||||||
|
|
||||||
* `-f` `--field`=*name*|*url*|*info*|*tag*|*author*:
|
* `-f` `--field`=*name*|*url*|*info*|*tag*|*author*:
|
||||||
Display only given fields from the result record set. Use `--select` to filter the record set. Use --*field* instead as a shortcut, i.e., `--name` is equivalent to `--field`=name.
|
Display only the given fields from the selected records. Use --*field* instead as a shortcut for `--field`=name.
|
||||||
|
|
||||||
* --*field*[=*match*]:
|
* --*field*[=*match*]:
|
||||||
Filter the result set by *field*=*match*, where *field* can be any of `name`, `url`, `info`, `tag` or `author`. If *match* is not given, this is equivalent to `--select`=*field*. Use `!=` to negate the query.
|
Filter the result set by *field*=*match*, where *field* can be one or more of `name`, `url`, `info`, `tag` or `author`. If *match* is not given, this is equivalent to `--select`=*field*. Use `!=` to negate the query.
|
||||||
|
|
||||||
* --*field*[~`/`*regex*`/`]:
|
* --*field*[~`/`*regex*`/`]:
|
||||||
Essentially the same as --*field*=*match*, but with Regular Expression support. --*field*~`/`*regex*`/` filters the result set using the given `/`*regex*`/`. For example, --name=`/`^*match*$`/` is essentially the same as --*field*=*match* and --url~`/`oh-my-fish`/` selects only Oh My Fish! plugins. Use `!~` to negate the query.
|
Essentially the same as --*field*=*match*, but with Regular Expression support. --*field*~`/`*regex*`/` filters the result set using the given `/`*regex*`/`. For example, --name=`/`^*match*$`/` is the same as --*field*=*match* and --url~`/`oh-my-fish`/` selects only Oh My Fish! plugins. Use `!~` to negate the query.
|
||||||
|
|
||||||
* `-a` `--and`:
|
* `-a` `--and`:
|
||||||
Join query with a logical AND operator.
|
Join query with a logical AND operator.
|
||||||
|
@ -70,18 +70,12 @@ See #{`Output`} for more information.
|
||||||
The default behavior is to print the result set to standard output in its original format.
|
The default behavior is to print the result set to standard output in its original format.
|
||||||
|
|
||||||
```
|
```
|
||||||
fisher search bobthefish shark
|
fisher search shark
|
||||||
```
|
```
|
||||||
|
|
||||||
`...`
|
`...`
|
||||||
|
|
||||||
```
|
```
|
||||||
bobthefish
|
|
||||||
https://github.com/oh-my-fish/theme-bobthefish
|
|
||||||
A Powerline-style, Git-aware fish theme optimized for awesome
|
|
||||||
theme powerline awesome
|
|
||||||
bobthecow
|
|
||||||
|
|
||||||
shark
|
shark
|
||||||
https://github.com/bucaran/shark
|
https://github.com/bucaran/shark
|
||||||
Sparklines for your Fish
|
Sparklines for your Fish
|
||||||
|
@ -92,13 +86,12 @@ bucaran
|
||||||
Search is optimized for parsing when using filters: `--name`, `--url`, `--info`, `--tags`, `--author` or `--field`=*name*|*url*|*info*|*tag*|*author*.
|
Search is optimized for parsing when using filters: `--name`, `--url`, `--info`, `--tags`, `--author` or `--field`=*name*|*url*|*info*|*tag*|*author*.
|
||||||
|
|
||||||
```
|
```
|
||||||
fisher search bobthefish shark --name --url
|
fisher search shark --name --url
|
||||||
```
|
```
|
||||||
|
|
||||||
`...`
|
`...`
|
||||||
|
|
||||||
```
|
```
|
||||||
bobthefish;https://github.com/oh-my-fish/theme-bobthefish
|
|
||||||
shark;https://github.com/bucaran/shark
|
shark;https://github.com/bucaran/shark
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -106,31 +99,31 @@ The result set above consists of single line `'\n'` separated records where each
|
||||||
|
|
||||||
## EXAMPLES
|
## EXAMPLES
|
||||||
|
|
||||||
Display all plugins by name and format into multiple columns.
|
* Display all plugins by name and format into multiple columns.
|
||||||
|
|
||||||
```
|
```
|
||||||
fisher search --name | column
|
fisher search --name | column
|
||||||
```
|
```
|
||||||
|
|
||||||
Display all plugins by url, sans *https://github.com/* and format into multiple columns.
|
* Display all plugins by url, sans *https://github.com/* and format into multiple columns.
|
||||||
|
|
||||||
```
|
```
|
||||||
fisher search --field=url --select=all | sed 's|https://github.com/||' | column
|
fisher search --field=url --select=all | sed 's|https://github.com/||' | column
|
||||||
```
|
```
|
||||||
|
|
||||||
Display all remote plugins by name tagged as *a* or *b*.
|
* Display all remote plugins by name tagged as *a* or *b*.
|
||||||
|
|
||||||
```
|
```
|
||||||
fisher search --select=remote --name --tag=github --or --tag=tool
|
fisher search --select=remote --name --tag=github --or --tag=tool
|
||||||
```
|
```
|
||||||
|
|
||||||
Search plugins from a list of one or more urls and / or names and display their authors.
|
* Search plugins from a list of one or more urls and / or names and display their authors.
|
||||||
|
|
||||||
```
|
```
|
||||||
fisher search $urls $names --url
|
fisher search $urls $names --url
|
||||||
```
|
```
|
||||||
|
|
||||||
Search all plugins in the cache whose name does not start with the letter `s`.
|
* Search all plugins in the cache whose name does not start with the letter `s`.
|
||||||
|
|
||||||
```
|
```
|
||||||
fisher search --select=cache --name~/^[^s]/
|
fisher search --select=cache --name~/^[^s]/
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
fisher \fBuninstall\fR [\fIname\fR or \fIurl\fR \.\.\.]
|
fisher \fBuninstall\fR [\fIname\fR or \fIurl\fR \.\.\.]
|
||||||
.
|
.
|
||||||
.br
|
.br
|
||||||
fisher \fBuninstall\fR [\fB\-\-all\fR] [\fB\-\-force\fR] [\fB\-\-quiet\fR] [\fB\-\-help\fR]
|
fisher \fBuninstall\fR [\fB\-\-force\fR] [\fB\-\-quiet\fR] [\fB\-\-help\fR]
|
||||||
.
|
.
|
||||||
.br
|
.br
|
||||||
.
|
.
|
||||||
|
@ -29,15 +29,11 @@ Uninstall one or \fImore\fR plugins by \fIname\fR, searching \fB$fisher_index\fR
|
||||||
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 \fB$fisher_cache\fR\. To erase the copy from the cache, use the \fB\-\-force\fR option\.
|
||||||
.
|
.
|
||||||
.P
|
.P
|
||||||
Uninstall does not remove dependencies installed along with other plugins\. This behavior prevents breaking plugins that share the same dependency\. See \fBfisher\fR(7){\fBFlat Tree\fR}\.
|
Uninstall does not remove any dependencies installed with other plugins\. This behavior prevents breaking plugins that share the same dependency\. See \fBfisher\fR(7){\fBFlat Tree\fR}\.
|
||||||
.
|
.
|
||||||
.SH "OPTIONS"
|
.SH "OPTIONS"
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-a\fR \fB\-\-all\fR
|
|
||||||
Uninstall all plugins\.
|
|
||||||
.
|
|
||||||
.TP
|
|
||||||
\fB\-f\fR \fB\-\-force\fR
|
\fB\-f\fR \fB\-\-force\fR
|
||||||
Delete copy from cache\.
|
Delete copy from cache\.
|
||||||
.
|
.
|
||||||
|
@ -50,13 +46,17 @@ Enable quiet mode\.
|
||||||
Show usage help\.
|
Show usage help\.
|
||||||
.
|
.
|
||||||
.SH "EXAMPLES"
|
.SH "EXAMPLES"
|
||||||
Uninstall all installed plugins and flushing the cache as well\.
|
.
|
||||||
|
.IP "\(bu" 4
|
||||||
|
Uninstall all plugins and flush the cache\.
|
||||||
|
.
|
||||||
|
.IP "" 0
|
||||||
.
|
.
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
.
|
.
|
||||||
.nf
|
.nf
|
||||||
|
|
||||||
fisher uninstall \-\-all \-\-force
|
fisher \-\-cache=base | fisher uninstall \-\-force
|
||||||
.
|
.
|
||||||
.fi
|
.fi
|
||||||
.
|
.
|
||||||
|
|
|
@ -4,7 +4,7 @@ fisher-uninstall(1) -- Disable / Uninstall Plugins
|
||||||
## SYNOPSIS
|
## SYNOPSIS
|
||||||
|
|
||||||
fisher `uninstall` [*name* or *url* ...] <br>
|
fisher `uninstall` [*name* or *url* ...] <br>
|
||||||
fisher `uninstall` [`--all`] [`--force`] [`--quiet`] [`--help`] <br>
|
fisher `uninstall` [`--force`] [`--quiet`] [`--help`] <br>
|
||||||
|
|
||||||
## USAGE
|
## USAGE
|
||||||
|
|
||||||
|
@ -17,13 +17,10 @@ Uninstall one or *more* plugins by *name*, searching `$fisher_index` or by *url*
|
||||||
|
|
||||||
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 dependencies installed along with other plugins. This behavior prevents breaking plugins that share the same dependency. See `fisher`(7){`Flat Tree`}.
|
Uninstall does not remove any dependencies installed with other plugins. This behavior prevents breaking plugins that share the same dependency. See `fisher`(7){`Flat Tree`}.
|
||||||
|
|
||||||
## OPTIONS
|
## OPTIONS
|
||||||
|
|
||||||
* `-a` `--all`:
|
|
||||||
Uninstall all plugins.
|
|
||||||
|
|
||||||
* `-f` `--force`:
|
* `-f` `--force`:
|
||||||
Delete copy from cache.
|
Delete copy from cache.
|
||||||
|
|
||||||
|
@ -33,13 +30,12 @@ Uninstall does not remove dependencies installed along with other plugins. This
|
||||||
* `-h` `--help`:
|
* `-h` `--help`:
|
||||||
Show usage help.
|
Show usage help.
|
||||||
|
|
||||||
|
|
||||||
## EXAMPLES
|
## EXAMPLES
|
||||||
|
|
||||||
Uninstall all installed plugins and flushing the cache as well.
|
* Uninstall all plugins and flush the cache.
|
||||||
|
|
||||||
```
|
```
|
||||||
fisher uninstall --all --force
|
fisher --cache=base | fisher uninstall --force
|
||||||
```
|
```
|
||||||
|
|
||||||
## SEE ALSO
|
## SEE ALSO
|
||||||
|
|
|
@ -10,10 +10,7 @@
|
||||||
fisher \fBupdate\fR [\fIname\fR or \fIurl\fR \.\.\.]
|
fisher \fBupdate\fR [\fIname\fR or \fIurl\fR \.\.\.]
|
||||||
.
|
.
|
||||||
.br
|
.br
|
||||||
fisher \fBupdate\fR [\fB\-\-self\fR] [\fB\-\-cache\fR] [\fB\-\-quiet\fR] [\fB\-\-help\fR]
|
fisher \fBupdate\fR [\fB\-\-me\fR] [\fB\-\-quiet\fR] [\fB\-\-help\fR]
|
||||||
.
|
|
||||||
.br
|
|
||||||
fisher \fBupdate\fR [\fB\-\-path\fR=\fIpath\fR]
|
|
||||||
.
|
.
|
||||||
.br
|
.br
|
||||||
.
|
.
|
||||||
|
@ -34,18 +31,10 @@ If a plugin is missing dependencies, they will be installed\. If any dependencie
|
||||||
.SH "OPTIONS"
|
.SH "OPTIONS"
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-s\fR \fB\-\-self\fR
|
\fB\-m\fR \fB\-\-me\fR
|
||||||
Update Fisherman\.
|
Update Fisherman\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
\fB\-c\fR \fB\-\-cache\fR
|
|
||||||
Update all plugins in the cache\. Updates plugins that are currently disabled and enables them\.
|
|
||||||
.
|
|
||||||
.TP
|
|
||||||
\fB\-\-path\fR=\fIpath\fR
|
|
||||||
Update repository at given path\. The update mechanism is based in Git, via \fBgit pull \-\-rebase\fR\.
|
|
||||||
.
|
|
||||||
.TP
|
|
||||||
\fB\-q\fR \fB\-\-quiet\fR
|
\fB\-q\fR \fB\-\-quiet\fR
|
||||||
Enable quiet mode\.
|
Enable quiet mode\.
|
||||||
.
|
.
|
||||||
|
@ -53,6 +42,16 @@ Enable quiet mode\.
|
||||||
\fB\-h\fR \fB\-\-help\fR
|
\fB\-h\fR \fB\-\-help\fR
|
||||||
Show usage help\.
|
Show usage help\.
|
||||||
.
|
.
|
||||||
|
.SH "EXAMPLES"
|
||||||
|
.
|
||||||
|
.IP "\(bu" 4
|
||||||
|
Update all plugins in the cache\.
|
||||||
|
.
|
||||||
|
.IP "" 0
|
||||||
|
.
|
||||||
|
.P
|
||||||
|
fisher \-\-cache=base | fisher update
|
||||||
|
.
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
\fBfisher\fR(1)
|
\fBfisher\fR(1)
|
||||||
.
|
.
|
||||||
|
|
|
@ -4,8 +4,7 @@ fisher-update(1) -- Fisherman Update Manager
|
||||||
## SYNOPSIS
|
## SYNOPSIS
|
||||||
|
|
||||||
fisher `update` [*name* or *url* ...] <br>
|
fisher `update` [*name* or *url* ...] <br>
|
||||||
fisher `update` [`--self`] [`--cache`] [`--quiet`] [`--help`] <br>
|
fisher `update` [`--me`] [`--quiet`] [`--help`] <br>
|
||||||
fisher `update` [`--path`=*path*] <br>
|
|
||||||
|
|
||||||
## USAGE
|
## USAGE
|
||||||
|
|
||||||
|
@ -20,21 +19,21 @@ If a plugin is missing dependencies, they will be installed. If any dependencies
|
||||||
|
|
||||||
## OPTIONS
|
## OPTIONS
|
||||||
|
|
||||||
* `-s` `--self`:
|
* `-m` `--me`:
|
||||||
Update Fisherman.
|
Update Fisherman.
|
||||||
|
|
||||||
* `-c` `--cache`:
|
|
||||||
Update all plugins in the cache. Updates plugins that are currently disabled and enables them.
|
|
||||||
|
|
||||||
* `--path`=*path*:
|
|
||||||
Update repository at given path. The update mechanism is based in Git, via `git pull --rebase`.
|
|
||||||
|
|
||||||
* `-q` `--quiet`:
|
* `-q` `--quiet`:
|
||||||
Enable quiet mode.
|
Enable quiet mode.
|
||||||
|
|
||||||
* `-h` `--help`:
|
* `-h` `--help`:
|
||||||
Show usage help.
|
Show usage help.
|
||||||
|
|
||||||
|
## EXAMPLES
|
||||||
|
|
||||||
|
* Update all plugins in the cache.
|
||||||
|
|
||||||
|
fisher --cache=base | fisher update
|
||||||
|
|
||||||
## SEE ALSO
|
## SEE ALSO
|
||||||
|
|
||||||
`fisher`(1)<br>
|
`fisher`(1)<br>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
.TH "FISHER" "1" "January 2016" "" "fisherman"
|
.TH "FISHER" "1" "January 2016" "" "fisherman"
|
||||||
.
|
.
|
||||||
.SH "NAME"
|
.SH "NAME"
|
||||||
\fBfisher\fR \- fish shell manager
|
\fBfisher\fR \- fish plugin manager
|
||||||
.
|
.
|
||||||
.SH "SYNOPSIS"
|
.SH "SYNOPSIS"
|
||||||
\fBfisher\fR \fIcommand\fR [\fIoptions\fR] [\fB\-\-version\fR] [\fB\-\-help\fR]
|
\fBfisher\fR \fIcommand\fR [\fIoptions\fR] [\fB\-\-version\fR] [\fB\-\-help\fR]
|
||||||
|
@ -16,36 +16,40 @@
|
||||||
\fBfisher\fR \fB\-\-validate\fR=\fIname\fR or \fIurl\fR
|
\fBfisher\fR \fB\-\-validate\fR=\fIname\fR or \fIurl\fR
|
||||||
.
|
.
|
||||||
.br
|
.br
|
||||||
|
\fBfisher\fR \fB\-\-cache\fR[=\fIpath\fR]
|
||||||
|
.
|
||||||
|
.br
|
||||||
.
|
.
|
||||||
.SH "DESCRIPTION"
|
.SH "DESCRIPTION"
|
||||||
Fisherman is a shell manager for \fBfish\fR(1) that lets you share and reuse code, prompts and configurations easily\.
|
Fisherman is a plugin manager for \fBfish\fR(1) that lets you share and reuse code, prompts and configurations easily\.
|
||||||
.
|
.
|
||||||
.P
|
.P
|
||||||
The following commands: \fIinstall\fR, \fIuninstall\fR, \fIupdate\fR, \fIsearch\fR and \fIhelp\fR are available by default\. See \fBfisher\fR help \fIcommand\fR for information about each command\.
|
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\.
|
||||||
.
|
.
|
||||||
.SH "OPTIONS"
|
.SH "OPTIONS"
|
||||||
.
|
.
|
||||||
.TP
|
.IP "\(bu" 4
|
||||||
\fB\-f\fR \fB\-\-file\fR=\fIfishfile\fR
|
\fB\-f\fR \fB\-\-file\fR=\fIfishfile\fR: Read \fIfishfile\fR and write contents to standard output\. If \fIfishfile\fR is null or an empty string, your user \fIfishfile\fR in \fB$fisher_config\fR/fishfile 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 write contents to standard output\. If \fIfishfile\fR is null or an empty string, your user \fIfishfile\fR in \fB$fisher_config\fR/fishfile will be used instead\. Use a dash \fB\-\fR to force reading from the standard input\. Oh My Fish! bundle files are supported too\.
|
|
||||||
.
|
.
|
||||||
.TP
|
.IP "\(bu" 4
|
||||||
\fB\-V\fR, \fB\-\-validate\fR=\fIkeyword\fR
|
\fB\-V\fR, \fB\-\-validate\fR=\fIkeyword\fR: Validate a \fIname\fR or \fIurl\fR\. If \fIkeyword\fR resembles a url, the algorithm will attempt to normalize the url by adding / removing missing components\. Otherwise, it will assume \fIkeyword\fR is a potential plugin name and use the following regex \fB^[a\-z]+[\._\-]?[a\-z0\-9]+\fR to validate the string\. This method is used internally to validate user input and support url variations such as \fIowner/repo\fR, \fIgh:owner/repo\fR, \fIbb:owner/repo\fR, etc\. See \fBfisher\fR(7)#{\fBPlugins\fR}\.
|
||||||
Validate a \fIname\fR or \fIurl\fR\. If \fIkeyword\fR resembles a url, the algorithm will attempt to normalize the url by adding / removing missing components\. Otherwise, it will assume \fIkeyword\fR is a potential plugin name and use the following regex \fB^[a\-z]+[\._\-]?[a\-z0\-9]+\fR to validate the string\. This method is used internally to validate user input and support url variations such as \fIowner/repo\fR, \fIgh:owner/repo\fR, \fIbb:owner/repo\fR, etc\. See \fBfisher\fR(7)#{\fBPlugins\fR}\.
|
|
||||||
.
|
.
|
||||||
.IP
|
.IP
|
||||||
If \fIkeyword\fR is null or an empty string, \fB\-\-validate\fR reads keyword\fIs\fR from the standard input\.
|
If \fIkeyword\fR is null or an empty string, \fB\-\-validate\fR reads keyword\fIs\fR from the standard input\.
|
||||||
.
|
.
|
||||||
.TP
|
.IP "\(bu" 4
|
||||||
\fB\-v\fR \fB\-\-version\fR
|
\fB\-\-cache\fR[=\fIbase\fR] Retrieve the path of every plugin downloaded to \fB$fisher_cache\fR\. Includes plugins installed using a custom URL\. Use \-\-cache=\fIbase\fR to select only the name of the plugin\. See \fBbasename\fR(1)\.
|
||||||
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 releases\.
|
|
||||||
.
|
.
|
||||||
.TP
|
.IP "\(bu" 4
|
||||||
\fB\-h\fR \fB\-\-help\fR
|
\fB\-v\fR \fB\-\-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 releases\.
|
||||||
Show usage help\.
|
.
|
||||||
|
.IP "\(bu" 4
|
||||||
|
\fB\-h\fR \fB\-\-help\fR: Show usage help\.
|
||||||
|
.
|
||||||
|
.IP "" 0
|
||||||
.
|
.
|
||||||
.SH "CUSTOM COMMANDS"
|
.SH "CUSTOM COMMANDS"
|
||||||
A Fisherman command is a function that you can invoke using \fBfisher\fR \fIcommand\fR [\fIoptions\fR]\. By convention, any function of the form \fBfisher_<my_command>\fR is registered as Fisherman command\. You can create plugins that add new commands as well as regular utilities\. See \fBfisher help commands\fR and \fBfisher help plugins\fR for more information\.
|
A Fisherman command is a function that you can invoke using the \fBfisher\fR utility\. By convention, any function of the form \fBfisher_<my_command>\fR is registered as Fisherman command\. You can create plugins that add new commands as well as regular utilities\. See \fBfisher help commands\fR and \fBfisher help plugins\fR for more information\.
|
||||||
.
|
.
|
||||||
.SH "EXAMPLES"
|
.SH "EXAMPLES"
|
||||||
.
|
.
|
||||||
|
@ -66,7 +70,7 @@ fishtape \-\-help
|
||||||
.IP "" 0
|
.IP "" 0
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
Install plugins from fishfile or bundle:
|
Install plugins from a fishfile or bundle:
|
||||||
|
|
||||||
.
|
.
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
|
@ -80,7 +84,7 @@ fisher \-\-file=path/to/shared/fishfile | fisher install
|
||||||
.IP "" 0
|
.IP "" 0
|
||||||
.
|
.
|
||||||
.IP "\(bu" 4
|
.IP "\(bu" 4
|
||||||
Validate an url\.
|
Validate a url\.
|
||||||
.
|
.
|
||||||
.IP "" 0
|
.IP "" 0
|
||||||
.
|
.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
fisher(1) -- fish shell manager
|
fisher(1) -- fish plugin manager
|
||||||
===============================
|
===============================
|
||||||
|
|
||||||
## SYNOPSIS
|
## SYNOPSIS
|
||||||
|
@ -6,23 +6,27 @@ fisher(1) -- fish shell manager
|
||||||
`fisher` *command* [*options*] [`--version`] [`--help`]<br>
|
`fisher` *command* [*options*] [`--version`] [`--help`]<br>
|
||||||
`fisher` `--file`=*fishfile*<br>
|
`fisher` `--file`=*fishfile*<br>
|
||||||
`fisher` `--validate`=*name* or *url*<br>
|
`fisher` `--validate`=*name* or *url*<br>
|
||||||
|
`fisher` `--cache`[=*path*]<br>
|
||||||
|
|
||||||
## DESCRIPTION
|
## DESCRIPTION
|
||||||
|
|
||||||
Fisherman is a shell manager for `fish`(1) that lets you share and reuse code, prompts and configurations easily.
|
Fisherman is a plugin manager for `fish`(1) that lets you share and reuse code, prompts and configurations easily.
|
||||||
|
|
||||||
The following commands: *install*, *uninstall*, *update*, *search* and *help* are available by default. See `fisher` help *command* for information about each command.
|
The following commands are available: *install*, *uninstall*, *update*, *search* and *help*. See `fisher` help *command* for information about each command.
|
||||||
|
|
||||||
## OPTIONS
|
## OPTIONS
|
||||||
|
|
||||||
* `-f` `--file`=*fishfile*:
|
* `-f` `--file`=*fishfile*:
|
||||||
Read *fishfile* and write contents to standard output. 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 too.
|
Read *fishfile* and write contents to standard output. 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.
|
||||||
|
|
||||||
* `-V`, `--validate`=*keyword*:
|
* `-V`, `--validate`=*keyword*:
|
||||||
Validate a *name* or *url*. If *keyword* resembles a url, the algorithm will attempt to normalize the url by adding / removing missing components. Otherwise, it will assume *keyword* is a potential plugin name and use the following regex `^[a-z]+[._-]?[a-z0-9]+` to validate the string. This method is used internally to validate user input and support url variations such as *owner/repo*, *gh:owner/repo*, *bb:owner/repo*, etc. See `fisher`(7)#{`Plugins`}.
|
Validate a *name* or *url*. If *keyword* resembles a url, the algorithm will attempt to normalize the url by adding / removing missing components. Otherwise, it will assume *keyword* is a potential plugin name and use the following regex `^[a-z]+[._-]?[a-z0-9]+` to validate the string. This method is used internally to validate user input and support url variations such as *owner/repo*, *gh:owner/repo*, *bb:owner/repo*, etc. See `fisher`(7)#{`Plugins`}.
|
||||||
|
|
||||||
If *keyword* is null or an empty string, `--validate` reads keyword*s* from the standard input.
|
If *keyword* is null or an empty string, `--validate` reads keyword*s* from the standard input.
|
||||||
|
|
||||||
|
* `--cache`[=*base*]
|
||||||
|
Retrieve the path of every plugin downloaded to `$fisher_cache`. Includes plugins installed using a custom URL. Use --cache=*base* to select only the name of the plugin. See `basename`(1).
|
||||||
|
|
||||||
* `-v` `--version`:
|
* `-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.
|
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.
|
||||||
|
|
||||||
|
@ -31,7 +35,7 @@ The following commands: *install*, *uninstall*, *update*, *search* and *help* ar
|
||||||
|
|
||||||
## CUSTOM COMMANDS
|
## CUSTOM COMMANDS
|
||||||
|
|
||||||
A Fisherman command is a function that you can invoke using `fisher` *command* [*options*]. By convention, any function of the form `fisher_<my_command>` is registered as Fisherman command. You can create plugins that add new commands as well as regular utilities. See `fisher help commands` and `fisher help plugins` for more information.
|
A Fisherman command is a function that you can invoke using the `fisher` utility. By convention, any function of the form `fisher_<my_command>` is registered as Fisherman command. You can create plugins that add new commands as well as regular utilities. See `fisher help commands` and `fisher help plugins` for more information.
|
||||||
|
|
||||||
## EXAMPLES
|
## EXAMPLES
|
||||||
|
|
||||||
|
@ -42,13 +46,13 @@ fisher install fishtape
|
||||||
fishtape --help
|
fishtape --help
|
||||||
```
|
```
|
||||||
|
|
||||||
* Install plugins from fishfile or bundle:
|
* Install plugins from a fishfile or bundle:
|
||||||
|
|
||||||
```
|
```
|
||||||
fisher --file=path/to/shared/fishfile | fisher install
|
fisher --file=path/to/shared/fishfile | fisher install
|
||||||
```
|
```
|
||||||
|
|
||||||
* Validate an url.
|
* Validate a url.
|
||||||
|
|
||||||
```
|
```
|
||||||
echo a/b | fisher -V
|
echo a/b | fisher -V
|
||||||
|
|
|
@ -23,7 +23,7 @@ Here is an example:
|
||||||
.nf
|
.nf
|
||||||
|
|
||||||
# my plugins
|
# my plugins
|
||||||
gitio
|
shark
|
||||||
fishtape
|
fishtape
|
||||||
|
|
||||||
# other links
|
# other links
|
||||||
|
@ -34,10 +34,10 @@ oh\-my\-fish/bobthefish
|
||||||
.IP "" 0
|
.IP "" 0
|
||||||
.
|
.
|
||||||
.P
|
.P
|
||||||
To read fishfiles use \fBfisher \-\-file\fR=\fIfishfile\fR\. This utility reads fishfiles sequentially, writing them to standard output\. Oh My Fish! bundle files are supported too\.
|
To read fishfiles use \fBfisher \-\-file\fR=\fIfishfile\fR\. This will read \fIfishfile\fR sequentially, writing its contents to the standard output\. Oh My Fish! bundle files are supported as well\.
|
||||||
.
|
.
|
||||||
.P
|
.P
|
||||||
If \fIfishfile\fR is null or an empty string, the global \fIfishfile\fR in \fB$fisher_config\fR/fishfile is used instead\. Use a dash \fB\-\fR to force read from standard input\.
|
If \fIfishfile\fR is null or an empty string, the global \fIfishfile\fR in \fB$fisher_config\fR/fishfile will be used\. Use a dash \fB\-\fR to force read from standard input\.
|
||||||
.
|
.
|
||||||
.SH "PLUGINS"
|
.SH "PLUGINS"
|
||||||
Plugins may declare any number of dependencies to other plugins in a fishfile at the root of their project\.
|
Plugins may declare any number of dependencies to other plugins in a fishfile at the root of their project\.
|
||||||
|
|
|
@ -15,16 +15,16 @@ Here is an example:
|
||||||
|
|
||||||
```
|
```
|
||||||
# my plugins
|
# my plugins
|
||||||
gitio
|
shark
|
||||||
fishtape
|
fishtape
|
||||||
|
|
||||||
# other links
|
# other links
|
||||||
oh-my-fish/bobthefish
|
oh-my-fish/bobthefish
|
||||||
```
|
```
|
||||||
|
|
||||||
To read fishfiles use `fisher --file`=*fishfile*. This utility reads fishfiles sequentially, writing them to standard output. Oh My Fish! bundle files are supported too.
|
To read fishfiles use `fisher --file`=*fishfile*. This will read *fishfile* sequentially, writing its contents to the standard output. Oh My Fish! bundle files are supported as well.
|
||||||
|
|
||||||
If *fishfile* is null or an empty string, the global *fishfile* in `$fisher_config`/fishfile is used instead. Use a dash `-` to force read from standard input.
|
If *fishfile* is null or an empty string, the global *fishfile* in `$fisher_config`/fishfile will be used. Use a dash `-` to force read from standard input.
|
||||||
|
|
||||||
## PLUGINS
|
## PLUGINS
|
||||||
|
|
||||||
|
|
|
@ -47,8 +47,12 @@ You can also customize the debug log path, cache location, index source url, com
|
||||||
.IP "" 0
|
.IP "" 0
|
||||||
.
|
.
|
||||||
.SH "EXAMPLES"
|
.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\.
|
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
|
.IP "" 4
|
||||||
.
|
.
|
||||||
.nf
|
.nf
|
||||||
|
@ -59,9 +63,11 @@ set fisher_alias install=i,in,inst update=up
|
||||||
.
|
.
|
||||||
.IP "" 0
|
.IP "" 0
|
||||||
.
|
.
|
||||||
.P
|
.IP "\(bu" 4
|
||||||
Set \fB$fisher_index\fR and \fB$fisher_default_host\fR\.
|
Set \fB$fisher_index\fR and \fB$fisher_default_host\fR\.
|
||||||
.
|
.
|
||||||
|
.IP "" 0
|
||||||
|
.
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
.
|
.
|
||||||
.nf
|
.nf
|
||||||
|
|
|
@ -40,13 +40,13 @@ You can also customize the debug log path, cache location, index source url, com
|
||||||
|
|
||||||
## EXAMPLES
|
## EXAMPLES
|
||||||
|
|
||||||
Create aliases for fisher `install` to *i*, *in* and *inst*; and for fisher `update` to *up*.
|
* 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
|
set fisher_alias install=i,in,inst update=up
|
||||||
```
|
```
|
||||||
|
|
||||||
Set `$fisher_index` and `$fisher_default_host`.
|
* Set `$fisher_index` and `$fisher_default_host`.
|
||||||
|
|
||||||
```
|
```
|
||||||
set fisher_index https://raw.../owner/repo/master/index2.txt
|
set fisher_index https://raw.../owner/repo/master/index2.txt
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
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\.
|
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?"
|
.SS "What is Fisherman?"
|
||||||
Fisherman is a shell manager for fish that lets you share and reuse code, prompts and configurations easily\.
|
Fisherman is a plugin manager for fish that lets you share and reuse code, prompts and configurations easily\.
|
||||||
.
|
.
|
||||||
.SS "What do I need to know to use Fisherman?"
|
.SS "What do I need to know to use Fisherman?"
|
||||||
Nothing\. You can continue using your shell as usual\. When you are ready to learn more just type \fBman fisher\fR or \fBman 7 fisher\fR\.
|
Nothing\. You can continue using your shell as usual\. When you are ready to learn more just type \fBman fisher\fR or \fBman 7 fisher\fR\.
|
||||||
|
@ -50,21 +50,21 @@ There is no technical distinction between plugins, themes, commands, etc\., but
|
||||||
.P
|
.P
|
||||||
See \fBfisher help plugins\fR and \fBfisher help commands\fR\.
|
See \fBfisher help plugins\fR and \fBfisher help commands\fR\.
|
||||||
.
|
.
|
||||||
.SS "Does Fisherman support Oh My Fish plugins and themes?"
|
.SS "Does Fisherman support Oh My Fish! plugins and themes?"
|
||||||
Yes\. To install either a plugin or theme use their URL:
|
Yes\. To install either a plugin or theme use their URL:
|
||||||
.
|
.
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
.
|
.
|
||||||
.nf
|
.nf
|
||||||
|
|
||||||
fisher install oh\-my\-fish/{rbenv,hub,bobthefish}
|
fisher install omf/{rbenv,hub,theme\-scorphish}
|
||||||
.
|
.
|
||||||
.fi
|
.fi
|
||||||
.
|
.
|
||||||
.IP "" 0
|
.IP "" 0
|
||||||
.
|
.
|
||||||
.P
|
.P
|
||||||
You can use the same mechanism to install a Wahoo package or a plugin in a any given URL\. See also \fBfisher\fR(7)#{\fBCompatibility\fR}\.
|
You can use the same mechanism to a valid plugin from any given URL\. See also \fBfisher\fR(7)#{\fBCompatibility\fR}\.
|
||||||
.
|
.
|
||||||
.SS "What does Fisherman do exactly every time I create a new shell session?"
|
.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\.
|
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\.
|
||||||
|
@ -76,7 +76,7 @@ Essentially, add Fisherman functions and completions to the \fB$fish_{function,c
|
||||||
set fish_function_path {$fisher_config,$fisher_home}/functions $fish_function_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
|
set fish_complete_path {$fisher_config,$fisher_home}/completions $fish_complete_path
|
||||||
|
|
||||||
for file in $fisher_config/functions/*\.config\.fish
|
for file in $fisher_config/conf\.d/*\.config\.fish
|
||||||
source $file
|
source $file
|
||||||
end
|
end
|
||||||
.
|
.
|
||||||
|
@ -87,14 +87,14 @@ end
|
||||||
.P
|
.P
|
||||||
See \fB$fisher_home/config\.fish\fR for the full code\.
|
See \fB$fisher_home/config\.fish\fR for the full code\.
|
||||||
.
|
.
|
||||||
.SS "How is Fisherman faster than Oh My Fish!, Wahoo, etc?"
|
.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 \fBfisher\fR(7)#{\fBFlat Tree\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 \fBfisher\fR(7)#{\fBFlat Tree\fR}\.
|
||||||
.
|
.
|
||||||
.SS "Why don\'t you contribute your improvements back to Oh My Fish! instead of creating a new project?"
|
.SS "Why don\'t you contribute your improvements back to Oh My Fish! instead of creating a new project?"
|
||||||
Already done that\. See Oh My Fish! history for August 27, 2015\. The project was then called Wahoo and it was entirely merged with Oh My Fish!\.
|
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!\.
|
||||||
.
|
.
|
||||||
.P
|
.P
|
||||||
Fisherman was built from the ground up using a completely different design, implementation and set of principles\.
|
In addition, Fisherman was built from the ground up using a completely different design, implementation and set of principles\.
|
||||||
.
|
.
|
||||||
.P
|
.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\fR(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 \fBfisher\fR(7)\.
|
||||||
|
@ -131,7 +131,7 @@ rm \-rf {$OMF_PATH,$OMF_CONFIG}
|
||||||
.IP "" 0
|
.IP "" 0
|
||||||
.
|
.
|
||||||
.SS "I changed my prompt with <code>fish_config</code> and now I can\'t use any Fisherman theme, what do I do?"
|
.SS "I changed my prompt with <code>fish_config</code> and now I can\'t use any Fisherman theme, what do I do?"
|
||||||
\fBfish_config\fR persists the prompt to \fBXDG_CONFIG_HOME/fish/functions\fR/fish_prompt\.fish\. That file takes precedence over Fisherman prompts that install to \fB$fisher_config\fR/functions/\. To use Fisherman prompts remove the \fBfish_promt\.fish\fR inside \fBXDG_CONFIG_HOME/fish/functions/\fR\.
|
\fBfish_config\fR persists the prompt to \fBXDG_CONFIG_HOME/fish/functions\fR/fish_prompt\.fish\. That file takes precedence over Fisherman prompts that installs to \fB$fisher_config\fR/functions/\. To use Fisherman prompts remove the \fBfish_promt\.fish\fR inside \fBXDG_CONFIG_HOME/fish/functions/\fR\.
|
||||||
.
|
.
|
||||||
.P
|
.P
|
||||||
Assuming \fBXDG_CONFIG_HOME\fR is \fB~/\.config\fR in your system:
|
Assuming \fBXDG_CONFIG_HOME\fR is \fB~/\.config\fR in your system:
|
||||||
|
|
|
@ -8,7 +8,7 @@ This document attempts to answer some of Fisherman most frequently asked questio
|
||||||
|
|
||||||
### What is Fisherman?
|
### What is Fisherman?
|
||||||
|
|
||||||
Fisherman is a shell manager for fish that lets you share and reuse code, prompts and configurations easily.
|
Fisherman is a plugin manager for fish that lets you share and reuse code, prompts and configurations easily.
|
||||||
|
|
||||||
|
|
||||||
### What do I need to know to use Fisherman?
|
### What do I need to know to use Fisherman?
|
||||||
|
@ -50,15 +50,15 @@ There is no technical distinction between plugins, themes, commands, etc., but t
|
||||||
See `fisher help plugins` and `fisher help commands`.
|
See `fisher help plugins` and `fisher help commands`.
|
||||||
|
|
||||||
|
|
||||||
### Does Fisherman support Oh My Fish plugins and themes?
|
### Does Fisherman support Oh My Fish! plugins and themes?
|
||||||
|
|
||||||
Yes. To install either a plugin or theme use their URL:
|
Yes. To install either a plugin or theme use their URL:
|
||||||
|
|
||||||
```
|
```
|
||||||
fisher install oh-my-fish/{rbenv,hub,bobthefish}
|
fisher install omf/{rbenv,hub,theme-scorphish}
|
||||||
```
|
```
|
||||||
|
|
||||||
You can use the same mechanism to install a Wahoo package or a plugin in a any given URL. See also `fisher`(7)#{`Compatibility`}.
|
You can use the same mechanism to a valid plugin from any given URL. See also `fisher`(7)#{`Compatibility`}.
|
||||||
|
|
||||||
|
|
||||||
### What does Fisherman do exactly every time I create a new shell session?
|
### What does Fisherman do exactly every time I create a new shell session?
|
||||||
|
@ -69,7 +69,7 @@ Essentially, add Fisherman functions and completions to the `$fish_{function,com
|
||||||
set fish_function_path {$fisher_config,$fisher_home}/functions $fish_function_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
|
set fish_complete_path {$fisher_config,$fisher_home}/completions $fish_complete_path
|
||||||
|
|
||||||
for file in $fisher_config/functions/*.config.fish
|
for file in $fisher_config/conf.d/*.config.fish
|
||||||
source $file
|
source $file
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
@ -77,15 +77,15 @@ end
|
||||||
See `$fisher_home/config.fish` for the full code.
|
See `$fisher_home/config.fish` for the full code.
|
||||||
|
|
||||||
|
|
||||||
### How is Fisherman faster than Oh My Fish!, Wahoo, etc?
|
### 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 `fisher`(7)#{`Flat Tree`}.
|
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 `fisher`(7)#{`Flat Tree`}.
|
||||||
|
|
||||||
### Why don't you contribute your improvements back to Oh My Fish! instead of creating a new project?
|
### Why don't you contribute your improvements back to Oh My Fish! instead of creating a new project?
|
||||||
|
|
||||||
Already done that. See Oh My Fish! history for August 27, 2015. The project was then called Wahoo and it was entirely merged with Oh My Fish!.
|
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!.
|
||||||
|
|
||||||
Fisherman was built from the ground up using a completely different design, implementation and set of principles.
|
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`(7).
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ rm -rf {$OMF_PATH,$OMF_CONFIG}
|
||||||
|
|
||||||
### I changed my prompt with `fish_config` and now I can't use any Fisherman theme, what do I do?
|
### I changed my prompt with `fish_config` and now I can't use any Fisherman theme, what do I do?
|
||||||
|
|
||||||
`fish_config` persists the prompt to `XDG_CONFIG_HOME/fish/functions`/fish_prompt.fish. That file takes precedence over Fisherman prompts that install to `$fisher_config`/functions/. To use Fisherman prompts remove the `fish_promt.fish` inside `XDG_CONFIG_HOME/fish/functions/`.
|
`fish_config` persists the prompt to `XDG_CONFIG_HOME/fish/functions`/fish_prompt.fish. That file takes precedence over Fisherman prompts that installs to `$fisher_config`/functions/. To use Fisherman prompts remove the `fish_promt.fish` inside `XDG_CONFIG_HOME/fish/functions/`.
|
||||||
|
|
||||||
Assuming `XDG_CONFIG_HOME` is `~/.config` in your system:
|
Assuming `XDG_CONFIG_HOME` is `~/.config` in your system:
|
||||||
|
|
||||||
|
|
|
@ -159,7 +159,7 @@ Add basic documentation\. Fisherman uses standard manual pages for displaying he
|
||||||
|
|
||||||
.
|
.
|
||||||
.IP "\(bu" 4
|
.IP "\(bu" 4
|
||||||
Commit changes and push to remote repository\.
|
Commit changes and push to the remote repository\.
|
||||||
.
|
.
|
||||||
.IP
|
.IP
|
||||||
\fBgit\fR add \-\-all
|
\fBgit\fR add \-\-all
|
||||||
|
|
|
@ -100,7 +100,7 @@ end
|
||||||
^C
|
^C
|
||||||
```
|
```
|
||||||
|
|
||||||
* Commit changes and push to remote repository.
|
* Commit changes and push to the remote repository.
|
||||||
|
|
||||||
`git` add --all<br>
|
`git` add --all<br>
|
||||||
`git` commit -m "What the commit? 1.0"<br>
|
`git` commit -m "What the commit? 1.0"<br>
|
||||||
|
|
|
@ -7,13 +7,13 @@
|
||||||
\fBfisher\fR \- An Introduction to Fisherman
|
\fBfisher\fR \- An Introduction to Fisherman
|
||||||
.
|
.
|
||||||
.SH "DESCRIPTION"
|
.SH "DESCRIPTION"
|
||||||
Fisherman is a shell manager for \fBfish\fR(1) that lets you share and reuse code, prompts and configurations easily\.
|
Fisherman is a plugin manager for \fBfish\fR(1) that lets you share and reuse code, prompts and configurations easily\.
|
||||||
.
|
.
|
||||||
.P
|
.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\.
|
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\.
|
||||||
.
|
.
|
||||||
.P
|
.P
|
||||||
This document describes Fisherman main features and their implementation details\. For usage and command help see \fBfisher\fR(1)\.
|
This document describes Fisherman features and some of their implementation details\. For usage and command help see also \fBfisher\fR(1)\.
|
||||||
.
|
.
|
||||||
.SH "FLAT TREE"
|
.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\.
|
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\.
|
||||||
|
@ -66,6 +66,8 @@ Here is a snapshot of a typical configuration path with a single plugin and prom
|
||||||
|
|
||||||
$fisher_config
|
$fisher_config
|
||||||
|\-\- cache/
|
|\-\- cache/
|
||||||
|
|\-\- conf\.d/
|
||||||
|
|\-\- |\-\- my_plugin\.config\.fish
|
||||||
|\-\- functions/
|
|\-\- functions/
|
||||||
| |\-\- my_plugin\.fish
|
| |\-\- my_plugin\.fish
|
||||||
| |\-\- fish_prompt\.fish
|
| |\-\- fish_prompt\.fish
|
||||||
|
@ -83,6 +85,9 @@ $fisher_config
|
||||||
.P
|
.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 \fBhelp fish\fR#{\fBInitialization Files\fR} to learn more about fish configuration\.
|
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 \fBhelp fish\fR#{\fBInitialization Files\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 \fIname\fR\.config\.fish are added there\.
|
||||||
|
.
|
||||||
.SS "PLUGINS"
|
.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 full name completions and plugin information\. The same works for \fBfisher update\fR and \fBfisher uninstall\fR\.
|
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 full name completions and plugin information\. The same works for \fBfisher update\fR and \fBfisher uninstall\fR\.
|
||||||
.
|
.
|
||||||
|
@ -149,11 +154,17 @@ Shortcuts for other common Git repository hosting services are also available:
|
||||||
.
|
.
|
||||||
.br
|
.br
|
||||||
|
|
||||||
|
.
|
||||||
|
.IP "\(bu" 4
|
||||||
|
\fBomf:\fR/owner/repo \fB\->\fR https://github\.com/oh\-my\-fish/repo
|
||||||
|
.
|
||||||
|
.br
|
||||||
|
|
||||||
.
|
.
|
||||||
.IP "" 0
|
.IP "" 0
|
||||||
.
|
.
|
||||||
.P
|
.P
|
||||||
A flat tree model means 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\.
|
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
|
.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\.
|
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\.
|
||||||
|
|
|
@ -3,11 +3,11 @@ fisher(7) -- An Introduction to Fisherman
|
||||||
|
|
||||||
## DESCRIPTION
|
## DESCRIPTION
|
||||||
|
|
||||||
Fisherman is a shell manager for `fish`(1) that lets you share and reuse code, prompts and configurations easily.
|
Fisherman is a plugin manager for `fish`(1) that lets you share and reuse code, prompts and configurations 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.
|
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.
|
||||||
|
|
||||||
This document describes Fisherman main features and their implementation details. For usage and command help see `fisher`(1).
|
This document describes Fisherman features and some of their implementation details. For usage and command help see also `fisher`(1).
|
||||||
|
|
||||||
## FLAT TREE
|
## FLAT TREE
|
||||||
|
|
||||||
|
@ -43,6 +43,8 @@ Here is a snapshot of a typical configuration path with a single plugin and prom
|
||||||
|
|
||||||
$fisher_config
|
$fisher_config
|
||||||
|-- cache/
|
|-- cache/
|
||||||
|
|-- conf.d/
|
||||||
|
|-- |-- my_plugin.config.fish
|
||||||
|-- functions/
|
|-- functions/
|
||||||
| |-- my_plugin.fish
|
| |-- my_plugin.fish
|
||||||
| |-- fish_prompt.fish
|
| |-- fish_prompt.fish
|
||||||
|
@ -55,6 +57,8 @@ Here is a snapshot of a typical configuration path with a single plugin and prom
|
||||||
|
|
||||||
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 `help fish`#{`Initialization Files`} to learn more about fish configuration.
|
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 `help fish`#{`Initialization Files`} 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 *name*.config.fish are added there.
|
||||||
|
|
||||||
### PLUGINS
|
### 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 full name completions and plugin information. The same works for `fisher update` and `fisher uninstall`.
|
||||||
|
@ -84,8 +88,9 @@ Shortcuts for other common Git repository hosting services are also available:
|
||||||
|
|
||||||
* `bb:`/owner/repo `->` https://bitbucket.org/owner/repo<br>
|
* `bb:`/owner/repo `->` https://bitbucket.org/owner/repo<br>
|
||||||
* `gl:`/owner/repo `->` https://gitlab.com/owner/repo<br>
|
* `gl:`/owner/repo `->` https://gitlab.com/owner/repo<br>
|
||||||
|
* `omf:`/owner/repo `->` https://github.com/oh-my-fish/repo<br>
|
||||||
|
|
||||||
A flat tree model means 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*.
|
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` and / or `fish_right_prompt` functions.
|
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` and / or `fish_right_prompt` functions.
|
||||||
|
|
||||||
|
@ -156,6 +161,7 @@ The fishfile updates as you install / uninstall plugins. See also `fisher help i
|
||||||
|
|
||||||
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 `fisher help update`.
|
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 `fisher help update`.
|
||||||
|
|
||||||
|
|
||||||
### CONFIGURATION
|
### CONFIGURATION
|
||||||
|
|
||||||
Fisherman allows a high level of configuration using `$fisher_*` variables. You can customize the home and configuration directories, debug log file, cache location, index source url, command aliases, etc. See `fisher help config`.
|
Fisherman allows a high level of configuration using `$fisher_*` variables. You can customize the home and configuration directories, debug log file, cache location, index source url, command aliases, etc. See `fisher help config`.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "fisherman",
|
"name": "fisherman",
|
||||||
"version": "0.1.0",
|
"version": "0.2.0",
|
||||||
"description": "fish shell manager",
|
"description": "fish plugin manager",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"directories": {
|
"directories": {
|
||||||
"man": "man",
|
"man": "man",
|
||||||
|
|
68
share/getopts.awk
Normal file
68
share/getopts.awk
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
function add(k, v) {
|
||||||
|
if (seen[k v]++) return
|
||||||
|
print k (v == "" ? "" : " "v)
|
||||||
|
}
|
||||||
|
|
||||||
|
function pop() {
|
||||||
|
return (size <= 0) ? "_" : stack[size--]
|
||||||
|
}
|
||||||
|
|
||||||
|
function push(k) {
|
||||||
|
stack[++size] = k
|
||||||
|
}
|
||||||
|
|
||||||
|
function flush() {
|
||||||
|
while (size) {
|
||||||
|
add(pop())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$0 == "" { next }
|
||||||
|
|
||||||
|
done {
|
||||||
|
add("_" , $1$2$3)
|
||||||
|
next
|
||||||
|
}
|
||||||
|
|
||||||
|
$1 == "--" && !$2 {
|
||||||
|
done = 1
|
||||||
|
next
|
||||||
|
}
|
||||||
|
|
||||||
|
$1 !~ /^-|^--/ {
|
||||||
|
add(pop(), $0)
|
||||||
|
next
|
||||||
|
}
|
||||||
|
|
||||||
|
size { flush() }
|
||||||
|
|
||||||
|
$3 {
|
||||||
|
for (i = 4; i <= NF; i++)
|
||||||
|
$3 = $3" "$i
|
||||||
|
}
|
||||||
|
|
||||||
|
$1 == "--" {
|
||||||
|
if ($3 == "")
|
||||||
|
push($2)
|
||||||
|
else
|
||||||
|
add($2, $3)
|
||||||
|
}
|
||||||
|
|
||||||
|
$1 == "-" {
|
||||||
|
if ($2 == "") {
|
||||||
|
print $1
|
||||||
|
next
|
||||||
|
} else {
|
||||||
|
n = split($2, keys, "")
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($3 == "")
|
||||||
|
push(keys[n])
|
||||||
|
else
|
||||||
|
add(keys[n], $3)
|
||||||
|
|
||||||
|
for (i = 1; i < n; i++)
|
||||||
|
add(keys[i])
|
||||||
|
}
|
||||||
|
|
||||||
|
END { flush() }
|
|
@ -21,6 +21,13 @@ test "read a fishfile using --file"
|
||||||
(fisher --file=$fishfile) = foo bar baz github/foo/bar
|
(fisher --file=$fishfile) = foo bar baz github/foo/bar
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "fisher --cache=base retrieves plugin names in the cache"
|
||||||
|
(fisher --cache=base) = (
|
||||||
|
for file in $fisher_cache/*
|
||||||
|
basename $file
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
test "evaluate commands"
|
test "evaluate commands"
|
||||||
(fisher $cmd) = usage:...
|
(fisher $cmd) = usage:...
|
||||||
end
|
end
|
||||||
|
|
3
test/fixtures/source/bar/bar.fish
vendored
Normal file
3
test/fixtures/source/bar/bar.fish
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function bar
|
||||||
|
echo bar
|
||||||
|
end
|
1
test/fixtures/source/bar/completions/bar.fish
vendored
Normal file
1
test/fixtures/source/bar/completions/bar.fish
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
|
1
test/fixtures/source/bar/functions/bar.func.fish
vendored
Normal file
1
test/fixtures/source/bar/functions/bar.func.fish
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
|
0
test/fixtures/source/bar/init.fish
vendored
Normal file
0
test/fixtures/source/bar/init.fish
vendored
Normal file
8
test/fixtures/source/bar/man/man1/bar.1
vendored
Normal file
8
test/fixtures/source/bar/man/man1/bar.1
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
8
test/fixtures/source/bar/man/man2/bar.2
vendored
Normal file
8
test/fixtures/source/bar/man/man2/bar.2
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
8
test/fixtures/source/bar/man/man3/bar.3
vendored
Normal file
8
test/fixtures/source/bar/man/man3/bar.3
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
8
test/fixtures/source/bar/man/man4/bar.4
vendored
Normal file
8
test/fixtures/source/bar/man/man4/bar.4
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
8
test/fixtures/source/bar/man/man5/bar.5
vendored
Normal file
8
test/fixtures/source/bar/man/man5/bar.5
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
8
test/fixtures/source/bar/man/man6/bar.6
vendored
Normal file
8
test/fixtures/source/bar/man/man6/bar.6
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
8
test/fixtures/source/bar/man/man7/bar.7
vendored
Normal file
8
test/fixtures/source/bar/man/man7/bar.7
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
8
test/fixtures/source/bar/man/man8/bar.8
vendored
Normal file
8
test/fixtures/source/bar/man/man8/bar.8
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
8
test/fixtures/source/bar/man/man9/bar.9
vendored
Normal file
8
test/fixtures/source/bar/man/man9/bar.9
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
||||||
|
bar
|
0
test/fixtures/source/baz/baz.config.fish
vendored
Normal file
0
test/fixtures/source/baz/baz.config.fish
vendored
Normal file
3
test/fixtures/source/baz/baz.fish
vendored
Normal file
3
test/fixtures/source/baz/baz.fish
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function baz
|
||||||
|
echo baz
|
||||||
|
end
|
1
test/fixtures/source/baz/completions/baz.fish
vendored
Normal file
1
test/fixtures/source/baz/completions/baz.fish
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
|
1
test/fixtures/source/baz/functions/baz.func.fish
vendored
Normal file
1
test/fixtures/source/baz/functions/baz.func.fish
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
|
0
test/fixtures/source/baz/init.fish
vendored
Normal file
0
test/fixtures/source/baz/init.fish
vendored
Normal file
8
test/fixtures/source/baz/man/man1/baz.1
vendored
Normal file
8
test/fixtures/source/baz/man/man1/baz.1
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
8
test/fixtures/source/baz/man/man2/baz.2
vendored
Normal file
8
test/fixtures/source/baz/man/man2/baz.2
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
8
test/fixtures/source/baz/man/man3/baz.3
vendored
Normal file
8
test/fixtures/source/baz/man/man3/baz.3
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
8
test/fixtures/source/baz/man/man4/baz.4
vendored
Normal file
8
test/fixtures/source/baz/man/man4/baz.4
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
8
test/fixtures/source/baz/man/man5/baz.5
vendored
Normal file
8
test/fixtures/source/baz/man/man5/baz.5
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
8
test/fixtures/source/baz/man/man6/baz.6
vendored
Normal file
8
test/fixtures/source/baz/man/man6/baz.6
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
8
test/fixtures/source/baz/man/man7/baz.7
vendored
Normal file
8
test/fixtures/source/baz/man/man7/baz.7
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
8
test/fixtures/source/baz/man/man8/baz.8
vendored
Normal file
8
test/fixtures/source/baz/man/man8/baz.8
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
8
test/fixtures/source/baz/man/man9/baz.9
vendored
Normal file
8
test/fixtures/source/baz/man/man9/baz.9
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
||||||
|
baz
|
1
test/fixtures/source/foo/completions/foo.fish
vendored
Normal file
1
test/fixtures/source/foo/completions/foo.fish
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
|
0
test/fixtures/source/foo/foo.config.fish
vendored
Normal file
0
test/fixtures/source/foo/foo.config.fish
vendored
Normal file
3
test/fixtures/source/foo/foo.fish
vendored
Normal file
3
test/fixtures/source/foo/foo.fish
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function foo
|
||||||
|
echo foo
|
||||||
|
end
|
1
test/fixtures/source/foo/functions/foo.func.fish
vendored
Normal file
1
test/fixtures/source/foo/functions/foo.func.fish
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
|
1
test/fixtures/source/foo/init.fish
vendored
Normal file
1
test/fixtures/source/foo/init.fish
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
|
1
test/fixtures/source/foo/man/man1/foo.1
vendored
Normal file
1
test/fixtures/source/foo/man/man1/foo.1
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
foo
|
1
test/fixtures/source/foo/man/man2/foo.2
vendored
Normal file
1
test/fixtures/source/foo/man/man2/foo.2
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
foo
|
1
test/fixtures/source/foo/man/man3/foo.3
vendored
Normal file
1
test/fixtures/source/foo/man/man3/foo.3
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
foo
|
1
test/fixtures/source/foo/man/man4/foo.4
vendored
Normal file
1
test/fixtures/source/foo/man/man4/foo.4
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
foo
|
1
test/fixtures/source/foo/man/man5/foo.5
vendored
Normal file
1
test/fixtures/source/foo/man/man5/foo.5
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
foo
|
1
test/fixtures/source/foo/man/man6/foo.6
vendored
Normal file
1
test/fixtures/source/foo/man/man6/foo.6
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
foo
|
1
test/fixtures/source/foo/man/man7/foo.7
vendored
Normal file
1
test/fixtures/source/foo/man/man7/foo.7
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
foo
|
1
test/fixtures/source/foo/man/man8/foo.8
vendored
Normal file
1
test/fixtures/source/foo/man/man8/foo.8
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
foo
|
1
test/fixtures/source/foo/man/man9/foo.9
vendored
Normal file
1
test/fixtures/source/foo/man/man9/foo.9
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
foo
|
|
@ -1,28 +0,0 @@
|
||||||
function create_mock_source -a path
|
|
||||||
set -e argv[1]
|
|
||||||
|
|
||||||
for name in $argv
|
|
||||||
if not mkdir -p $path/$name/{,functions,completions,man}
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
|
|
||||||
echo "function $name; end;" >> $path/$name/$name.fish
|
|
||||||
echo > $path/$name/functions/$name.func.fish
|
|
||||||
echo > $path/$name/completions/$name.fish
|
|
||||||
|
|
||||||
for n in (seq 9)
|
|
||||||
mkdir -p $path/$name/man/man$n
|
|
||||||
echo $name >> $path/$name/man/man$n/$name.$n
|
|
||||||
end
|
|
||||||
|
|
||||||
git -C $path/$name init --quiet
|
|
||||||
|
|
||||||
git -C $path/$name config user.email "man@fisher"
|
|
||||||
git -C $path/$name config user.name "fisherman"
|
|
||||||
|
|
||||||
git -C $path/$name add -A > /dev/null
|
|
||||||
git -C $path/$name commit -m "add $name.fish" > /dev/null
|
|
||||||
|
|
||||||
printf "$name\nfile://$path/$name\n$name's plugin\nt a g s\n@$name\n\n"
|
|
||||||
end
|
|
||||||
end
|
|
5
test/helpers/fisher_mock_config.fish
Normal file
5
test/helpers/fisher_mock_config.fish
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
function fisher_mock_config -a path index
|
||||||
|
set -g fisher_config $path/config
|
||||||
|
set -g fisher_cache $fisher_config/cache
|
||||||
|
set -g fisher_index "file://$index"
|
||||||
|
end
|
5
test/helpers/fisher_mock_index.fish
Normal file
5
test/helpers/fisher_mock_index.fish
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
function fisher_mock_index
|
||||||
|
for name in $argv[2..-1]
|
||||||
|
printf "$name\nfile://$argv[1]/$name\ninfo\ntag1 tag2\n@$name\n\n"
|
||||||
|
end
|
||||||
|
end
|
9
test/helpers/fisher_mock_repos.fish
Normal file
9
test/helpers/fisher_mock_repos.fish
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
function fisher_mock_repos
|
||||||
|
for name in $argv
|
||||||
|
git -C $name init --quiet
|
||||||
|
git -C $name config user.email "git@fisherman"
|
||||||
|
git -C $name config user.name "fisherman"
|
||||||
|
git -C $name add -A > /dev/null
|
||||||
|
git -C $name commit -m "$name" > /dev/null
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,66 +1,75 @@
|
||||||
source $DIRNAME/helpers/create_mock_source.fish
|
source $DIRNAME/helpers/fisher_mock_repos.fish
|
||||||
|
source $DIRNAME/helpers/fisher_mock_index.fish
|
||||||
|
source $DIRNAME/helpers/fisher_mock_config.fish
|
||||||
|
|
||||||
set -l path $DIRNAME/$TESTNAME.test(random)
|
set -l path $DIRNAME/$TESTNAME.test(random)
|
||||||
set -l source $path/source
|
set -l source $DIRNAME/fixtures/source
|
||||||
set -l index $path/index
|
set -l index $path/INDEX
|
||||||
set -l names foo bar
|
set -l names foo bar baz
|
||||||
|
|
||||||
function -S setup
|
function -S setup
|
||||||
if not mkdir -p $path
|
mkdir -p $path
|
||||||
return 1
|
|
||||||
end
|
|
||||||
|
|
||||||
set -g fisher_config $path/config
|
fisher_mock_repos $source/*
|
||||||
set -g fisher_cache $fisher_config/cache
|
fisher_mock_index $source $names > $index
|
||||||
set -g fisher_index "file://$index"
|
fisher_mock_config $path $index
|
||||||
|
|
||||||
create_mock_source $source $names > $index
|
fisher install $names[1] file://$source/$names[2..3] -q
|
||||||
end
|
end
|
||||||
|
|
||||||
function -S teardown
|
function -S teardown
|
||||||
rm -rf $path
|
rm -rf $path
|
||||||
|
rm -rf $source/{$names}.git
|
||||||
|
end
|
||||||
|
|
||||||
|
test "install creates config directory if there is none"
|
||||||
|
-d $fisher_config
|
||||||
|
end
|
||||||
|
|
||||||
|
test "install creates cache directory if there is none"
|
||||||
|
-d $fisher_cache
|
||||||
|
end
|
||||||
|
|
||||||
|
test "adds installed plugins to fishfile"
|
||||||
|
(cat $fisher_config/fishfile | xargs) = "$names"
|
||||||
|
end
|
||||||
|
|
||||||
|
test "downloads plugin repos to cache"
|
||||||
|
(fisher --cache=base) = $names
|
||||||
|
end
|
||||||
|
|
||||||
|
test "download INDEX copy to the cache"
|
||||||
|
(cat $fisher_cache/.index) = (fisher_mock_index $source $names)
|
||||||
|
end
|
||||||
|
|
||||||
|
test "add completions/<plugin>.fish to completions directory"
|
||||||
|
(ls $fisher_config/completions) = {$names}.fish
|
||||||
end
|
end
|
||||||
|
|
||||||
for name in $names
|
for name in $names
|
||||||
test "install by name:<$name>" (
|
test "add <plugin>.fish to functions/$name.fish directory"
|
||||||
fisher install $name --quiet
|
-e $fisher_config/functions/$name.fish
|
||||||
ls $fisher_cache
|
|
||||||
|
|
||||||
) = $name
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "install by url:<file://$source/$name>" (
|
for file in $fisher_cache/$name/functions/*.fish
|
||||||
fisher install file://$source/$name --quiet
|
test "add functions/*.fish to functions/"(basename $file)
|
||||||
ls $fisher_cache
|
-e $fisher_config/functions/(basename $file)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
) = $name
|
test "add config files to conf.d"
|
||||||
|
-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
|
||||||
|
end
|
||||||
|
|
||||||
|
test "add manual pages to config/man/"
|
||||||
|
-d $fisher_config/man
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
test "install several"
|
test "install returns 1 if package can't be installed"
|
||||||
(printf "%s\n" $names) = (
|
(fisher install -q -- "what"; echo $status) = 1
|
||||||
|
|
||||||
fisher install $names --quiet
|
|
||||||
ls $fisher_cache)
|
|
||||||
end
|
|
||||||
|
|
||||||
test "install from <stdin>"
|
|
||||||
(printf "%s\n" $names) = (
|
|
||||||
|
|
||||||
printf "%s\n" $names | fisher install --quiet
|
|
||||||
ls $fisher_cache)
|
|
||||||
end
|
|
||||||
|
|
||||||
test "install updates fishfile"
|
|
||||||
"$names" = (
|
|
||||||
|
|
||||||
fisher install $names --quiet
|
|
||||||
xargs < $fisher_config/fishfile)
|
|
||||||
end
|
|
||||||
|
|
||||||
test "fail install package by name"
|
|
||||||
"fisher: 'what' not found" = (
|
|
||||||
|
|
||||||
fisher install "what" ^&1
|
|
||||||
echo $status)
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,17 +3,17 @@ test "display help help"
|
||||||
end
|
end
|
||||||
|
|
||||||
test "display install help"
|
test "display install help"
|
||||||
(fisher install --help | xargs) = "usage: fisher install [<name | url> ...] [--quiet] [--help] -q --quiet Enable quiet mode -h --help Show usage help"
|
(fisher install --help | xargs) = "usage: fisher install [<name or url> ...] [--quiet] [--help] -q --quiet Enable quiet mode -h --help Show usage help"
|
||||||
end
|
end
|
||||||
|
|
||||||
test "display search help"
|
test "display search help"
|
||||||
(fisher search --help | xargs) = "usage: fisher search [<name | url>] [--select=<source>] [--field=<field>] [--or|--and] [--quiet] [--help] -s --select=<source> Select all, cache or remote plugins -f --field=<field> Filter by name, url, info, tag or author -a --and Join query with AND operator -o --or Join query with OR operator -q --quiet Enable quiet mode -h --help Show usage help"
|
(fisher search --help | xargs) = "usage: fisher search [<name or url>] [--select=<source>] [--field=<field>] [--or|--and] [--quiet] [--help] -s --select=<source> Select all, cache or remote plugins -f --field=<field> Filter by name, url, info, tag or author -a --and Join query with AND operator -o --or Join query with OR operator -q --quiet Enable quiet mode -h --help Show usage help"
|
||||||
end
|
end
|
||||||
|
|
||||||
test "display uninstall help"
|
test "display uninstall help"
|
||||||
(fisher uninstall --help | xargs) = "usage: fisher uninstall [<name | url> ...] [--all] [--force] [--quiet] [--help] -a --all Uninstall all plugins -f --force Delete copy from cache -q --quiet Enable quiet mode -h --help Show usage help"
|
(fisher uninstall --help | xargs) = "usage: fisher uninstall [<name or url> ...] [--force] [--quiet] [--help] -f --force Delete copy from cache -q --quiet Enable quiet mode -h --help Show usage help"
|
||||||
end
|
end
|
||||||
|
|
||||||
test "display update help"
|
test "display update help"
|
||||||
(fisher update --help | xargs) = "usage: fisher update [<name | url> ...] [--self] [--cache] [--path=<path>] [--quiet] [--help] -s --self Update Fisherman -c --cache Update cached plugins --path=<path> Update repository at given path -q --quiet Enable quiet mode -h --help Show usage help"
|
(fisher update --help | xargs) = "usage: fisher update [<name or url> ...] [--me] [--quiet] [--help] -m --me Update Fisherman -q --quiet Enable quiet mode -h --help Show usage help"
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,120 +1,48 @@
|
||||||
source $DIRNAME/helpers/create_mock_source.fish
|
source $DIRNAME/helpers/fisher_mock_repos.fish
|
||||||
|
source $DIRNAME/helpers/fisher_mock_index.fish
|
||||||
|
source $DIRNAME/helpers/fisher_mock_config.fish
|
||||||
|
|
||||||
set -l path $DIRNAME/$TESTNAME.test(random)
|
set -l path $DIRNAME/$TESTNAME.test(random)
|
||||||
set -l source $path/source
|
set -l source $DIRNAME/fixtures/source
|
||||||
set -l index $path/index
|
set -l index $path/INDEX
|
||||||
set -l names foo bar
|
set -l names foo bar baz
|
||||||
|
|
||||||
function -S setup
|
function -S setup
|
||||||
if not mkdir -p $path
|
mkdir -p $path
|
||||||
return 1
|
|
||||||
end
|
|
||||||
|
|
||||||
set -g fisher_config $path/config
|
fisher_mock_repos $source/*
|
||||||
set -g fisher_cache $fisher_config/cache
|
fisher_mock_index $source $names > $index
|
||||||
set -g fisher_index "file://$index"
|
fisher_mock_config $path $index
|
||||||
|
|
||||||
create_mock_source $source $names > $index
|
fisher install $names -q
|
||||||
|
fisher uninstall $names -q
|
||||||
fisher install $names --quiet
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function -S teardown
|
function -S teardown
|
||||||
rm -rf $path
|
rm -rf $path
|
||||||
|
rm -rf $source/{$names}.git
|
||||||
end
|
end
|
||||||
|
|
||||||
for name in $names
|
for name in $names
|
||||||
test "uninstall <$name> does not clear cache"
|
test "remove plugin from functions/$name.fish"
|
||||||
(printf "%s\n" $names) = (
|
! -e $fisher_config/functions/$name.fish
|
||||||
|
|
||||||
fisher uninstall $name --quiet
|
|
||||||
ls $fisher_cache)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "uninstall --force clears package <$name> from cache"
|
test "remove plugin from completions/$name.fish"
|
||||||
(for _name in $names
|
! -e $fisher_config/completions/$name.fish
|
||||||
if test $_name != $name
|
|
||||||
printf "%s\n" $_name
|
|
||||||
end
|
|
||||||
end) = (
|
|
||||||
|
|
||||||
fisher uninstall $name --quiet --force
|
|
||||||
ls $fisher_cache)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "uninstall <$name> removes functions/$name.fish"
|
test "remove plugin from conf.d/$name.config.fish"
|
||||||
(
|
! -e $fisher_config/conf.d/$name.config.fish
|
||||||
echo 0
|
|
||||||
echo 1
|
|
||||||
) = (
|
|
||||||
|
|
||||||
builtin test -f $fisher_config/functions/$name.fish
|
|
||||||
echo $status
|
|
||||||
|
|
||||||
fisher uninstall $name --quiet
|
|
||||||
|
|
||||||
builtin test -f $fisher_config/functions/$name.fish
|
|
||||||
echo $status)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "uninstall <$name> removes completions/$name.fish"
|
test "remove plugin from conf.d/$name.init.config.fish"
|
||||||
(
|
! -e $fisher_config/conf.d/$name.init.config.fish
|
||||||
echo 0
|
|
||||||
echo 1
|
|
||||||
) = (
|
|
||||||
|
|
||||||
builtin test -f $fisher_config/completions/$name.fish
|
|
||||||
echo $status
|
|
||||||
|
|
||||||
fisher uninstall $name --quiet
|
|
||||||
|
|
||||||
builtin test -f $fisher_config/completions/$name.fish
|
|
||||||
echo $status)
|
|
||||||
end
|
|
||||||
|
|
||||||
test "uninstall <$name> removes man/man.../$name..."
|
|
||||||
(
|
|
||||||
for n in (seq 9)
|
|
||||||
echo 0
|
|
||||||
end
|
|
||||||
|
|
||||||
for n in (seq 9)
|
|
||||||
echo 1
|
|
||||||
end
|
|
||||||
) = (
|
|
||||||
|
|
||||||
for n in (seq 9)
|
|
||||||
builtin test -f $fisher_config/man/man$n/$name.$n
|
|
||||||
echo $status
|
|
||||||
end
|
|
||||||
|
|
||||||
fisher uninstall $name --quiet
|
|
||||||
|
|
||||||
for n in (seq 9)
|
|
||||||
builtin test -f $fisher_config/man/man$n/$name.$n
|
|
||||||
echo $status
|
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
test "remove all installed/enabled plugins"
|
test "remove plugin manual from man/man%"
|
||||||
-z (
|
(for file in $fisher_config/man/**
|
||||||
|
basename $file
|
||||||
fisher uninstall --all --quiet
|
end | xargs) = (echo {man}(seq 9) | xargs)
|
||||||
ls $fisher_config/functions
|
|
||||||
ls $fisher_config/completions)
|
|
||||||
end
|
|
||||||
|
|
||||||
test "remove all installed plugins flushing cache"
|
|
||||||
-z (
|
|
||||||
|
|
||||||
fisher uninstall --all --force --quiet
|
|
||||||
ls $fisher_cache)
|
|
||||||
end
|
|
||||||
|
|
||||||
test "uninstall updates fishfile"
|
|
||||||
"$names[2..-1]" = (
|
|
||||||
|
|
||||||
fisher uninstall $names[1] --quiet
|
|
||||||
cat $fisher_config/fishfile | xargs)
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
source $DIRNAME/helpers/create_mock_source.fish
|
|
||||||
|
|
||||||
set -l path $DIRNAME/$TESTNAME.test(random)
|
|
||||||
set -l server $path/server
|
|
||||||
set -l home fisherman
|
|
||||||
|
|
||||||
function -S setup
|
|
||||||
set -g fisher_home $path/home
|
|
||||||
|
|
||||||
if not mkdir -p $fisher_home
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
|
|
||||||
create_mock_source $server $home > /dev/null
|
|
||||||
|
|
||||||
git -C $fisher_home init --quiet
|
|
||||||
git -C $fisher_home remote add origin $server/$home/.git
|
|
||||||
end
|
|
||||||
|
|
||||||
function -S teardown
|
|
||||||
rm -rf $path
|
|
||||||
end
|
|
||||||
|
|
||||||
test "update itself w/ --self"
|
|
||||||
(ls $server/$home) = (
|
|
||||||
|
|
||||||
fisher update --self --quiet ^/dev/null
|
|
||||||
ls $fisher_home)
|
|
||||||
end
|
|
||||||
|
|
||||||
test "update repo at given path via git pull"
|
|
||||||
(ls $server/$home) = (
|
|
||||||
|
|
||||||
fisher update --path=$fisher_home --quiet ^/dev/null
|
|
||||||
ls $fisher_home)
|
|
||||||
end
|
|
|
@ -1,64 +1,53 @@
|
||||||
source $DIRNAME/helpers/create_mock_source.fish
|
source $DIRNAME/helpers/fisher_mock_repos.fish
|
||||||
|
source $DIRNAME/helpers/fisher_mock_index.fish
|
||||||
|
source $DIRNAME/helpers/fisher_mock_config.fish
|
||||||
|
|
||||||
set -l path $DIRNAME/$TESTNAME.test(random)
|
set -l path $DIRNAME/$TESTNAME.test(random)
|
||||||
set -l source $path/source
|
set -l source $DIRNAME/fixtures/source
|
||||||
set -l index $path/index
|
set -l source2 $path/source
|
||||||
set -l names foo
|
set -l index $path/INDEX
|
||||||
set -l extra norf
|
set -l names foo bar baz
|
||||||
|
set -l names2 norf
|
||||||
|
|
||||||
function -S setup
|
function -S setup
|
||||||
if not mkdir -p $path
|
mkdir -p $path
|
||||||
return 1
|
|
||||||
|
fisher_mock_repos $source/*
|
||||||
|
fisher_mock_index $source $names > $index
|
||||||
|
fisher_mock_config $path $index
|
||||||
|
|
||||||
|
fisher install $names -q
|
||||||
|
|
||||||
|
mkdir -p $source2
|
||||||
|
|
||||||
|
cp -rf $source $path
|
||||||
|
|
||||||
|
for name in $names
|
||||||
|
set -l file $source2/$name/$name.fish
|
||||||
|
sed "s/echo $name/echo $name v2/" $file > $file.tmp
|
||||||
|
mv $file.tmp $file
|
||||||
|
|
||||||
|
fisher_mock_repos $source2/$name
|
||||||
|
|
||||||
|
git -C $fisher_cache/$name remote rm origin
|
||||||
|
git -C $fisher_cache/$name remote add origin file://$source2/$name
|
||||||
end
|
end
|
||||||
|
|
||||||
set -g fisher_config $path/config
|
fisher_mock_index $source $names $names2 > $index
|
||||||
set -g fisher_cache $fisher_config/cache
|
|
||||||
set -g fisher_index "file://$index"
|
|
||||||
|
|
||||||
create_mock_source $source $names > $index
|
|
||||||
fisher install $names --quiet
|
|
||||||
|
|
||||||
# Updates the source repos duplicating the original content.
|
|
||||||
# See helpers/create_mock_source.fish
|
|
||||||
|
|
||||||
create_mock_source $source $names $extra > $index
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function -S teardown
|
function -S teardown
|
||||||
rm -rf $path
|
rm -rf $path
|
||||||
|
rm -rf $source/{$names}/.git
|
||||||
end
|
end
|
||||||
|
|
||||||
for name in $names
|
for name in $names
|
||||||
test "update <$name> package copy in cache"
|
test "update <$name> in cache" (
|
||||||
(functions $name $name | xargs) = (
|
fisher update $name -q
|
||||||
|
eval $name) = "$name v2"
|
||||||
fisher update $name --quiet
|
|
||||||
fish_indent < $fisher_cache/$name/$name.fish | xargs)
|
|
||||||
end
|
|
||||||
|
|
||||||
test "install <$name> if update is successful"
|
|
||||||
(functions $name $name | xargs) = (
|
|
||||||
|
|
||||||
fisher update $name --quiet
|
|
||||||
fish_indent < $fisher_config/functions/$name.fish | xargs)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
test "update packages via <stdin>"
|
test "update index"
|
||||||
(functions $names $names | xargs) = (
|
(fisher update --index; cat $fisher_config/cache/.index) = (cat $index)
|
||||||
|
|
||||||
printf "%s\n" $names | fisher update --quiet
|
|
||||||
cat $fisher_config/functions/{$names}.fish | fish_indent | xargs)
|
|
||||||
end
|
|
||||||
|
|
||||||
test "update cache"
|
|
||||||
(functions $names $names | xargs) = (
|
|
||||||
|
|
||||||
fisher update --cache --quiet
|
|
||||||
cat $fisher_config/functions/{$names}.fish | fish_indent | xargs)
|
|
||||||
end
|
|
||||||
|
|
||||||
test "update index with --index using contents in \$fisher_index" (
|
|
||||||
fisher update --index --quiet
|
|
||||||
awk -F'\n' -v RS='' '{ print $1 }' $fisher_cache/.index) = $names $extra
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue