This adds the framework for command completion of scripts which make
use of the gsu subcommand library. The idea is to implement as much
as possible as generic helpers within gsu in order to minimize code
duplication in the scripts which source the gsu library.
The new "complete" subcommand is automatically included in each
application, just like the help, man and prefs commands we already
have. This subommand is meant to be used as the completer which calls
the custom subcommand completers included in the application.
Two new public helper functions, gsu_complete_options() and
gsu_cword_is_option_parameter() are introduced in this commit.
The former function takes a usual getopt string and completes according
to all options in this string. The latter is useful for completers
which need to determine whether the current word is the parameter to
some option in order to find out how to complete the current word.
For example, the -s option of cmt's vmem command takes a mandatory
parameter which is a number. So the completer for this command must
complete differently depending on whether the previous word is "-s".