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/remove.go | |
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/remove.go')
-rw-r--r-- | commands/patch/remove.go | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/commands/patch/remove.go b/commands/patch/remove.go deleted file mode 100644 index 29849e51..00000000 --- a/commands/patch/remove.go +++ /dev/null @@ -1,47 +0,0 @@ -package patch - -import ( - "fmt" - "time" - - "git.sr.ht/~rjarry/aerc/app" - "git.sr.ht/~rjarry/aerc/commands" - "git.sr.ht/~rjarry/aerc/lib/pama" - "git.sr.ht/~rjarry/aerc/log" -) - -type Remove struct { - Tag string `opt:"tag" complete:"CompleteTag"` -} - -func init() { - register(Remove{}) -} - -func (Remove) Context() commands.CommandContext { - return commands.GLOBAL -} - -func (Remove) Aliases() []string { - return []string{"remove"} -} - -func (*Remove) CompleteTag(arg string) []string { - patches, err := pama.New().CurrentPatches() - if err != nil { - log.Errorf("failed to get current patches: %v", err) - return nil - } - return commands.FilterList(patches, arg, nil) -} - -func (r Remove) Execute(args []string) error { - patch := r.Tag - err := pama.New().RemovePatch(patch) - if err != nil { - return err - } - app.PushStatus(fmt.Sprintf("Patch %s has been removed", patch), - 10*time.Second) - return nil -} |