Let's say I'm running a script at the command line:
coffee ./scripts/doSomeStuff.coffee
where doSomeStuff.coffee looks like:
numberOfTimes = ???
doStuff = (times) ->
while times > 0
console.log('doing stuff')
--times
doStuff(numberOfTimes)
How can I pass in the number of times to do stuff via the command line? --eval seemed like the obvious choice but adding --eval='global.numberOfTimes=5' didn't help.
I can do it with export REPEAT_TIMES=5 from bash but that seems rife with potential side-effects.