yast2 |
modules/CommandLine.ycp |
Command line interface for YaST2 modules | |
|
|
This module has an unstable interface. |
Imports
Global Functions
Local VariablesLocal Functions |
Map of commands for every module. ATM the list of commands this module handles internally.
Map of commands defined by the YaST2 module.
Merged map of commands - both defined by the YaST2 module and system commands. Used for lookup
User asked for interactive session
All commands have been processed
User asked for quitting of interactive session, or there was an error
Verbose mode flag
Remember the command line specification for later use
Print a String
Print a string to /dev/tty in interactive mode, to stderr in non-interactive Suppress printing if there are no commands to be handled (starting GUI)
- Parameters:
-
s the string to be printed newline
Print a String
Print a string to /dev/tty in interactive mode, to stderr in non-interactive Suppress printing if there are no commands to be handled (starting GUI)
- Parameters:
-
s the string to be printed
Print a String, don't add a trailing newline character
Print a string to /dev/tty in interactive mode, to stderr in non-interactive Suppress printing if there are no commands to be handled (starting GUI)
- Parameters:
-
s the string to be printed
Same as Print(), but the string is printed only when verbose command line mode was activated
- Parameters:
-
s string to print
Same as PrintNoCR(), but the string is printed only when verbose command line mode was activated
- Parameters:
-
s string to print
Print an Error Message
- Parameters:
-
message error message to be printed. Use nil for no message
Parse a list of arguments.
- Parameters:
-
arguments the list of arguments to be parsed
- Return value:
-
containing the command and it's option. In case of error it is an empty map.
Print a nice heading for this module
Print a help text for a given action.
- Parameters:
-
action the action for which the help should be printed
Print a general help - list of available command.
Handle the system-wide commands, like help etc.
- Parameters:
-
command a map of the current command
- Return value:
-
true, if the command was handled
Initialize Module
Initialize the module, setup the command line syntax and arguments passed on the command line.
- Parameters:
-
cmdlineinfo the map describing the module command line args arguments given by the user on the command line
- Return value:
-
true, if there are some commands to be processed
- See
-
Command
Scan a command line from stdin, return it split into a list
- Return value:
-
the list of command line parts, nil for end of file
Set prompt and read input from command line
- Parameters:
-
prompt Set prompt type Type
- Return value:
-
Entered string
Read input from command line
- Parameters:
-
prompt Set prompt to this value
- Return value:
-
Entered string
Read input from command line
- Parameters:
-
prompt Set prompt to this value
- Return value:
-
Entered string
Get next user-given command
Get next user-given command. If there is a command available, returns it, otherwise ask the user for a command (in interactive mode). Also processes system commands.
- Return value:
-
of the new command. If there are no more commands, it returns exit or abort depending on the result user asked for.
- See
-
Parse
Should module start UI?
- Return value:
-
true, if the user asked for standard UI (no parameter was passed by command line)
Is module started in interactive command-line mode?
- Return value:
-
true, if the user asked for interactive command-line mode
User asked for abort (forgetting the changes)
- Return value:
-
true, if the user asked abort
Abort the command line handling
Are there some commands to be processed?
- Return value:
-
true, if there is no more commands to be processed, either because the user used command line, or the interactive mode was finished
Check uniqueness of an option
Check uniqueness of an option. Simply pass the list of user-specified options and a list of mutually exclusive options. In case of error, Report::Error is used.
- Parameters:
-
options options specified by the user on the command line to be checked unique_options list of mutually exclusive options to check against
- Return value:
-
nil if there is a problem, otherwise the unique option found
Parse the Command Line
Function to parse the command line, start a GUI or handle interactive and command line actions as supported by the @ref CommandLine module.
- Parameters:
-
commandline a map used in the CommandLine module with information about the handlers for GUI and commands.
- Return value:
-
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
Ask user, commandline equivalent of Popup::YesNo()
- Return value:
-
true if user entered "yes"
Return verbose flag boolean verbose flag