Skip to content

Commit

Permalink
Add support for why links and notes
Browse files Browse the repository at this point in the history
*   Add support for `-w`, `--why` alex(1) flag.

Note that not all patterns have a description currently.

Closes GH-19.
  • Loading branch information
wooorm committed Sep 13, 2015
1 parent 841ff69 commit e3b8884
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ notifier({

var cli = meow({
'help': [
'Usage: alex [<file> ...]',
'Usage: alex [<file> ...] [-w, --why]',
'',
'Options:',
'',
' -w, --why output more info regarding why things might be ' +
'offensive',
'',
'When no input files are given, searches for markdown and text',
'files in the current directory, `doc`, and `docs`.',
Expand All @@ -64,6 +69,7 @@ var cli = meow({

var exit = 0;
var result = [];
var why = Boolean(cli.flags.w || cli.flags.why);
var input = cli.input.length ? cli.input : [
'{docs/**/,doc/**/,}*.{md,markdown,mkd,mkdn,mkdown,ron,txt,text}'
];
Expand All @@ -73,7 +79,9 @@ var input = cli.input.length ? cli.input : [
*/

process.on('exit', function () {
console.log(format(result));
console.log(format(result, {
'verbose': why
}));

process.exit(exit);
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"test": "npm run test-api",
"lint-api": "eslint .",
"lint-style": "jscs --reporter inline .",
"lint-text": "./cli.js *.md !example.md",
"lint-text": "./cli.js *.md !example.md --why",
"lint": "npm run lint-api && npm run lint-style && npm run lint-text",
"make": "npm run lint && npm run test-coverage",
"bundle": "browserify index.js -s alex > alex.js",
Expand Down

0 comments on commit e3b8884

Please sign in to comment.