mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
feat(label): edit a label in a form without flags
label edit without flags on a terminal now opens a form with the label's name, color, description and flags, like milestone edit and issue edit, instead of failing; without a terminal it reports the shared "nothing to edit" error. The help of issue and milestone close and reopen names its commands without generating the text from the verb. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
6 files changed
+143
-8
No files matched your search
@@ -18,11 +18,11 @@ import (
|
||||
// of changing them.
|
||||
func (a *application) milestoneStateCommand(verb string, service milestoneService) *cobra.Command {
|
||||
var byName bool
|
||||
state, past := "closed", "Closed"
|
||||
state, past, short := "closed", "Closed", "Close milestones"
|
||||
if verb == "reopen" {
|
||||
state, past = "open", "Reopened"
|
||||
state, past, short = "open", "Reopened", "Reopen milestones"
|
||||
}
|
||||
cmd := &cobra.Command{Use: verb + " <milestone>...", Short: titleCase(verb) + " milestones", Example: fmt.Sprintf(`$ tea milestone %[1]s v1.0
|
||||
cmd := &cobra.Command{Use: verb + " <milestone>...", Short: short, Example: fmt.Sprintf(`$ tea milestone %[1]s v1.0
|
||||
$ tea milestone %[1]s v1.0 v1.1`, verb), Annotations: map[string]string{"tea.arguments": milestoneArguments}, Args: usageArgs(cobra.MinimumNArgs(1)), RunE: func(cmd *cobra.Command, args []string) error {
|
||||
if slices.ContainsFunc(args, func(arg string) bool { return strings.TrimSpace(arg) == "" }) {
|
||||
return clierr.Wrap(clierr.Usage, errors.New("milestone title or ID cannot be empty"))
|
||||
|
||||
Reference in new issue
Block a user