diff --git a/fish/functions/git_sw.fish b/fish/functions/git_sw.fish index 8ebc30db..55604942 100644 --- a/fish/functions/git_sw.fish +++ b/fish/functions/git_sw.fish @@ -4,7 +4,18 @@ function git_sw -d "git switch with fzf" if test (count $argv) -gt 0 - set ref $argv + for arg in $argv + switch $arg + case -d --detach + set -a git_switch_args $arg + case '*' + set ref $arg + end + end + if not set -q ref + print_error "No ref supplied?" + return 1 + end else set ref (git bf) end