# dmd.cli

Defines the help texts for the CLI options offered by DMD.

#### Discussion

This file is not shared with other compilers which use the DMD front-end. However, this file will be used to generate the online documentation and MAN pages.

#### Authors

Walter Bright

#### License

Boost License 1.0

Source: cli.d

Documentation: https://dlang.org/phobos/dmd_cli.html

Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/cli.d

- `TargetOS`

  #### Declaration

  `enum `TargetOS`: int;`

  Bit decoding of the `TargetOS`

- `isCurrentTargetOS`

  #### Declaration

  `bool `isCurrentTargetOS`(TargetOS `os`);`

  Checks whether ``os`` is the current . For `TargetOS.all` it will always return `true`.

  #### Parameters

  `TargetOS `os`` | to check

  #### Return Value

  `true` iff ``os`` contains the current targetOS.

- `capitalize`

  #### Declaration

  `static string `capitalize`(string `w`);`

  Capitalize a the first character of a ASCII string.

  #### Parameters

  `string `w`` | ASCII i string to `capitalize`

  #### Return Value

  capitalized string

- `Usage`

  #### Declaration

  `struct `Usage`;`

  Contains all available CLI s.

  #### See Also

  - `Option`

    #### Declaration

    `struct `Option`;`

    Representation of a CLI ``Option``

    #### Discussion

    The DDoc description `ddoxText` is only available when compiled with `-version=DdocOptions`.

    - `flag`

      #### Declaration

      `string `flag`;`

      The CLI `flag` without leading `-`, e.g. `color`

    - `helpText`

      #### Declaration

      `string `helpText`;`

      A detailed description of the flag

    - `os`

      #### Declaration

      `TargetOS `os`;`

      For which `TargetOS` the flags are applicable

    - `this`

      #### Declaration

      `this(string `flag`, string `helpText`, TargetOS `os` = TargetOS.all);
      this(string `flag`, string `helpText`, string `ddocText`, TargetOS `os` = TargetOS.all);`

      #### Parameters

      `string `flag`` | CLI `flag` without leading `-`, e.g. `color`
      `string `helpText`` | detailed description of the `flag`
      `TargetOS `os`` | for which `TargetOS` the flags are applicable
      `string `ddocText`` | detailed description of the `flag` (in Ddoc)

  - `options`

    #### Declaration

    `static immutable Option[] `options`;`

    Returns all available CLI `options`

  - `Feature`

    #### Declaration

    `struct `Feature`;`

    Representation of a CLI feature

    - `name`

      #### Declaration

      `string `name`;`

      `name` of the feature

    - `deprecated_`

      #### Declaration

      `bool `deprecated_`;`

      whether the feature is still in use

  - `transitions`

    #### Declaration

    `static immutable Feature[] `transitions`;`

    Returns all available `transitions`

  - `reverts`

    #### Declaration

    `static immutable Feature[] `reverts`;`

    Returns all available `reverts`

  - `previews`

    #### Declaration

    `static immutable Feature[] `previews`;`

    Returns all available `previews`

- `CLIUsage`

  #### Declaration

  `struct `CLIUsage`;`

  Formats the `Options` for CLI printing.

  - `usage`

    #### Declaration

    `static string `usage`();`

    Returns a string of all available CLI options for the current targetOS. Options are separated by newlines.

  - `mcpuUsage`

    #### Declaration

    `enum string `mcpuUsage`;`

    CPU architectures supported -mcpu=id

  - `transitionUsage`

    #### Declaration

    `enum string `transitionUsage`;`

    Language changes listed by -transition=id

  - `revertUsage`

    #### Declaration

    `enum string `revertUsage`;`

    Language changes listed by -revert

  - `previewUsage`

    #### Declaration

    `enum string `previewUsage`;`

    Language previews listed by -preview

  - `checkActionUsage`

    #### Declaration

    `enum string `checkActionUsage`;`

    Options supported by -checkaction=

  - `checkUsage`

    #### Declaration

    `enum string `checkUsage`;`

    Options supported by -check

  - `externStdUsage`

    #### Declaration

    `enum string `externStdUsage`;`

    Options supported by -extern-std

  - `hcUsage`

    #### Declaration

    `enum string `hcUsage`;`

    Options supported by -HC