Skip to content

Commit

Permalink
🧑‍💻 Add an alias for --help
Browse files Browse the repository at this point in the history
  • Loading branch information
Freed-Wu committed Apr 7, 2024
1 parent 63ba0b9 commit e33db42
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Wu Zhenyu <wuzhenyu@ustc.edu> Wu, Zhenyu <wuzhenyu@ustc.edu>
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
- id: check-toml
- id: check-json
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
rev: v1.5.5
hooks:
- id: remove-crlf
- repo: https://github.com/codespell-project/codespell
Expand Down
1 change: 1 addition & 0 deletions functions/main.zsh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# define some functions to avoid any error that these programs don't exist
# treat bat -lXXX as cat
# currently, only bat supports highlight --help
alias -g -- "--help=\\--help | bat -lhelp"
(($+commands[bat])) && bat() {command bat --color=always -p $@} || bat() {command cat}
if ((! $+commands[mdcat])); then
if (($+commands[paper])); then
Expand Down
2 changes: 1 addition & 1 deletion sources/bat.zsh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# :fzf-tab:complete:(\\|*/|)bat:argument-rest
case $group in
subcommand)
bat cache --help | bat -lhelp
bat cache --help
;;
*)
[[ -f ${realpath#--*=} ]] && bat ${realpath#--*=} || less ${realpath#--*=}
Expand Down
2 changes: 1 addition & 1 deletion sources/brew.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# :fzf-tab:complete:(\\|*/|)brew:argument-1
brew $word --help | bat -lhelp
brew $word --help
2 changes: 1 addition & 1 deletion sources/docker-container.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# :fzf-tab:complete:docker-container:argument-1
docker container $word --help | bat -lhelp
docker container $word --help
2 changes: 1 addition & 1 deletion sources/docker-image.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# :fzf-tab:complete:docker-image:argument-1
docker image $word --help | bat -lhelp
docker image $word --help
2 changes: 1 addition & 1 deletion sources/flatpak.zsh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# :fzf-tab:complete:(\\|*/|)flatpak:
case $group in
argument)
flatpak $word --help | bat -lhelp
flatpak $word --help
;;
esac
2 changes: 1 addition & 1 deletion sources/jupyter.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# :fzf-tab:complete:(\\|*/|)jupyter:argument-1
jupyter $word --help | bat -lhelp
jupyter $word --help
2 changes: 1 addition & 1 deletion sources/kitty.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ case $group in
less =$word
;;
'%BEntry points%b')
kitty $word --help | bat -lhelp
kitty $word --help
;;
esac
2 changes: 1 addition & 1 deletion sources/pipx.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# :fzf-tab:complete:(\\|*/|)pipx:
pipx $word --help | bat -lhelp
pipx $word --help
2 changes: 1 addition & 1 deletion sources/plotext.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# :fzf-tab:complete:(\\|*/|)plotext:argument-1
plotext $word --help | bat -lhelp
plotext $word --help
2 changes: 1 addition & 1 deletion sources/poetry.zsh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# :fzf-tab:complete:(\\|*/|)poetry:
case $group in
command)
poetry $word --help | bat -lhelp
poetry $word --help
;;
esac

0 comments on commit e33db42

Please sign in to comment.