diff options
author | Koni Marti <koni.marti@gmail.com> | 2024-01-31 16:49:28 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2024-01-31 16:54:31 +0100 |
commit | b285b894c3de7299452e860fc060b673af279261 (patch) | |
tree | d3f834db15ffe749708d734c0b6cd0645de7aabf /commands/patch | |
parent | f16b33f752bbc3086d08ba8fde034de48ab1c6d6 (diff) | |
download | aerc-b285b894c3de7299452e860fc060b673af279261.tar.gz |
commands: rename patch remove to patch drop
Rename the :patch remove command to :patch drop to better express the
this operation is the counter-part to :patch apply.
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
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 } |