Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(schematics): Generate --help for every CLI function. #417

Closed
wants to merge 1 commit into from

Conversation

mrmeku
Copy link
Contributor

@mrmeku mrmeku commented Apr 11, 2018

This PR introduces the yargs package as our CLI command handler.
We build up commands using yargs to take advantage of its built
in --help flag formatter.

@mrmeku mrmeku requested review from vsavkin and jschwarty April 11, 2018 16:31
@mrmeku mrmeku force-pushed the help branch 2 times, most recently from f01ce09 to 0655f5d Compare April 11, 2018 23:24
Copy link
Contributor

@jschwarty jschwarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This help documentation is awesome! Thanks for adding this. Made a few quick comments (some spelling/grammar things, a couple of suggestions).

.alias('update', 'migrates') // TODO: Remove after 1.0
.command(
'lint [files..]',
'Line workspace or set of files',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be "Lint workspace or...:" instead of "Line"?

'-- files="<file,list>"',
'Targets a comma delimited list of files'
)
.command('-- --uncommitted', 'Targets uncommited changes')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uncommitted spelling in description

.command(
'<action> -- files="<file,list>"',
'Targets a comma delimited list of files'
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The files example wraps in my terminal (not sure if that is something you can adjust or not...)

Commands:
  nx affected <action> -- <SHA1 SHA2>       Targets within a range of SHAs
  nx affected <action> --                   Targets a comma delimited list of
  files="<file,list>"                       files
  nx affected <action> -- --uncommitted     Targets uncommited changes
  nx affected <action> -- --untracked       Targets untracked changes
  nx affected dep-graph                     Generate a graph showing links
                                            between targets

.command(
// TODO: delete this after 1.0
'update <check|skip>',
'Migrate to the latest version of NX',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lower case x for Nx

format(args);
}
)
.command(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want to move away from using the migrate terminology. So maybe update the terms in the descriptions in here to be update, updates instead of migrate, migrations.

.demandCommand()
.demand('file')
.demand('output')
.choices('output', [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be some documentation for using this?

)
.command(
'workspace-schematic <name>',
'Generate a schematic `ng g <name>`',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a bit more descriptive for this line?:

Generate a custom schematic that can be run via `ng g <name>`

@mrmeku mrmeku force-pushed the help branch 6 times, most recently from 1b2b920 to 3e7ba25 Compare April 12, 2018 21:07
This PR introduces the yargs package as our CLI command handler.
We build up commands using yargs to take advantage of its built
in --help flag formatter.
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants