Browse Source

add bash completion script

cairo_optimizations
Alexandros Theodotou 3 years ago
parent
commit
8edf88ae2b
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 7
      data/meson.build
  2. 34
      data/zrythm-completion.bash

7
data/meson.build

@ -64,4 +64,11 @@ install_data ( @@ -64,4 +64,11 @@ install_data (
join_paths (
[datadir, 'mime/packages']))
# install bash completion
install_data (
'zrythm-completion.bash',
install_dir: '/etc/bash_completion.d',
install_mode: 'r--r--r--',
rename: 'zrythm')
subdir('windows')

34
data/zrythm-completion.bash

@ -0,0 +1,34 @@ @@ -0,0 +1,34 @@
#/usr/bin/env bash
#
# Copyright (C) 2020 Alexandros Theodotou <alex at zrythm dot org>
#
# This file is part of Zrythm
#
# Zrythm is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Zrythm is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Zrythm. If not, see <https://www.gnu.org/licenses/>.
_zrythm()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="--help --version --reset-to-factory -h -v -p --print-settings"
if [[ ${cur} == -* ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
fi
}
complete -o default -F _zrythm zrythm
Loading…
Cancel
Save