Skip to content

fix(@angular-devkit/schematics-cli): fix list-schematics is not printing anything #12237

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

Merged
merged 6 commits into from
Sep 18, 2018
Merged

fix(@angular-devkit/schematics-cli): fix list-schematics is not printing anything #12237

merged 6 commits into from
Sep 18, 2018

Conversation

alan-agius4
Copy link
Collaborator

fix list-schematics is not printing anything

Usage:

$  schematics @schematics/angular: --list-schematics
$  schematics --list-schematics

When no colon is specified, it means that that you are passing a schematic name to be looked up in the default collection.

Closes #12220

@@ -36,21 +44,26 @@ function usage(exitCode = 0): never {
Options:
--debug Debug mode. This is true by default if the collection is a relative
path (in that case, turn off with --debug=false).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The console is quite cluttered without break lines

…nting anything

Usage:
```
$  schematics @schematics/angular: --list-schematics
$  schematics --list-schematics
```

When no colon is specified, it means that that you are passing a schematic name to be looked up in the default collection.

Closes #12220
@alan-agius4 alan-agius4 added the target: patch This PR is targeted for the next patch release label Sep 11, 2018
Copy link
Contributor

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

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

no tests?

@alan-agius4 alan-agius4 added target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Sep 14, 2018
@alan-agius4
Copy link
Collaborator Author

@alexeagle I have added a couple of test as previously schematics-cli was not testable. However, in order to do that I had to do a couple of other changes.

alexeagle
alexeagle previously approved these changes Sep 17, 2018
Copy link
Contributor

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

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

cool!

hansl
hansl previously requested changes Sep 17, 2018
Copy link
Contributor

@hansl hansl left a comment

Choose a reason for hiding this comment

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

Sorry to barge in.

/**
* Show usage of the CLI tool, and exit the process.
*/
function usage(exitCode: 1 | 0 = 0): 1 | 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Usage should probably be outside of main, which will bring this function under the size limit for the no-big-function lint rule.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@hansl Updated as requested

@alexeagle
Copy link
Contributor

Dismiss stale review is the wrong thing to do. It throws away an "approved with the following one change".
I think we have a setting somewhere causing this which we should change...

@alan-agius4 alan-agius4 added target: major This PR is targeted for the next major release and removed target: major This PR is targeted for the next major release labels Sep 18, 2018
@hansl hansl merged commit 813c520 into angular:master Sep 18, 2018
@alan-agius4 alan-agius4 deleted the fix_schematic_cli_list branch September 18, 2018 19:40
--force Force overwriting files that would otherwise be an error.

--list-schematics List all schematics from the collection, by name. A collection name
should be suffixed by a colon. Example: '@schematics/schematics:'.
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for this example with the colon! It's not something that would be expected, but this example should allow people to figure it out.

@Splaktar
Copy link
Contributor

Thank you for jumping on this quickly! I'm planning to demonstrate a bit of this functionality for my schematics talk at AngularMix.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

schematics-cli: --list-schematics is broken
5 participants