Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Arg

Hierarchy

  • Arg

Index

Constructors

constructor

  • new Arg(): Arg

Properties

Private _log

_log: Debug = new Debug('arg')

options

options: OptionDefinition[] = [{ name: 'help', alias: 'h' }]

Methods

addOption

  • addOption(option: OptionDefinition): void
  • 追加一个命令行解析

    Parameters

    • option: OptionDefinition

      commandLineArgs.OptionDefinition

    Returns void

appendOptions

  • appendOptions(options: OptionDefinition[]): void
  • 追加一组命令行解析

    Parameters

    • options: OptionDefinition[]

      commandLineArgs.OptionDefinition[]

    Returns void

formatOptions

  • formatOptions(options: OptionDefinition[], argv: string[]): any
  • 转换 process.argv

    Parameters

    • options: OptionDefinition[]

      commandLineArgs.OptionDefinition[]

    • argv: string[]

      string[]

    Returns any

getArgvs

  • getArgvs(): any
  • 获取命令行参数结果

    Returns any

Generated using TypeDoc