Skip to content

Commit 0048c2b

Browse files
committed
Merge pull request #200 from exercism/unsubmit-guard
Add a guard to the unsubmit command.
2 parents c802c91 + 6c52599 commit 0048c2b

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ The exercism CLI follows [semantic versioning](http://semver.org/).
66

77
## Next Release
88

9+
* [#200](https://github.com/exercism/cli/pull/200): Add guard to unsubmit command - [@kytrinyx](https://github.com/kytrinyx)
910
* **Your contribution here**
1011

1112
## v2.2.0 (2015-06-27)

cmd/unsubmit.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ import (
99
"github.com/exercism/cli/config"
1010
)
1111

12-
// Unsubmit deletes an iteration from the api.
13-
// If no iteration is specified, the most recent iteration
14-
// is deleted.
12+
// Unsubmit deletes the most recent submission from the API.
1513
func Unsubmit(ctx *cli.Context) {
14+
if len(ctx.Args()) > 0 {
15+
log.Fatal("\nThe unsubmit command does not take any arguments, it deletes the most recent submission.\n\nTo delete a different submission, you'll need to do it from the website.")
16+
}
17+
1618
c, err := config.New(ctx.GlobalString("config"))
1719
if err != nil {
1820
log.Fatal(err)

exercism/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const (
2525
descRestore = "Restores completed and current problems on from exercism.io, along with your most recent iteration for each."
2626
descSubmit = "Submits a new iteration to a problem on exercism.io."
2727
descSkip = "Skips a problem given a language and slug."
28-
descUnsubmit = "Deletes the most recently submitted iteration."
28+
descUnsubmit = "Deletes the most recently submitted solution."
2929
descUpgrade = "Upgrades the CLI to the latest released version."
3030
descTracks = "List the available language tracks"
3131
descOpen = "Opens the current submission of the specified exercise"

0 commit comments

Comments
 (0)