Skip to content

Commit

Permalink
add config files (fixes #1)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgentle committed Aug 4, 2015
1 parent 4ddb1dc commit be57f81
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 8 additions & 1 deletion caniuse.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ data = require 'caniuse-db/data.json'
colors = require 'colors'
linewrap = require 'linewrap'
open = require 'open'
path = require 'path'
osHomedir = require 'os-homedir'

argv = require 'yargs'
.option 'short',
Expand Down Expand Up @@ -67,7 +69,12 @@ argv = require 'yargs'
type: 'boolean'
default: false
describe: "Go to the search page on caniuse.com"

.option 'config',
alias: 'C'
type: 'string'
default: path.join(osHomedir(), '.caniuse.json')
describe: "Specify a config file with default options"
.config 'config'
.help 'help'
.argv

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"colors": "^1.0.3",
"linewrap": "^0.2.1",
"open": "0.0.5",
"yargs": "~3.5.4"
"os-homedir": "^1.0.1",
"yargs": "git+https://github.com/sgentle/yargs.git#config-booleans"
},
"devDependencies": {
"mocha": "^2.2.1"
Expand Down

0 comments on commit be57f81

Please sign in to comment.