-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6287b3
commit b16704a
Showing
4 changed files
with
27 additions
and
11 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,38 @@ | ||
#!/usr/bin/env node | ||
|
||
const meow = require('meow') | ||
const chalk = require('chalk') | ||
const lissie = require('./lissie') | ||
|
||
const cli = meow(` | ||
Usage | ||
$ lissie <license> | ||
`) | ||
$ license <license> | ||
Options | ||
--author, -a | ||
--year, -y | ||
Examples | ||
$ license | ||
$ license mit | ||
$ license mit -a "Zach Orlovsky" | ||
`, { | ||
alias: { | ||
a: 'author', | ||
y: 'year' | ||
} | ||
}) | ||
|
||
const highlight = text => text.replace( | ||
/\{year\}|\{author\}|\{project\}|\{email\}/gi, | ||
matched => chalk.black.bgYellow(matched) | ||
) | ||
|
||
lissie(cli.input[0] || 'mit') | ||
lissie({ | ||
license: cli.input[0] || 'mit', | ||
author: cli.flags.author, | ||
year: cli.flags.year | ||
}) | ||
.then(highlight) | ||
.then(text => console.log(text)) | ||
.catch(({ message }) => console.log(message)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters