Permalink
Browse files

Improve tab completion

  • Loading branch information...
parttimenerd committed May 28, 2016
1 parent 552bddb commit cf03e3cb7759d3456b368d9ca3a65ae299244f56
Showing with 95 additions and 88 deletions.
  1. +1 −1 .gitignore
  2. +44 −44 bash_completion.sh
  3. +9 −2 create_tab_completion.py
  4. +41 −41 zsh_completion.sh
View
@@ -5,4 +5,4 @@ GUI-Release
.project
.settings
*~
documentation
documentation
View
@@ -5,62 +5,62 @@
_ospac(){
local opts
opts=(
--image
--artist
--category
--episode
--mix
--raw
--voice
--overlap
--fade
--parallel
--year
--album
--comment
--image
--album
--title
--mix
--voice
--raw
--verbosity
--episode
--category
--artist
--skip-order
--skip-target
--skip-level
--no-skip
--soft
--noise
--trim
--help
--xgate
--no-xfilter
--no-xgate
--xfilter
--mono
--spatial
--set-stereo-spatial
--stereo
--multi
--set-stereo-level
--output
--ogg
--plot
--quality
--mp3
--low-pass
--verbosity
--normalize
--no-eqvoice
--eqvoice
--level-mode
--factor
--no-leveler
--leveler
--no-factor
--analyze
--no-eqvoice
--target
--highpass
--leveler
--normalize
--low-pass
--band-pass
--eqvoice
--no-leveler
--highpass
--no-normalize
--factor
--target
--set-stereo-level
--spatial
--stereo
--multi
--mono
--set-stereo-spatial
--xfilter
--no-xfilter
--xgate
--no-xgate
--ascii
--left
--to-mono
--right
--ascii
--overlap
--fade
--parallel
--skip-target
--skip-level
--no-skip
--noise
--soft
--trim
--skip-order
--output
--mp3
--quality
--plot
--ogg
)
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -W "${opts[*]}" -- $cur) )
View
@@ -3,6 +3,7 @@
# By Johannes Bechberger, under MIT License
import sys
import os
description = "description" # hacks that allow better editing in IDEs
zsh = "zsh"
@@ -103,7 +104,8 @@
},
"--image": {
description: "Set the image tag if this exists in the output",
flag: False
flag: False,
zsh: "_files"
}
},
"New segment selection": {
@@ -257,6 +259,11 @@ def process_item(section: str, name: str, item: dict) -> str:
if item[zsh]:
if isinstance(item[zsh], list):
ret += "(" + " ".join(repr(x) for x in item[zsh]) + ")"
elif isinstance(item[zsh], str):
ret += item[zsh]
else:
print("Error on zsh completion in " + repr(item), file=sys.stderr)
os.error(1)
return repr(ret)
return """
@@ -318,4 +325,4 @@ def process_item(section: str, name: str, item: dict) -> str:
elif sys.argv[1] == "bash":
compl = bash_completion()
with open(sys.argv[2], "w") as f:
f.write(compl)
f.write(compl)
View
@@ -6,62 +6,62 @@ _ospac(){
local -a opts
opts=(
"*: :_files"
'*--mix[Start pre-mixed channel segment]'
'*--raw[Start of raw channel segment]'
'*--voice[Start of voice channel segment (default)]'
'*--set-stereo-spatial[Set maximum interaural delay distance (0.03)]: :'
'*--stereo[Create intensity stereo (default)]'
'*--spatial[Create 3d stereo with interaural delays]'
'*--mono[Create mono output]'
'*--multi[Create multi channel output]'
'*--set-stereo-level[Set maximum channel volume factor (0.9)]: :'
'*--output[Write final output to the file in netbpm format]: :'
'*--mp3[Write final output to the file using external lame]: :'
'*--quality[Quality from 0-low, 1-standard, 2-high, 3-insane]: :(0 1 2 3)'
'*--ogg[Write final output to the file using external oggenc]: :'
'*--plot[Write final output to the file in wave format]: :'
'*--ascii[<s> <file> Load ascii wave file with sample rate s]: :'
'*--right[Load right channel of wave file (if stereo)]: :'
'*--to-mono[Load mono-mixdown of wave file (if stereo)]: :'
'*--left[Load left channel of wave file (if stereo)]: :'
"*--level-mode[Shall channels be joined for leveling]: :('single' 'stereo' 'multi')"
'*--target[Set average target L2 energy for leveler (3000)]: :'
'*--normalize[Normalize final mix]'
'*--eqvoice[Attenuate voice frequency bands]'
'*--factor[Multiply channels by the given factor with sigmoid limiter (1.25)]: :'
'*--no-normalize[Disable final normalization]'
'*--no-eqvoice[Do not attenuate frequency bands]'
'*--quality[Quality from 0-low, 1-standard, 2-high, 3-insane]: :(0 1 2 3)'
'*--mp3[Write final output to the file using external lame]: :_files'
'*--output[Write final output to the file in netbpm format]: :_files'
'*--plot[Write final output to the file in wave format]: :_files'
'*--ogg[Write final output to the file using external oggenc]: :_files'
'*--highpass[<f> <t> Highpass above f Hertz, sharpness t Hertz]: :'
'*--leveler[Enable selective leveler]'
'*--no-factor[Disable channel multiplier]'
'*--no-normalize[Disable final normalization]'
'*--eqvoice[Attenuate voice frequency bands]'
'*--band-pass[<l> <h> <t> Bandpass from l to h Hertz, sharpness t Hertz]: :'
'*--target[Set average target L2 energy for leveler (3000)]: :'
"*--level-mode[Shall channels be joined for leveling]: :('single' 'stereo' 'multi')"
'*--normalize[Normalize final mix]'
'*--no-leveler[Disable selective leveler]'
'*--no-factor[Disable channel multiplier]'
'*--analyze[Analyze frequency band components]'
'*--low-pass[<f> <t> Lowpass below f Hertz, sharpness t Hertz]: :'
'*--analyze[Analyze frequency band components]'
'*--factor[Multiply channels by the given factor with sigmoid limiter (1.25)]: :'
'*--no-eqvoice[Do not attenuate frequency bands]'
'*--verbosity[Set the verbosity level]: :(0 1 2 3 4 5 6)'
'*--help[Display the help text]'
'*--no-xfilter[Disable crosstalk filter]'
'*--no-xgate[Disable crosstalk gate]'
'*--xfilter[Enable experimental crosstalk filter]'
'*--no-xfilter[Disable crosstalk filter]'
'*--xgate[Enable robust crosstalk gate]'
'*--verbosity[Set the verbosity level]: :(0 1 2 3 4 5 6)'
'*--help[Display the help text]'
'*--image[Set the image tag if this exists in the output]: :'
'*--episode[Set the episode tag if this exists in the output]: :'
'*--artist[Set the artist tag if this exists in the output]: :'
'*--comment[Set the comment tag if this exists in the output]: :'
'*--parallel[Render previous and next segment in parallel]'
'*--fade[Fading transition over the given number of seconds]: :'
'*--overlap[Overlapping transition over the given number of seconds]: :'
'*--right[Load right channel of wave file (if stereo)]: :_files'
'*--ascii[<s> <file> Load ascii wave file with sample rate s]: :'
'*--left[Load left channel of wave file (if stereo)]: :_files'
'*--to-mono[Load mono-mixdown of wave file (if stereo)]: :_files'
'*--album[Set the album tag if this exists in the output]: :'
'*--category[Set the category tag if this exists in the output]: :'
'*--title[Set the title tag if this exists in the output]: :'
'*--comment[Set the comment tag if this exists in the output]: :'
'*--artist[Set the artist tag if this exists in the output]: :'
'*--year[Set the year tag if this exists in the output]: :'
'*--parallel[Render previous and next segment in parallel]'
'*--fade[Fading transition over the given number of seconds]: :'
'*--overlap[Overlapping transition over the given number of seconds]: :'
'*--skip-target[Target length fraction for iteration]: :'
'*--soft[Soft skip silent passages over 0.5s length]'
'*--skip-order[Order of reduction (0-1, default: 0.75)]: :'
'*--skip-level[Fraction of maximum level considered silence (0.01)]: :'
'*--episode[Set the episode tag if this exists in the output]: :'
'*--image[Set the image tag if this exists in the output]: :_files'
'*--trim[Trim audio from start and end]'
'*--skip-level[Fraction of maximum level considered silence (0.01)]: :'
'*--no-skip[Do not skip any content]'
'*--soft[Soft skip silent passages over 0.5s length]'
'*--noise[Skip all but silence]'
'*--skip-target[Target length fraction for iteration]: :'
'*--skip-order[Order of reduction (0-1, default: 0.75)]: :'
'*--mix[Start pre-mixed channel segment]'
'*--voice[Start of voice channel segment (default)]'
'*--raw[Start of raw channel segment]'
'*--set-stereo-level[Set maximum channel volume factor (0.9)]: :'
'*--spatial[Create 3d stereo with interaural delays]'
'*--mono[Create mono output]'
'*--multi[Create multi channel output]'
'*--set-stereo-spatial[Set maximum interaural delay distance (0.03)]: :'
'*--stereo[Create intensity stereo (default)]'
)
_arguments $opts
}

0 comments on commit cf03e3c

Please sign in to comment.