Files
Mainline/completion/mainline-completion.zsh
David Gwilliam 860bab6550 fix(pipeline): Use config display value in auto-injection
- Change line 477 in controller.py to use self.config.display or "terminal"
- Previously hardcoded "terminal" ignored config and CLI arguments
- Now auto-injection respects the validated display configuration

fix(app): Add warnings for auto-selected display

- Add warning in pipeline_runner.py when --display not specified
- Add warning in main.py when --pipeline-display not specified
- Both warnings suggest using null display for headless mode

feat(completion): Add bash/zsh/fish completion scripts

- completion/mainline-completion.bash - bash completion
- completion/mainline-completion.zsh - zsh completion
- completion/mainline-completion.fish - fish completion
- Provides completions for --display, --pipeline-source, --pipeline-effects,
  --pipeline-camera, --preset, --theme, --viewport, and other flags
2026-03-21 17:05:03 -07:00

49 lines
1.9 KiB
Bash

#compdef mainline.py
# Mainline zsh completion script
#
# To install:
# source /path/to/completion/mainline-completion.zsh
#
# Or add to ~/.zshrc:
# source /path/to/completion/mainline-completion.zsh
# Define completion function
_mainline() {
local -a commands
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
'(-h --help)'{-h,--help}'[Show help]' \
'--display=[Display backend]:backend:(terminal null replay websocket pygame moderngl)' \
'--preset=[Preset to use]:preset:(demo demo-base demo-pygame demo-camera-showcase poetry headlines empty test-basic test-border test-scroll-camera test-figment test-message-overlay)' \
'--viewport=[Viewport size]:size:(80x24 100x30 120x40 60x20)' \
'--theme=[Color theme]:theme:(green orange purple blue red)' \
'--websocket[Enable WebSocket server]' \
'--websocket-port=[WebSocket port]:port:' \
'--allow-unsafe[Allow unsafe pipeline configuration]' \
'(-)*: :{_files}' \
&& ret=0
# Handle --pipeline-* arguments
if [[ -n ${words[*]} ]]; then
_arguments -C \
'--pipeline-source=[Data source]:source:(headlines poetry empty fixture pipeline-inspect)' \
'--pipeline-effects=[Effect plugins]:effects:(afterimage border crop fade firehose glitch hud motionblur noise tint)' \
'--pipeline-camera=[Camera mode]:camera:(feed scroll horizontal omni floating bounce radial)' \
'--pipeline-display=[Display backend]:backend:(terminal null replay websocket pygame moderngl)' \
'--pipeline-ui[Enable UI panel]' \
'--pipeline-border=[Border mode]:mode:(off simple ui)' \
'--viewport=[Viewport size]:size:(80x24 100x30 120x40 60x20)' \
&& ret=0
fi
return ret
}
# Register completion function
compdef _mainline mainline.py
compdef _mainline "python -m engine.app"
compdef _mainline "python -m mainline"