forked from genewildish/Mainline
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
This commit is contained in:
99
completion/mainline-completion.bash
Normal file
99
completion/mainline-completion.bash
Normal file
@@ -0,0 +1,99 @@
|
||||
# Mainline bash completion script
|
||||
#
|
||||
# To install:
|
||||
# source /path/to/completion/mainline-completion.bash
|
||||
#
|
||||
# Or add to ~/.bashrc:
|
||||
# source /path/to/completion/mainline-completion.bash
|
||||
|
||||
_mainline_completion() {
|
||||
local cur prev words cword
|
||||
_init_completion || return
|
||||
|
||||
# Get current word and previous word
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
# Completion options based on previous word
|
||||
case "${prev}" in
|
||||
--display)
|
||||
# Display backends
|
||||
COMPREPLY=($(compgen -W "terminal null replay websocket pygame moderngl" -- "${cur}"))
|
||||
return
|
||||
;;
|
||||
|
||||
--pipeline-source)
|
||||
# Available sources
|
||||
COMPREPLY=($(compgen -W "headlines poetry empty fixture pipeline-inspect" -- "${cur}"))
|
||||
return
|
||||
;;
|
||||
|
||||
--pipeline-effects)
|
||||
# Available effects (comma-separated)
|
||||
local effects="afterimage border crop fade firehose glitch hud motionblur noise tint"
|
||||
COMPREPLY=($(compgen -W "${effects}" -- "${cur}"))
|
||||
return
|
||||
;;
|
||||
|
||||
--pipeline-camera)
|
||||
# Camera modes
|
||||
COMPREPLY=($(compgen -W "feed scroll horizontal omni floating bounce radial" -- "${cur}"))
|
||||
return
|
||||
;;
|
||||
|
||||
--pipeline-border)
|
||||
# Border modes
|
||||
COMPREPLY=($(compgen -W "off simple ui" -- "${cur}"))
|
||||
return
|
||||
;;
|
||||
|
||||
--pipeline-display)
|
||||
# Display backends (same as --display)
|
||||
COMPREPLY=($(compgen -W "terminal null replay websocket pygame moderngl" -- "${cur}"))
|
||||
return
|
||||
;;
|
||||
|
||||
--theme)
|
||||
# Theme colors
|
||||
COMPREPLY=($(compgen -W "green orange purple blue red" -- "${cur}"))
|
||||
return
|
||||
;;
|
||||
|
||||
--viewport)
|
||||
# Viewport size suggestions
|
||||
COMPREPLY=($(compgen -W "80x24 100x30 120x40 60x20" -- "${cur}"))
|
||||
return
|
||||
;;
|
||||
|
||||
--preset)
|
||||
# Presets (would need to query available presets)
|
||||
COMPREPLY=($(compgen -W "demo demo-base demo-pygame demo-camera-showcase poetry headlines empty test-basic test-border test-scroll-camera" -- "${cur}"))
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
# Flag completion (start with --)
|
||||
if [[ "${cur}" == -* ]]; then
|
||||
COMPREPLY=($(compgen -W "
|
||||
--display
|
||||
--pipeline-source
|
||||
--pipeline-effects
|
||||
--pipeline-camera
|
||||
--pipeline-display
|
||||
--pipeline-ui
|
||||
--pipeline-border
|
||||
--viewport
|
||||
--preset
|
||||
--theme
|
||||
--websocket
|
||||
--websocket-port
|
||||
--allow-unsafe
|
||||
--help
|
||||
" -- "${cur}"))
|
||||
return
|
||||
fi
|
||||
}
|
||||
|
||||
complete -F _mainline_completion mainline.py
|
||||
complete -F _mainline_completion python\ -m\ engine.app
|
||||
complete -F _mainline_completion python\ -m\ mainline
|
||||
Reference in New Issue
Block a user