Skip to content

Fix for help message to be more accurate, also fixes #19 #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 30 additions & 10 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const tachyonsBuildCss = require('tachyons-build-css')

const cli = meow(`
Usage
$ tachyons <input.css>
$ tachyons <input.css> [options]

Options
-m, --minify Minify the output stylesheet
Expand All @@ -31,21 +31,42 @@ const cli = meow(`

Example
$ tachyons src/tachyons.css > dist/c.css
$ tachyons src/tachyons.css > dist/c.css --minify
$ tachyons src/tachyons.css > dist/c.repeated.css --repeat
$ tachyons src/tachyons.css --minify > dist/c.css
$ tachyons src/tachyons.css --repeat > dist/c.repeated.css
$ tachyons src/tachyons-type-scale.css --generate-docs --package=./package.json > readme.md
$ tachyons --new=my-new-project
`, {
alias: {
m: 'minify',
r: 'repeat',
a: 'authors',
n: 'new'
flags: {
minify: {
type: 'boolean',
alias: 'm'
},
repeat: {
type: 'boolean',
alias: 'r'
},
authors: {
type: 'boolean',
alias: 'a'
},
'new': {
type: 'boolean',
alias: 'n'
},
rtl: {
type: 'boolean',
},
'generate-docs': {
type: 'boolean',
},
'package': {
type: 'boolean',
alias: 'r'
}
}
})

const inputFile = cli.input[0]
const outputFile = cli.input[1]

if (cli.flags.new) {
console.log('Generating a new Tachyons project')
Expand Down Expand Up @@ -82,7 +103,6 @@ if (isBlank(inputFile)) {
const input = fs.readFileSync(inputFile, 'utf8')
tachyonsBuildCss(input, {
from: inputFile,
to: outputFile,
rtl: cli.flags.rtl,
minify: cli.flags.minify,
repeat: cli.flags.repeat
Expand Down