aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--commands/patch/unlink.go (renamed from commands/patch/delete.go)18
-rw-r--r--doc/aerc-patch.7.scd9
-rw-r--r--lib/pama/unlink.go (renamed from lib/pama/delete.go)4
3 files changed, 15 insertions, 16 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
}
diff --git a/doc/aerc-patch.7.scd b/doc/aerc-patch.7.scd
index 3196031a..115b203b 100644
--- a/doc/aerc-patch.7.scd
+++ b/doc/aerc-patch.7.scd
@@ -98,14 +98,13 @@ The following *:patch* sub-commands are supported:
*:patch switch* _<project>_
Switches the context to _<project>_.
-*:patch delete* [_<project>_]
- Deletes all patch tracking data for _<project>_. If no project is
- provided, the current project is deleted.
+*:patch unlink* [_<project>_]
+ Deletes all patch tracking data for _<project>_ and unlinks it from
+ a repository. If no project is provided, the current project is deleted.
*:patch*
Root command for path management. Use it to run the sub-commands.
-
# GETTING STARTED
Make sure you have an initialized project (see *:patch init*).
@@ -178,7 +177,7 @@ To drop a patch set, use the tag that was assigned during applying:
And to delete the project data in *aerc*:
```
-:patch delete bar
+:patch unlink bar
```
# SUPPORTED REVISION CONTROL SYSTEMS
diff --git a/lib/pama/delete.go b/lib/pama/unlink.go
index 53dbeeb1..2def5403 100644
--- a/lib/pama/delete.go
+++ b/lib/pama/unlink.go
@@ -6,8 +6,8 @@ import (
"git.sr.ht/~rjarry/aerc/log"
)
-// Delete removes provided project
-func (m PatchManager) Delete(name string) error {
+// Unlink removes provided project
+func (m PatchManager) Unlink(name string) error {
store := m.store()
names, err := m.Names()
if err != nil {