diff --git a/src/init/bash.sh b/src/init/bash.sh index 431b1da..ccc4eed 100644 --- a/src/init/bash.sh +++ b/src/init/bash.sh @@ -1,6 +1,10 @@ jjf() { + # No args → default to `show` so `jjf` alone is a rev browser. + if [ $# -eq 0 ]; then + set -- show + fi # Meta-commands and bare flags bypass the picker and run the binary directly. - if [ $# -eq 0 ] || [ "$1" = "init" ] || [ "${1#-}" != "$1" ]; then + if [ "$1" = "init" ] || [ "${1#-}" != "$1" ]; then command jjf "$@" return $? fi diff --git a/src/init/fish.fish b/src/init/fish.fish index 5c28553..02e8a05 100644 --- a/src/init/fish.fish +++ b/src/init/fish.fish @@ -1,10 +1,10 @@ function jjf set -e _jjf_pending_swap - # Meta-commands and bare flags bypass the picker and run the binary directly. + # No args → default to `show` so `jjf` alone is a rev browser. if test (count $argv) -eq 0 - command jjf - return $status + set argv show end + # Meta-commands and bare flags bypass the picker and run the binary directly. if test "$argv[1]" = init; or string match -q -- '-*' $argv[1] command jjf $argv return $status diff --git a/src/init/nu.nu b/src/init/nu.nu index 140dcbc..f1b3b94 100644 --- a/src/init/nu.nu +++ b/src/init/nu.nu @@ -1,9 +1,7 @@ def --env jjf [...args] { + # No args → default to `show` so `jjf` alone is a rev browser. + let args = if ($args | is-empty) { ["show"] } else { $args } # Meta-commands and bare flags bypass the picker and run the binary directly. - if ($args | is-empty) { - ^jjf - return - } let first = $args.0 if $first == "init" or ($first | str starts-with "-") { ^jjf ...$args diff --git a/src/init/zsh.sh b/src/init/zsh.sh index c9a526f..025a77a 100644 --- a/src/init/zsh.sh +++ b/src/init/zsh.sh @@ -1,6 +1,10 @@ jjf() { + # No args → default to `show` so `jjf` alone is a rev browser. + if [ $# -eq 0 ]; then + set -- show + fi # Meta-commands and bare flags bypass the picker and run the binary directly. - if [ $# -eq 0 ] || [ "$1" = "init" ] || [ "${1#-}" != "$1" ]; then + if [ "$1" = "init" ] || [ "${1#-}" != "$1" ]; then command jjf "$@" return $? fi