Fix :move command's arg parsing
This commit is contained in:
parent
702ad43bd2
commit
c55223106d
|
@ -17,11 +17,11 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func Move(aerc *widgets.Aerc, args []string) error {
|
func Move(aerc *widgets.Aerc, args []string) error {
|
||||||
opts, optind, err := getopt.Getopts(args[1:], "p")
|
opts, optind, err := getopt.Getopts(args, "p")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if optind != len(args)-2 {
|
if optind != len(args)-1 {
|
||||||
return errors.New("Usage: mv [-p] <folder>")
|
return errors.New("Usage: mv [-p] <folder>")
|
||||||
}
|
}
|
||||||
var (
|
var (
|
||||||
|
@ -46,7 +46,7 @@ func Move(aerc *widgets.Aerc, args []string) error {
|
||||||
aerc.RemoveTab(widget)
|
aerc.RemoveTab(widget)
|
||||||
}
|
}
|
||||||
acct.Messages().Next()
|
acct.Messages().Next()
|
||||||
store.Move([]uint32{msg.Uid}, args[optind+1], createParents, func(
|
store.Move([]uint32{msg.Uid}, args[optind], createParents, func(
|
||||||
msg types.WorkerMessage) {
|
msg types.WorkerMessage) {
|
||||||
|
|
||||||
switch msg := msg.(type) {
|
switch msg := msg.(type) {
|
||||||
|
|
Loading…
Reference in New Issue