diff options
Diffstat (limited to 'commands/patch')
-rw-r--r-- | commands/patch/drop.go (renamed from commands/patch/remove.go) | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/commands/patch/remove.go b/commands/patch/drop.go index 29849e51..06457c72 100644 --- a/commands/patch/remove.go +++ b/commands/patch/drop.go @@ -10,23 +10,23 @@ import ( "git.sr.ht/~rjarry/aerc/log" ) -type Remove struct { +type Drop struct { Tag string `opt:"tag" complete:"CompleteTag"` } func init() { - register(Remove{}) + register(Drop{}) } -func (Remove) Context() commands.CommandContext { +func (Drop) Context() commands.CommandContext { return commands.GLOBAL } -func (Remove) Aliases() []string { - return []string{"remove"} +func (Drop) Aliases() []string { + return []string{"drop"} } -func (*Remove) CompleteTag(arg string) []string { +func (*Drop) CompleteTag(arg string) []string { patches, err := pama.New().CurrentPatches() if err != nil { log.Errorf("failed to get current patches: %v", err) @@ -35,13 +35,13 @@ func (*Remove) CompleteTag(arg string) []string { return commands.FilterList(patches, arg, nil) } -func (r Remove) Execute(args []string) error { +func (r Drop) Execute(args []string) error { patch := r.Tag - err := pama.New().RemovePatch(patch) + err := pama.New().DropPatch(patch) if err != nil { return err } - app.PushStatus(fmt.Sprintf("Patch %s has been removed", patch), + app.PushStatus(fmt.Sprintf("Patch %s has been dropped", patch), 10*time.Second) return nil } |