Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed CLI help display code, and added option to ignore names by regexp. #31

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

adhihargo
Copy link

Hi John,

Here's the modifications I made, in addition to Lachlan's:

  • I changed help display code to use standard "flag" module's facility, to avoid having to update that one "Usage:" line every time there's a new flag.
  • Added a flag to ignore files by regexp pattern; without it rerun also monitors temp files whose name merely prefixed (like emacs'). On malformed regexp, print error and ignore the regexp. I only need to check prefix, but this way maybe it'd be a bit more useful.

rerun.go Outdated
for {
// read event from the watcher
we, _ := <-watcher.Event
// other files in the directory don't count - we watch the whole thing in case new .go files appear.
if filepath.Ext(we.Name) != ".go" {
if fn := filepath.Base(we.Name) ;
(ignoreRe != nil && ignoreRe.FindString(fn) != "") || filepath.Ext(fn) != ".go" {
Copy link
Owner

Choose a reason for hiding this comment

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

please run gofmt - this line doesn't look like what gofmt would come up with.

Copy link
Author

Choose a reason for hiding this comment

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

OK, done in later commit.

@maxnordlund
Copy link

If you add "Fixes #15" to the description/commit message GitHub automatically closes that issue when this is merge.

…elterjohn#15

Some tools create temp files that rerun won't ignore if relying only on extension (e.g. on editing X.go emacs creates .#X.go).
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.

4 participants