aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClayton Craft <clayton@craftyguy.net>2019-06-08 11:57:56 -0700
committerDrew DeVault <sir@cmpwn.com>2019-06-09 15:50:50 -0400
commitf5a4d935ef26ee7e7c0e4cabd840a759c6b132bf (patch)
tree78e3924714f523fbffafa8f94ff173cd4fb7da71
parent50f25e7c4deecebcd42a07263a3cd50432c6db15 (diff)
Update reply to use getopt posix optind format
This changes the handling of optind for the 'reply' command to match recent changes to getopt.
-rw-r--r--commands/msg/reply.go4
-rw-r--r--go.mod2
-rw-r--r--go.sum2
3 files changed, 5 insertions, 3 deletions
diff --git a/commands/msg/reply.go b/commands/msg/reply.go
index a9ae5a1..51f6584 100644
--- a/commands/msg/reply.go
+++ b/commands/msg/reply.go
@@ -24,11 +24,11 @@ func init() {
}
func Reply(aerc *widgets.Aerc, args []string) error {
- opts, optind, err := getopt.Getopts(args[1:], "aq")
+ opts, optind, err := getopt.Getopts(args, "aq")
if err != nil {
return err
}
- if optind != len(args)-1 {
+ if optind != len(args) {
return errors.New("Usage: reply [-aq]")
}
var (
diff --git a/go.mod b/go.mod
index a6c706b..b960fd6 100644
--- a/go.mod
+++ b/go.mod
@@ -1,7 +1,7 @@
module git.sr.ht/~sircmpwn/aerc
require (
- git.sr.ht/~sircmpwn/getopt v0.0.0-20190214165041-9a4f886f9fc7
+ git.sr.ht/~sircmpwn/getopt v0.0.0-20190609193657-e7e23d1cd3a3
git.sr.ht/~sircmpwn/pty v0.0.0-20190330154901-3a43678975a9
github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964
github.com/davecgh/go-spew v1.1.1 // indirect
diff --git a/go.sum b/go.sum
index 5f6564c..b48ab47 100644
--- a/go.sum
+++ b/go.sum
@@ -1,5 +1,7 @@
git.sr.ht/~sircmpwn/getopt v0.0.0-20190214165041-9a4f886f9fc7 h1:xTFH5S/3ltiRvAtETLLDFWm5nVIouT5GeCPHm8UaVEU=
git.sr.ht/~sircmpwn/getopt v0.0.0-20190214165041-9a4f886f9fc7/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw=
+git.sr.ht/~sircmpwn/getopt v0.0.0-20190609193657-e7e23d1cd3a3 h1:2l17fmuVbiS2cSx1m8e8GbikDUjAT5lril3/+XQsZAs=
+git.sr.ht/~sircmpwn/getopt v0.0.0-20190609193657-e7e23d1cd3a3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw=
git.sr.ht/~sircmpwn/pty v0.0.0-20190330154901-3a43678975a9 h1:WWPN5lf6KzXp3xWRrPQZ4MLR3yrFEI4Ysz7HSQ1G/yo=
git.sr.ht/~sircmpwn/pty v0.0.0-20190330154901-3a43678975a9/go.mod h1:8Jmcax8M9nYoEwBhVBhv2ixLRCoUqlbQPE95VpPu43I=
git.sr.ht/~sircmpwn/tcell v0.0.0-20190602140719-d1981101c4c8 h1:FGePvymuUbWeTDZpd26O+XSLPP8/u6mjkIiUHbw88lQ=