Command line interface for YaST2 modules
List of Global Functions
Abort - Abort the command line handling
Aborted - User asked for abort (forgetting the changes)
Command - Get next user-given command
Done - Are there some commands to be processed?
Error - Print an Error Message
Init - Initialize Module
Interactive - Is module started in interactive command-line mode?
Parse - Parse a list of arguments.
PasswordInput - Read input from command line
Print - Print a String
PrintNoCR - Print a String, don't add a trailing newline character
PrintVerbose - Same as Print(), but the string is printed only when verbose command line mode was activated
PrintVerboseNoCR - Same as PrintNoCR(), but the string is printed only when verbose command line mode was activated
Run - Parse the Command Line
Scan - Scan a command line from stdin, return it split into a list
StartGUI - Should module start UI?
UniqueOption - Check uniqueness of an option
UserInput - Read input from command line
Verbose - Return verbose flag boolean verbose flag
YesNo - Ask user, commandline equivalent of Popup::YesNo()
List of Global Variables
User asked for abort (forgetting the changes)
Return value
boolean - true, if the user asked abort
Get next user-given command
Return value
map - of the new command. If there are no more commands, it returns exit or abort depending on the result user asked for.
Are there some commands to be processed?
Return value
boolean - true, if there is no more commands to be processed, either because the user used command line, or the interactive mode was finished
Initialize Module
Function parameters
map cmdlineinfo
list<any> args
Return value
boolean - true, if there are some commands to be processed
Is module started in interactive command-line mode?
Return value
boolean - true, if the user asked for interactive command-line mode
Parse a list of arguments.
Function parameters
list<any> arguments
Return value
map<string, any> - containing the command and it's option. In case of error it is an empty map.
Read input from command line
Function parameters
string prompt
Return value
string - Entered string
Print a String, don't add a trailing newline character
Function parameters
string s
Return value
void
Same as Print(), but the string is printed only when verbose command line mode was activated
Function parameters
string s
Return value
void
Same as PrintNoCR(), but the string is printed only when verbose command line mode was activated
Function parameters
string s
Return value
void
Parse the Command Line
Function parameters
map commandline
Return value
any - false if there was an error or no changes to be written (for example "help"). true if the changes should be written, or a value returned by the handler
Scan a command line from stdin, return it split into a list
Return value
list<string> - the list of command line parts, nil for end of file
Should module start UI?
Return value
boolean - true, if the user asked for standard UI (no parameter was passed by command line)
Check uniqueness of an option
Function parameters
map<string, string> options
list unique_options
Return value
string - nil if there is a problem, otherwise the unique option found
Read input from command line
Function parameters
string prompt
Return value
string - Entered string