Open professor opened 5 years ago
Yeah, right now, that's not possible. The way to get around it is to set environment variables, so like
OPTION=foo mage command
There's a feature request for doing automatic arg detection: https://github.com/magefile/mage/issues/24
There's an example in mage's magefile here: https://github.com/magefile/mage/blob/master/magefile.go#L55
But you're right, there should be docs about doing this, since it's a fairly common need.
Was trying to do the same and can across this issue.
I take it the situation hasn't changed?
I was wondering if something as simple as ignoring all command line arguments after the common "--" option and passing them directly to build targets would work? Haven't had a chance to look at the code, so just throwing it out there.
I'm new to go, and I was trying to find an example of a magefile that took in a command line option, e.g. 'mage command OPTION'