go-godo / godo

golang build tool in the spirt of rake, gulp
MIT License
535 stars 31 forks source link

Set the env to value during the execution of the godo command #17

Closed toritori0318 closed 9 years ago

toritori0318 commented 9 years ago

Hello. I tried to implement pass the ENV from the command line.

See below. (name=value option) http://docs.seattlerb.org/rake/doc/command_line_usage_rdoc.html

example

godo hello USER=someone

(output)
Hello someone!
hello 13ms
mgutz commented 9 years ago

I'm thinking about this one. I can see how this would be helpful on Windows. I plan on porting https://github.com/substack/minimist to golang which would allow retrieving arbitrary args like this without having to declare flags

p.Task("hello", func (c *Context) {
    user := c.Args.MustString("USER")
})

However, Rake is battle tested and there's probably a good reason they did it that way.

toritori0318 commented 9 years ago

That sounds nice! I take the liberty of closing this request.