41. CommandLine

Command line interface for YaST2 modules

41.1. Summary of Module Globals

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

  • PrintVerbose - Same as Print(), 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

List of Global Variables

    41.2. Global Functions

    41.2.1. Abort

    Abort the command line handling

    Return value

    • void

    41.2.2. Aborted

    User asked for abort (forgetting the changes)

    Return value

    • boolean - true, if the user asked abort

    41.2.3. Command

    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.

    41.2.4. Done

    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

    41.2.5. Error

    Print an Error Message

    Function parameters

    • string message

    Return value

    • void

    41.2.6. Init

    Initialize Module

    Function parameters

    • map cmdlineinfo

    • list<any> args

    Return value

    • boolean - true, if there are some commands to be processed

    41.2.7. Interactive

    Is module started in interactive command-line mode?

    Return value

    • boolean - true, if the user asked for interactive command-line mode

    41.2.8. Parse

    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.

    41.2.9. PasswordInput

    Read input from command line

    Function parameters

    • string prompt

    Return value

    • string - Entered string

    41.2.10. Print

    Print a String

    Function parameters

    • string s

    Return value

    • void

    41.2.11. PrintVerbose

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

    Function parameters

    • string s

    Return value

    • void

    41.2.12. Run

    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

    41.2.13. Scan

    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

    41.2.14. StartGUI

    Should module start UI?

    Return value

    • boolean - true, if the user asked for standard UI (no parameter was passed by command line)

    41.2.15. UniqueOption

    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

    41.2.16. UserInput

    Read input from command line

    Function parameters

    • string prompt

    Return value

    • string - Entered string

    41.3. Global Variables

    41.4. Module Requirements

    41.4.1. Module Imports

    • Mode
    • Progress
    • Report
    • RichText
    • RichText
    • Stage
    • String
    • TypeRepository
    • XML

    41.4.2. Module Includes