Skip to content

Commit 267782d

Browse files
CLI changes, fixes #64
1 parent fea4f20 commit 267782d

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

lib/cli.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Command line implementation for CSScomb
2+
* Command line implementation for CSSComb
33
*
44
* Usage example:
55
* ./node_modules/.bin/csscomb file1 [dir1 [fileN [dirN]]]
@@ -15,19 +15,22 @@ program
1515
.option('-c, --config [path]', 'configuration file path')
1616
.parse(process.argv);
1717

18-
var comb = new Comb();
18+
if (!program.args.length) {
19+
console.log('No input paths specified');
20+
program.help();
21+
}
22+
1923
var configPath = program.config || (process.cwd() + '/.csscomb.json');
2024

2125
if (fs.existsSync(configPath)) {
26+
var comb = new Comb();
2227
comb.configure(require(configPath));
23-
if (program.args.length > 0) {
24-
vow.all(program.args.map(function(path) {
25-
return comb.processPath(path);
26-
})).fail(function(e) {
27-
console.log('stack: ', e.stack);
28-
process.exit(1);
29-
});
30-
}
28+
vow.all(program.args.map(function(path) {
29+
return comb.processPath(path);
30+
})).fail(function(e) {
31+
console.log('stack: ', e.stack);
32+
process.exit(1);
33+
});
3134
} else {
3235
console.log('Configuration file ' + configPath + ' was not found.');
3336
process.exit(1);

0 commit comments

Comments
 (0)