Skip to content

Conversation

@denisbrodbeck
Copy link

Adding following flags:

  • -v (verbose)
  • -l (list)
  • -h (help)
  • -t (timeout)
  • -ignoredefault

fixes #180

Adding following flags:

* -v (verbose)
* -l (list)
* -h (help)
* -t (timeout)
* -ignoredefault

fixes #180
@denisbrodbeck
Copy link
Author

Hmm, that travis-ci build is certainly strange.
Go 1.10 + 1.11 are fine, Go 1.9 - 1.7 fail with missing permissions on /tmp/randomfilename.
How should I circumvent such behavior?

@natefinch
Copy link
Member

Thanks very much for this PR! I'll take a look tonight. Not sure what's going on with the test... it's very weird that it works on 1.10+ and not on 1.9- ... I wouldn't think that would change how the permissions on a temp file are created

flag.Parse()
args.Args = flag.Args()
// With golangs flag package we can't distinguish, whether a flag's default value has been:
// * provided by the user or
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, the way to do the defaults to environment variables is that when you declare the default up above, instead of hard coding the default to false, get the environment variable's value, and use that as the default.

@natefinch
Copy link
Member

I am working on some updates to this PR, will push them when they're done, then hopefully the build error will go away.

@natefinch natefinch mentioned this pull request Dec 9, 2018
@natefinch
Copy link
Member

Hope you don't mind, I tweaked it just a bit... removed the ignoredefault flag (it's basically the same as -l). I also made a custom help usage output, because I'm picky. Thanks super much for getting this done, and twice as much for the tests, that's just amazing.

@natefinch
Copy link
Member

merged in #201. Thanks!

@natefinch natefinch closed this Dec 9, 2018
@natefinch
Copy link
Member

BTW, seems like the build problem was that you can't execute files from the temp directory on more closely secured linux environments, which Travis uses. I'm not exactly sure how Go 1.10 changes the behavior, but I saw some issues about it in the go repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add mage flags to the compiled mage binary

2 participants