Skip to content

Commit 139c3b8

Browse files
committed
Added basic detect cli option (single file ATM)
1 parent e84720c commit 139c3b8

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

lib/cli.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ program
1414
.usage('[options] <file ...>')
1515
.option('-v, --verbose', 'verbose mode')
1616
.option('-c, --config [path]', 'configuration file path')
17+
.option('-d, --detect', 'detect mode (would return detected options)')
1718
.option('-l, --lint', 'in case some fixes needed returns an error')
1819
.parse(process.argv);
1920

@@ -24,6 +25,13 @@ if (!program.args.length) {
2425

2526
var configPath = program.config || (process.cwd() + '/.csscomb.json');
2627

28+
if (program.detect) {
29+
var comb = new Comb();
30+
comb.detect();
31+
console.log(JSON.stringify(comb.processFile(program.args[0]), false, 4));
32+
process.exit(0);
33+
}
34+
2735
if (fs.existsSync(configPath)) {
2836
var comb;
2937
var config;

0 commit comments

Comments
 (0)