Skip to content

Commit b4764e1

Browse files
committed
Use options
1 parent 42babf7 commit b4764e1

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

bin/documentation.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ if (argv._.length > 0) {
2929
transform = p.browserify.transform;
3030
}
3131
} catch (e) {
32-
yargs.showHelp();
32+
args.showHelp();
3333
throw new Error('documentation was given no files and was not run in a module directory');
3434
}
3535
}
3636

3737
if (!documentation.formats[argv.f]) {
38-
yargs.showHelp();
38+
args.showHelp();
3939
throw new Error('Formatter not found');
4040
}
4141

@@ -48,7 +48,7 @@ var formatterOptions = {
4848
var formatter = documentation.formats[argv.f];
4949

5050
if (argv.f === 'html' && argv.o === 'stdout') {
51-
yargs.showHelp();
51+
args.showHelp();
5252
throw new Error('The HTML output mode requires a destination directory set with -o');
5353
}
5454

lib/args.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
var args = require('yargs')
22
.usage('Usage: $0 <command> [options]')
33

4-
.alias('f', 'format')
5-
.default('f', 'json')
6-
.describe('f', 'output format, of [json, md, html]')
4+
.option('f', {
5+
alias: 'format',
6+
default: 'json',
7+
choices: ['json', 'md', 'html']
8+
})
79

810
.describe('lint', 'check output for common style and uniformity mistakes')
911

0 commit comments

Comments
 (0)