feat: default to 'show' subcommand when jjf is invoked without args

Mirrors the original bash+fzf script's behavior — `jjf` alone becomes
a quick rev browser. Implemented in shell wrappers (so the --emit
history-rewrite path still applies); the binary itself still prints
usage on bare invocation, for explicit invocations.
This commit is contained in:
swaits committed 2026-04-29 15:58:55 -06:00
1 parent 3d0ba30bfc
commit 7dec6770cc
4 files changed
+15 -9

No files matched your search

+5 -1
View File
@@ -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