Permalink
Browse files

opt key/val on same line for .wr files, fixes #3

  • Loading branch information...
1 parent 9eb1f12 commit 9a69078dbcc7f34149dcc447a720a23169e85e66 @pmuellr committed Jan 10, 2012
Showing with 18 additions and 2 deletions.
  1. +1 −2 .wr
  2. +17 −0 lib/command.coffee
View
3 .wr
@@ -7,8 +7,7 @@
#-----------------------------------------------------
--verbose
---chime
-1
+--chime 1
#-----------------------------------------------------
# command to run
View
@@ -83,6 +83,15 @@ exports.run = ->
{ verbose, chime } = argv
opts = {verbose, chime, logError, logSuccess, logInfo}
+ ###
+ console.log """
+ verbose: #{verbose}
+ chime: #{chime}
+ cmd: #{cmd}
+ files: #{JSON.stringify(files)}
+ """
+ ###
+
wr.run cmd, files, opts
#-------------------------------------------------------------------------------
@@ -104,6 +113,14 @@ getDotWrContents = () ->
line = line.replace(/(^\s+)|(\s+$)/g,'')
continue if line == ''
+ if line[0] == '-'
+ pattern = /(\S*)(\s*(.*))/
+ groups = line.match(pattern)
+ if groups[3] != ''
+ args.push groups[1]
+ args.push groups[3]
+ continue
+
args.push line
args

0 comments on commit 9a69078

Please sign in to comment.