Script build_bash_completion
|
|
Script build_bash_completion
Script to generate bash_completion script for Ganeti.
|
|
|
WriteCompReply(sw,
args,
cur="\"$cur\"") |
|
|
|
WriteCompletion(sw,
scriptname,
funcname,
commands=None,
opts=None,
args=None)
Writes the completion code for one command. |
|
|
|
|
|
GetCommands(filename,
module)
Returns the commands defined in a module. |
|
|
|
|
|
_OPT_NAME_RE = re.compile(r"^-[a-zA-Z0-9]|--[a-z][-a-z0-9]+$")
Regular expression describing desired format of option names.
|
Imports:
os,
re,
itertools,
StringIO,
constants,
cli,
utils,
build,
_autoconf
Writes the script preamble.
Helper functions should be written here.
|
WriteCompletion(sw,
scriptname,
funcname,
commands=None,
opts=None,
args=None)
|
|
Writes the completion code for one command.
- Parameters:
sw (ShellWriter) - Script writer
scriptname (string) - Name of command line program
funcname (string) - Shell function name
commands (list) - List of all subcommands in this program
|
GetCommands(filename,
module)
|
|
Returns the commands defined in a module.
Aliases are also added as commands.
|
_OPT_NAME_RE
Regular expression describing desired format of option names. Long
names can contain lowercase characters, numbers and dashes only.
- Value:
re.compile(r"^-[a-zA-Z0-9]|--[a-z][-a-z0-9]+$")
|
|