Skip to content

Commit 0f75f15

Browse files
committed
improved help and changed CLI interface a bit
1 parent 8c7a7f6 commit 0f75f15

File tree

2 files changed

+59
-13
lines changed

2 files changed

+59
-13
lines changed

core/lib/patternlab.js

Lines changed: 51 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,19 +87,57 @@ var patternlab_engine = function (config) {
8787
console.log(patternlab.package.version);
8888
}
8989

90+
9091
function help() {
91-
console.log('Patternlab Node Help');
92+
93+
console.log('');
94+
95+
console.log('|=======================================|');
96+
plutils.logGreen(' Pattern Lab Node Help v ' + patternlab.package.version);
97+
console.log('|=======================================|');
98+
99+
console.log('');
100+
console.log('Command Line Interface - usually consumed by an edition');
101+
console.log('');
102+
103+
plutils.logGreen(' patternlab:build');
104+
console.log(' > Compiles the patterns and frontend, outputting to config.paths.public');
105+
console.log('');
106+
107+
plutils.logGreen(' patternlab:patternsonly');
108+
console.log(' > Compiles the patterns only, outputting to config.paths.public');
109+
console.log('');
110+
111+
plutils.logGreen(' patternlab:version');
112+
console.log(' > Return the version of patternlab-node you have installed');
113+
console.log('');
114+
115+
plutils.logGreen(' patternlab:help');
116+
console.log(' > Get more information about patternlab-node, pattern lab in general, and where to report issues.');
117+
console.log('');
118+
119+
plutils.logGreen(' patternlab:liststarterkits');
120+
console.log(' > Returns a url with the list of available starterkits hosted on the Pattern Lab organization Github account');
121+
console.log('');
122+
123+
plutils.logGreen(' patternlab:loadstarterkit');
124+
console.log(' > Load a starterkit into config.paths.soource/*');
125+
console.log(' > NOTE: This does overwrite any existing contents, and does not clean the directory first.');
126+
console.log(' > NOTE: In most cases, `npm install starterkit-name` will precede this call.');
127+
console.log(' > arguments:');
128+
console.log(' -- kit ');
129+
console.log(' > the name of the starter kit to load');
130+
console.log(' > example (gulp):');
131+
console.log(' `gulp patternlab:starterkit-load --kit=starterkit-mustache-demo`');
132+
console.log('');
133+
92134
console.log('===============================');
93-
console.log('Command Line Arguments');
94-
console.log('patternlab:only_patterns');
95-
console.log(' > Compiles the patterns only, outputting to config.patterns.public');
96-
console.log('patternlab:v');
97-
console.log(' > Retrieve the version of patternlab-node you have installed');
98-
console.log('patternlab:help');
99-
console.log(' > Get more information about patternlab-node, pattern lab in general, and where to report issues.');
135+
console.log('');
136+
console.log('Visit http://patternlab.io/ for more info about Pattern Lab');
137+
console.log('Visit https://github.com/pattern-lab/patternlab-node/issues to open an issue.');
138+
console.log('Visit https://github.com/pattern-lab/patternlab-node/wiki to view the changelog, roadmap, and other info.');
139+
console.log('');
100140
console.log('===============================');
101-
console.log('Visit http://patternlab.io/docs/index.html for general help on pattern-lab');
102-
console.log('Visit https://github.com/pattern-lab/patternlab-node/issues to open a bug.');
103141
}
104142

105143
function printDebug() {
@@ -321,14 +359,14 @@ var patternlab_engine = function (config) {
321359
help: function () {
322360
help();
323361
},
324-
build_patterns_only: function (deletePatternDir) {
362+
patternsonly: function (deletePatternDir) {
325363
buildPatterns(deletePatternDir);
326364
printDebug();
327365
},
328-
list_starterkits: function () {
366+
liststarterkits: function () {
329367
return listStarterkits();
330368
},
331-
load_starterkit: function (starterkitName) {
369+
loadstarterkit: function (starterkitName) {
332370
loadStarterKit(starterkitName);
333371
}
334372
};

core/lib/utilities.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ var util = {
88
return o;
99
},
1010

11+
logGreen: function (message) {
12+
console.log('\x1b[32m', message, '\x1b[0m');
13+
},
14+
15+
logRed: function (message) {
16+
console.log('\x1b[41m', message, '\x1b[0m');
17+
},
18+
1119
/**
1220
* Recursively merge properties of two objects.
1321
*

0 commit comments

Comments
 (0)