Commit c5746445 authored by Leo Iannacone's avatar Leo Iannacone

better style code

parent 63211b43
#jshint multistr: true
path = require('path')
Parser = ->
args = process.argv.slice(2)
args = process.argv[2..]
help = ->
console.log "Usage: %s [-c config]\n -h print this help \n -c set user configuration file", process.argv[1].split("/").pop()
console.log """
Usage: %s [-c config]
-h print this help
-c set user configuration file
""", process.argv[1].split("/").pop()
process.exit 0
return
@getUserConfig = ->
configFile = null
args.forEach (val, index) ->
if val is "-c"
configFile = args[index + 1]
return
if '-c' in args
if args.length < 2
help()
return args[args.indexOf('-c') + 1]
return null
if configFile
process.cwd() + "/" + configFile
else
null
args.forEach (val, index) ->
help() if val is "-h"
return
if '-h' in args
help()
return
"use strict"
module.exports = Parser
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment