dojo / cli

:rocket: Dojo - command line tooling.
http://dojo.io
Other
25 stars 34 forks source link

Override yargs help output with custom help renderer #229

Closed agubler closed 6 years ago

agubler commented 6 years ago

Type: feature

The following has been addressed in the PR:

Description:

Handles help output explicitly for the CLI and commands with a custom help renderer. Also needed some significant changes in the way that commands are registered:

Temporarily hard coded create-app to be a global command as it's the "dojo" global external command.

Main CLI help output

1__anthony_red-sky____development_test-beds_dojo-cli

Group CLI help output

1__anthony_red-sky____development_test-beds_dojo-cli

Command CLI help output

1__anthony_red-sky____development_test-beds_dojo-cli

Installable command CLI help output

1__anthony_red-sky____development_test-beds_dojo-cli

Resolves #227
Resolves #228

agubler commented 6 years ago

Am completely open to suggestions to the formatting and colours and also if I've missed anything.

codecov[bot] commented 6 years ago

Codecov Report

Merging #229 into master will decrease coverage by 0.91%. The diff coverage is 95.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #229      +/-   ##
==========================================
- Coverage   95.04%   94.13%   -0.92%     
==========================================
  Files          19       20       +1     
  Lines         525      597      +72     
  Branches       70       95      +25     
==========================================
+ Hits          499      562      +63     
- Misses         13       17       +4     
- Partials       13       18       +5
Impacted Files Coverage Δ
src/commands/version.ts 98.41% <100%> (+0.05%) :arrow_up:
src/commands/init.ts 100% <100%> (ø) :arrow_up:
src/installableCommands.ts 89.36% <100%> (-0.97%) :arrow_down:
src/allCommands.ts 100% <100%> (ø) :arrow_up:
src/loadCommands.ts 100% <100%> (+5.12%) :arrow_up:
src/validation.ts 100% <100%> (ø)
src/index.ts 100% <100%> (ø) :arrow_up:
src/commands/eject.ts 94.33% <100%> (+0.22%) :arrow_up:
src/CommandHelper.ts 90.47% <81.81%> (-9.53%) :arrow_down:
src/command.ts 94.44% <85.71%> (-2.86%) :arrow_down:
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 538eff7...91035f7. Read the comment docs.

agubler commented 6 years ago

Needs more test coverage!

agubler commented 6 years ago

@tomdye I think for now the padding works but I defo want to look at using cli-table for the layout.

agubler commented 6 years ago

Updated CLI output with some extra colour and different ascii art for dojo

Main CLI help output

1__anthony_red-sky____development_test-beds_dojo-cli

Group CLI help output

1__anthony_red-sky____development_test-beds_dojo-cli

Command CLI help output

1__anthony_red-sky____development_test-beds_dojo-cli
agubler commented 6 years ago

@tomdye @rorticus Have changed the output slightly if you could take another look.

rorticus commented 6 years ago

wow that's fancy :)

agubler commented 6 years ago

Art courtesy of @matt-gadd 😄