Skip to content

Convert yargs builder function to options object on subcommands #708

Closed

Description

@0x2b3bfa0

Follow-up of #703

The current builder pattern allows different settings of the same option to be sprinkled between the others, and we haven't missed the opportunity to have a few options spread all over the place. We should proabably use a single options object instead.

Editor's picks

🧐 Nonexistent --cloud-gpu-type option, giving us trouble since #362

cml/bin/cml/runner.js

Lines 473 to 476 in 60ff630

.default('cloud-gpu')
.describe('cloud-gpu', 'GPU type.')
.choices('cloud-gpu', ['nogpu', 'k80', 'v100', 'tesla'])
.coerce('cloud-gpu-type', (val) => (val === 'nogpu' ? null : val))

🎲 Random use of implicit .default('option') versus omitting it completely

...with the only difference being {option: undefined} versus {} in the resulting object.

.default('cloud')

🙈 Interleaved builder function calls for different options

.default('file')
.describe(
'file',
'Append the output to the given file. Create it if does not exist.'
)
.describe('rm-watermark', 'Avoid CML watermark.')
.alias('file', 'f');

🚯 Incomplete option definitions with no effect

.default('plugins')

Activity

  1. changed the title [-]Replace yargs builder functions by builder objects on subcommands[/-] [+]Convert yargs builder function to options object on subcommands[/+] on Sep 9, 2021
  2. self-assigned this
    on Sep 9, 2021
  3. added
    enhancement
    technical-debt
    ui/ux
    on Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementtechnical-debtui/ux

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions