Update reply to use getopt posix optind format
This changes the handling of optind for the 'reply' command to match recent changes to getopt.
This commit is contained in:
parent
50f25e7c4d
commit
f5a4d935ef
3 changed files with 5 additions and 3 deletions
|
@ -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 (
|
||||
|
|
2
go.mod
2
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
|
||||
|
|
2
go.sum
2
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=
|
||||
|
|
Loading…
Reference in a new issue