Skip to content

use objects instead of arrays in cli config #37

@jaeh

Description

@jaeh
const cliArgs = {
  options: [
    ['--arg1', '--a1'],
    ['--arg2', '--a2'],
  ],
  commands: [['cmd1', 'c1'] ['cmd2', 'c2']],
}

turns into:

const cliArgs = {
  options: {
    '--arg1': { alias: '--a1' },
    '--arg2': { alias: '--a2', }
  ],
  commands: {
    cmd1: { alias: 'c1', options: ['--c1arg1'] }, 
    cmd2: { alias: 'c2' },
  },
}

commands.cmd1.options is interesting here,
every command basically could turn into a separate cli,
including: help, default, required, options, subcommands.

once this change is implemented and the parsing works,
clis of arbitrary complexity will be configurable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions