From 57471a0e67feb37aff1ab5aeb3f2712ea327fa55 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 9 Jun 2019 19:14:04 -0400 Subject: Fix :copy arg handling --- commands/msg/copy.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'commands/msg') diff --git a/commands/msg/copy.go b/commands/msg/copy.go index f862548..0735e98 100644 --- a/commands/msg/copy.go +++ b/commands/msg/copy.go @@ -17,11 +17,11 @@ func init() { } func Copy(aerc *widgets.Aerc, args []string) error { - opts, optind, err := getopt.Getopts(args[1:], "p") + opts, optind, err := getopt.Getopts(args, "p") if err != nil { return err } - if optind != len(args)-2 { + if optind != len(args)-1 { return errors.New("Usage: cp [-p] ") } var ( @@ -37,7 +37,7 @@ func Copy(aerc *widgets.Aerc, args []string) error { widget := aerc.SelectedTab().(widgets.ProvidesMessage) msg := widget.SelectedMessage() store := widget.Store() - store.Copy([]uint32{msg.Uid}, args[optind+1], createParents, func( + store.Copy([]uint32{msg.Uid}, args[optind], createParents, func( msg types.WorkerMessage) { switch msg := msg.(type) { -- cgit 1.4.1-2-gfad0