usage: separate commands and options
This change separates command and option flags in the usage by replacing
`flag.PrintDefaults()` with `text/tabwriter` and flag lookups iterating
over command and option flags.
This change moves -l and -h into commands. With this, both option and
commands have `-h` with different descriptions.
* meta: Ignore Goland project files
* Add `-compile` flag to compile a static binary
This commit adds a new flag, `-compile`, which takes the argument of the
path to which to compile a static binary, but not execute it. This is
useful if you wish to run tasks on a machine which does not have Go
available.
* Add documentation for the -compile flag
* Imply `-force` with `-compile`
This change adds `sanitizeSynopsis()` function to perform basic
sanitization on the synopsis. If synopsis begins with the function name, it
removes the function to avoid repeating words.
* Avoid name conflicts with magefiles
Previously, the generated mage_output_file contained a few helper functions and variables.
However, these had the potential to conflict with names of things in someone's magefile.
Now, all those names are safely stowed away inside func main, so there can be no conflict.
* goos does not work that way
* Enable bootstrap build
Added a bootstrap.go file that can be used with go run to install mage even if you don't
have mage intalled.
Update readme and main website page with better install directions
* * Removed stale type declarations in parse.
* Updated parse and mg to make better use of types package.
* Added function to types package to test for valid function.
* Added function to to types package to wrap a valid FuncType as the
* most greedy of FuncType
* renamed IsFuncType and refactored to return error instead of bool. Made the return value of FuncTypeWrap more clear.
* removed unused type func declarations
We now create the context in the mainfile, so as to remove any dependency on
the mg library, since the user may have an older version vendored, that doesn't
have the Context function.
ALso added a test to ensure that we don't import any non-stdlib libraries in the
mainfile to avoid problems like this in the future.
* Add mg.Target
This function allows specifying files/directories as targets and returns true when the targets are met and false otherwise.
Targets are met if the ModTime of src is older than any ModTime of any of the specified targets.
For recursive checks of directory with its file contents set recusive argument to true
* Librarify mage
We can now use mage as a pure library, not just as a main function.
This makes test easier in many ways and opens up new ways to use mage.