Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronChen0 authored Aug 2, 2024
1 parent c486fb1 commit d31c961
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ This will display help for the tool. Here are all the switches it supports.
| `-no-color` | disable colors in output | `notify -nc` |
| `-provider-config` | provider config path | `notify -pc provider.yaml` |
| `-provider` | provider to send the notification to (optional) | `notify -p slack,telegram` |
| `-proxy` | http/socks5 proxy to use with notify | `notify -proxy http://127.0.0.1:8080` |
| `-proxy` | HTTP/SOCKSv5 proxy to use with notify | `notify -proxy http://127.0.0.1:8080` |
| `-rate-limit` | maximum number of HTTP requests to send per second | `notify -rl 1` |
| `-silent` | enable silent mode | `notify -silent` |
| `-verbose` | enable verbose mode | `notify -verbose` |
Expand Down
2 changes: 1 addition & 1 deletion cmd/notify/notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func readConfig() {
set.BoolVarP(&options.Verbose, "verbose", "v", false, "enable verbose mode")
set.BoolVar(&options.Version, "version", false, "display version")
set.BoolVarP(&options.NoColor, "no-color", "nc", false, "disable colors in output")
set.StringVar(&options.Proxy, "proxy", "", "http/socks5 proxy to use with notify")
set.StringVar(&options.Proxy, "proxy", "", "HTTP/SOCKSv5 proxy to use with notify")
set.CallbackVarP(runner.GetUpdateCallback(), "update", "up", "update notify to latest version")
set.BoolVarP(&options.DisableUpdateCheck, "disable-update-check", "duc", false, "disable automatic notify update check")

Expand Down
3 changes: 1 addition & 2 deletions internal/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,9 @@ func (r *Runner) Run() error {
}
}

http.DefaultClient.Transport = defaultTransport
if r.options.RateLimit > 0 {
http.DefaultClient.Transport = utils.NewThrottledTransport(time.Second, r.options.RateLimit, defaultTransport)
} else {
http.DefaultClient.Transport = defaultTransport
}

var inFile *os.File
Expand Down

0 comments on commit d31c961

Please sign in to comment.