diff --git a/conf.d/gitnow.fish b/conf.d/gitnow.fish index 2b5afd9..50ef15a 100644 --- a/conf.d/gitnow.fish +++ b/conf.d/gitnow.fish @@ -1,21 +1,17 @@ # GitNow — Speed up your Git workflow. 🐠 # https://github.com/joseluisq/gitnow -# +# # NOTE: # Fish 2.2.0 doesn't include native snippet support. # Upgrade to Fish >= 2.3.0 or append the following code to your ~/.config/fish/config.fish -set -q XDG_CONFIG_HOME; or set XDG_CONFIG_HOME ~/.config -set -q fish_config; or set -g fish_config $XDG_CONFIG_HOME/fish -set -q gitnow_path; or set -g gitnow_path $fish_config - -source "$gitnow_path/functions/__gitnow_functions.fish" -source "$gitnow_path/functions/__gitnow_manual.fish" - -function gitnow -d "Gitnow: Speed up your Git workflow. 🐠" - __gitnow_manual | less -r - - commandline -f repaint; +function gitnow -d "Gitnow: Speed up your Git workflow. 🐠" -a xversion + if [ "$xversion" = "-v" ]; or [ "$xversion" = "--version" ] + echo "GitNow version $gitnow_version" + else + __gitnow_manual | command less -r + commandline -f repaint; + end end function state -d "Gitnow: Show the working tree status in compact way" @@ -201,7 +197,7 @@ function logs -d "Gitnow: Shows logs in a fancy way" set args $argv end - command git log $args --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit | command less -r + command git log $args --color --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" --abbrev-commit | command less -r commandline -f repaint; end diff --git a/conf.d/gitnow_config.fish b/conf.d/gitnow_config.fish new file mode 100644 index 0000000..aefcb75 --- /dev/null +++ b/conf.d/gitnow_config.fish @@ -0,0 +1,15 @@ +# GitNow — Speed up your Git workflow. 🐠 +# https://github.com/joseluisq/gitnow +# +# NOTE: +# Fish 2.2.0 doesn't include native snippet support. +# Upgrade to Fish >= 2.3.0 or append the following code to your ~/.config/fish/config.fish + +set -q XDG_CONFIG_HOME; or set XDG_CONFIG_HOME ~/.config +set -q fish_config; or set -g fish_config $XDG_CONFIG_HOME/fish +set -q fish_functions; or set -g fish_functions "$fish_config/functions" + +set -g gitnow_version 2.0.4 + +source "$fish_functions/__gitnow_functions.fish" +source "$fish_functions/__gitnow_manual.fish" diff --git a/functions/__gitnow_manual.fish b/functions/__gitnow_manual.fish index 30cbd7c..5e74b37 100644 --- a/functions/__gitnow_manual.fish +++ b/functions/__gitnow_manual.fish @@ -6,8 +6,6 @@ # Upgrade to Fish >= 2.3.0 or append the following code to your ~/.config/fish/config.fish function __gitnow_manual -d "Gitnow: Manual page like" - set -l gitnow_version "v2.0.4" - echo (set_color white --bold)"NAME"(set_color normal) echo " GitNow — Speed up your Git workflow. 🐠" echo