aboutsummaryrefslogtreecommitdiffstats
path: root/commands/patch
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2024-01-31 17:23:00 +0100
committerRobin Jarry <robin@jarry.cc>2024-01-31 21:57:28 +0100
commit4cc2e6be3a010ecfba314909ce9b594f04e1be0e (patch)
treee22c025e90e79dbe21843bb5e5a2ccbfaab5ae31 /commands/patch
parent29ee43aceb7cdd5e28c71c133c9c97ec1f98f8a6 (diff)
downloadaerc-4cc2e6be3a010ecfba314909ce9b594f04e1be0e.tar.gz
commands: rename patch delete to patch unlink
Rename the command :patch delete to :patch unlink. This expresses the "link" between the project data within aerc and the underlying repository better. :patch unlink does not delete anything in the repository, it only removes the metadata about currently applied patch revisions/tags. 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/unlink.go (renamed from commands/patch/delete.go)18
1 files changed, 9 insertions, 9 deletions
diff --git a/commands/patch/delete.go b/commands/patch/unlink.go
index 24351f7c..4a78281e 100644
--- a/commands/patch/delete.go
+++ b/commands/patch/unlink.go
@@ -10,23 +10,23 @@ import (
"git.sr.ht/~rjarry/aerc/log"
)
-type Delete struct {
+type Unlink struct {
Tag string `opt:"tag" required:"false" complete:"Complete"`
}
func init() {
- register(Delete{})
+ register(Unlink{})
}
-func (Delete) Context() commands.CommandContext {
+func (Unlink) Context() commands.CommandContext {
return commands.GLOBAL
}
-func (Delete) Aliases() []string {
- return []string{"delete"}
+func (Unlink) Aliases() []string {
+ return []string{"unlink"}
}
-func (*Delete) Complete(arg string) []string {
+func (*Unlink) Complete(arg string) []string {
names, err := pama.New().Names()
if err != nil {
log.Errorf("failed to get completion: %v", err)
@@ -35,7 +35,7 @@ func (*Delete) Complete(arg string) []string {
return commands.FilterList(names, arg, nil)
}
-func (d Delete) Execute(args []string) error {
+func (d Unlink) Execute(args []string) error {
m := pama.New()
name := d.Tag
@@ -47,12 +47,12 @@ func (d Delete) Execute(args []string) error {
name = p.Name
}
- err := m.Delete(name)
+ err := m.Unlink(name)
if err != nil {
return err
}
- app.PushStatus(fmt.Sprintf("Project '%s' deleted.", name),
+ app.PushStatus(fmt.Sprintf("Project '%s' unlinked.", name),
10*time.Second)
return nil
}