Script build_bash_completion
[hide private]
[frames] | no frames]

Script build_bash_completion

Script to generate bash_completion script for Ganeti.

Classes [hide private]
  CompletionWriter
Command completion writer class.
Functions [hide private]
 
WritePreamble(sw)
Writes the script preamble.
 
WriteCompReply(sw, args, cur="\"$cur\"")
 
WriteCompletion(sw, scriptname, funcname, commands=None, opts=None, args=None)
Writes the completion code for one command.
 
GetFunctionName(name)
 
GetCommands(filename, module)
Returns the commands defined in a module.
 
main()

Imports: os, re, StringIO, constants, cli, utils, build, _autoconf


Function Details [hide private]

WritePreamble(sw)

 

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.