gstreamer/tools
David Rothlisberger f586e34a50 tools/gstreamer-completion: Bash 3.2 compatibility fixes
Compatible with bash 3.2; doesn't require the bash-completion package at
all (though the easiest way to install this script is still to install
bash-completion, and then drop this script into /etc/bash_completion.d).

Note that bash 3 doesn't break COMP_WORDS according to characters in
COMP_WORDBREAKS, so "property=val" looks like a single word, so this
won't complete property values (on bash 3). Similarly,
"--gst-debug-level=<TAB>" won't complete properly (on bash 3), but
"--gst-debug-level <TAB>" will.

For that reason, I now offer "--gst-debug-level" etc as completions
instead of "--gst-debug-level=".

Functions "_init_completion" and "_parse_help" were provided by the
bash-completion package >= 2.0; now I roll my own equivalent of
"_parse_help", and instead of "_init_completion" I use
"_get_comp_words_by_ref" which is available from bash-completion 1.2
onwards. If the bash-completion package isn't available at all I use
bash's raw facilities, at the expense of not completing properly when
the cursor is in the middle of a word.

The builtin "compopt" doesn't exist in bash 3; those users will just
have to live with the inconvenience of "property=" completing to
"property= " with a trailing space. Property values aren't completed
properly anyway on bash 3 (see above).

"[[ -v var ]]" to test whether a variable is set, also doesn't exist in
bash 3. Neither does ";;&" to fall through in a "case" statement.

In the unit tests:

* On my system (OS X), "#!/bin/bash" is bash 3.2, whereas
  "#!/usr/bin/env bash" is the 4.2 version I built myself.
* I have to initialise array variables like "expected=()", or bash 3
  treats "+=" as appending to an array already populated with one empty
  string.
2013-04-29 21:12:42 +02:00
..
.gitignore Remove everything libxml2- and loadsave-related 2011-06-04 15:22:06 +01:00
gst-indent gst-indent: Add --leave-preprocessor-space for indent 2.2.11 2010-04-03 20:51:17 +02:00
gst-inspect.1.in docs: fix typo on gst-inspect man page 2010-07-16 18:20:57 +01:00
gst-inspect.c gst-inspect: only add a '*' for non-'gpointer' pointers 2013-04-13 12:00:12 +01:00
gst-launch.1.in docs: flesh out gst-launch-1.0 man page a little 2013-02-13 23:27:16 +00:00
gst-launch.c tools: update for latest context API changes 2013-04-18 10:13:30 +01:00
gst-plot-timeline.py docs: some 0.10 -> 1.0 changes 2012-10-02 13:22:35 +02:00
gst-typefind.1.in docs: updates 2012-09-25 17:06:45 +02:00
gst-typefind.c Fix FSF address 2012-11-03 20:44:48 +00:00
gstreamer-completion tools/gstreamer-completion: Bash 3.2 compatibility fixes 2013-04-29 21:12:42 +02:00
Makefile.am gst: Change versioning 2012-04-04 14:28:55 +02:00
tools.h Fix FSF address 2012-11-03 20:44:48 +00:00