# class KCmdLineOptions

###

Module | kdecore
Namespace |
Class | KCmdLineOptions
Inherits |

Class that holds command line options.

This class is intended to be used with the KCmdLineArgs class, which provides convenient and powerful command line argument parsing and handling functionality.

See also KCmdLineArgs for additional usage information

### methods

- KCmdLineOptions ( )

  returns ctor

  Constructor.

- KCmdLineOptions (options)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  options | KCmdLineOptions |

  Copy constructor.

- add (name, description, defaultValue)

  returns KCmdLineOptions

  Argument | Type | Default
  --- | --- | ---
  name | QByteArray |
  description | KLocalizedString | KLocalizedString()
  defaultValue | QByteArray | QByteArray()

  Add command line option, by providing its name, description, and possibly a default value. These will print out when myapp --help is called on the command line.

  Note that if the option name begins with "no" that you will need to test for the name without the "no" and the result will be the inverse of what is specified. i.e. if "nofoo" is the name of the option and myapp --nofoo is called:

      KCmdLineArgs.parsedArgs()->isSet("foo"); // false

  name - option name

  description - option description, made available for translation; can be left off

  defaultValue - default option value, when the value is not specified on the command line; can be left off

- add (options)

  returns KCmdLineOptions

  Argument | Type | Default
  --- | --- | ---
  options | KCmdLineOptions |

  Add all options from another KCmdLineOptions object.

  options - options to add