Files
sideline/completion/mainline-completion.bash
David Gwilliam 901717b86b feat(presets): Add upstream-default preset and enhance demo preset
- Add upstream-default preset matching upstream mainline behavior:
  - Terminal display (not pygame)
  - No message overlay
  - Classic effects: noise, fade, glitch, firehose
  - Mixed positioning mode

- Enhance demo preset to showcase sideline features:
  - Hotswappable effects via effect plugins
  - LFO sensor modulation (oscillator sensor)
  - Mixed positioning mode
  - Message overlay with ntfy integration
  - Includes hud effect for visual feedback

- Update all presets to use mixed positioning mode
- Update completion script for --positioning flag

Usage:
  python -m mainline --preset upstream-default --display terminal
  python -m mainline --preset demo --display pygame
2026-03-21 18:16:02 -07:00

107 lines
3.1 KiB
Bash

# 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
;;
--positioning)
# Positioning modes
COMPREPLY=($(compgen -W "absolute relative mixed" -- "${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
--positioning
--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