YaST2 Developers Documentation: Unknown YCP Module

Unknown YCP Module

This module has an unstable interface.

Imports

  • Directory
  • Integer
  • Mode
  • Report
  • RichText
  • RichText
  • Stage
  • String
  • TypeRepository
  • XML

Global Functions

Local Variables

Local Functions

Info:

File: modules/CommandLine.ycp Package: yast2 Summary: Command line interface for YaST2 modules Author: Stanislav Visnovsky

local systemcommands -> commands_t

Map of commands for every module. ATM the list of commands this module handles internally.

local modulecommands -> map

Map of commands defined by the YaST2 module.

local allcommands -> map

Merged map of commands - both defined by the YaST2 module and system commands. Used for lookup

local interactive -> boolean

User asked for interactive session

local done -> boolean

All commands have been processed

local aborted -> boolean

User asked for quitting of interactive session, or there was an error

local verbose -> boolean

Verbose mode flag

local cmdlinespec -> map

Remember the command line specification for later use

local PrintInternal (string s, boolean newline) -> void

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
global Print (string s) -> void

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
global PrintNoCR (string s) -> void

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
global PrintVerbose (string s) -> void

Same as Print(), but the string is printed only when verbose command line mode was activated

Parameters:
s string to print
global PrintVerboseNoCR (string s) -> void

Same as PrintNoCR(), but the string is printed only when verbose command line mode was activated

Parameters:
s string to print
global PrintTable (term header, list<term> content) -> void

Print a Table

Print a table using Print(). Format of table is as libyui but not all features are supported, e.g. no icons.

Parameters:
header header of table in libyui format
content content of table in libyui format
global Error (string message) -> void

Print an Error Message

Parameters:
message error message to be printed. Use nil for no message
global Parse (list<any> arguments) -> map<string, any>

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.
local PrintHead () -> void

Print a nice heading for this module

local PrintActionHelp (string action) -> void

Print a help text for a given action.

Parameters:
action the action for which the help should be printed
local PrintGeneralHelp () -> void

Print a general help - list of available command.

local ProcessSystemCommands (map command) -> boolean

Handle the system-wide commands, like help etc.

Parameters:
command a map of the current command
Return value:
true, if the command was handled
global Init (map cmdlineinfo, list<any> args) -> boolean

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
global Scan () -> list<string>

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
local GetInput (string prompt, symbol type) -> string

Set prompt and read input from command line

Parameters:
prompt Set prompt
type Type
Return value:
Entered string
global UserInput (string prompt) -> string

Read input from command line

Parameters:
prompt Set prompt to this value
Return value:
Entered string
global PasswordInput (string prompt) -> string

Read input from command line

Parameters:
prompt Set prompt to this value
Return value:
Entered string
global Command () -> map

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
global StartGUI () -> boolean

Should module start UI?

Return value:
true, if the user asked for standard UI (no parameter was passed by command line)
global Interactive () -> boolean

Is module started in interactive command-line mode?

Return value:
true, if the user asked for interactive command-line mode
global Aborted () -> boolean

User asked for abort (forgetting the changes)

Return value:
true, if the user asked abort
global Abort () -> void

Abort the command line handling

global Done () -> boolean

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
global UniqueOption (map<string, string> options, list unique_options) -> string

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
global Run (map commandline) -> any

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
global YesNo () -> boolean

Ask user, commandline equivalent of Popup::YesNo()

Return value:
true if user entered "yes"
global Verbose () -> boolean

Return verbose flag boolean verbose flag