diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-06-09 19:14:04 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-06-09 19:14:04 -0400 |
commit | 57471a0e67feb37aff1ab5aeb3f2712ea327fa55 (patch) | |
tree | c9c63ccdb5416ff5aea36402db0f6df61af18e63 /commands/msg | |
parent | c55223106dc68a330bef4fde55260fb4502eeb4e (diff) | |
download | aerc-57471a0e67feb37aff1ab5aeb3f2712ea327fa55.tar.gz |
Fix :copy arg handling
Diffstat (limited to 'commands/msg')
-rw-r--r-- | commands/msg/copy.go | 6 |
1 files changed, 3 insertions, 3 deletions
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] <folder>") } 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) { |