File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ temporalctx staging # switch to "staging" context
8181temporalctx - # switch to previous context
8282temporalctx -c # print current context
8383temporalctx edit # open config in $EDITOR
84+ temporalctx help # show command help
8485tctx # alias for temporalctx
8586```
8687
Original file line number Diff line number Diff line change @@ -231,6 +231,20 @@ _temporalctx_edit_config() {
231231 ${=editor_cmd} " $config_file "
232232}
233233
234+ _temporalctx_help () {
235+ cat << 'EOF '
236+ Usage:
237+ temporalctx interactive picker (fzf)
238+ temporalctx <context> switch to context
239+ temporalctx - switch to previous context
240+ temporalctx -c print current context
241+ temporalctx edit open config in $VISUAL/$EDITOR
242+ temporalctx start start local dev server
243+ temporalctx stop stop local dev server
244+ temporalctx help show this help
245+ EOF
246+ }
247+
234248_temporalctx_start_local_server () {
235249 local no_overmind pid_file pid socket procfile
236250 no_overmind=" ${1:- 0} "
@@ -375,6 +389,9 @@ temporalctx() {
375389 " " )
376390 _temporalctx_pick_context
377391 ;;
392+ help|-h|--help)
393+ _temporalctx_help
394+ ;;
378395 start)
379396 if [[ " $2 " == " --no-overmind" ]]; then
380397 no_overmind=1
Original file line number Diff line number Diff line change @@ -106,6 +106,20 @@ assert_contains "$visual_args" "$cfg" "editor should receive config file path"
106106[[ ! -f " $fallback_log " ]] || fail " EDITOR fallback should not run when VISUAL is set"
107107log " case passed: edit subcommand"
108108
109+ # Test: help output via subcommand and flag.
110+ log " case: help output"
111+ out=" $( TEMPORAL_CONFIG=" $cfg " zsh -c '
112+ source "' $REPO_ROOT ' /temporalctx.plugin.zsh"
113+ echo "-- help --"
114+ temporalctx help
115+ echo "-- --help --"
116+ temporalctx --help
117+ ' ) "
118+ assert_contains " $out " " Usage:" " help output should include usage header"
119+ assert_contains " $out " " temporalctx <context>" " help output should describe context switching"
120+ assert_contains " $out " " temporalctx help" " help output should describe help command"
121+ log " case passed: help output"
122+
109123# Test: alias + local dev server start/stop via PID file.
110124log " case: tctx alias and local dev server lifecycle"
111125out=" $( PATH=" $tmp_root /bin:$PATH " TEMPORAL_CONFIG=" $cfg " zsh -c '
You can’t perform that action at this time.
0 commit comments