feat: rename create and delete commands to add and del

This commit is contained in:
2026-03-29 19:46:43 +02:00
parent 68f4b67283
commit 535626d198
5 changed files with 23 additions and 23 deletions

View File

@@ -16,8 +16,8 @@ import (
var cDue, cContent string
var cTags, cRels []string
var createCmd = &cobra.Command{
Use: "create <title>", Short: "Create a new node", Args: cobra.ExactArgs(1),
var addCmd = &cobra.Command{
Use: "add <title>", Short: "Create a new node", Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
d, err := db.GetDB()
if err != nil {
@@ -59,10 +59,10 @@ var createCmd = &cobra.Command{
}
func init() {
rootCmd.AddCommand(createCmd)
addPropertyFlags(createCmd)
createCmd.Flags().Set("type", "issue")
f := createCmd.Flags()
rootCmd.AddCommand(addCmd)
addPropertyFlags(addCmd)
addCmd.Flags().Set("type", "issue")
f := addCmd.Flags()
f.StringVar(&cDue, "due", "", "")
f.StringVar(&cContent, "content", "", "")
f.StringArrayVar(&cTags, "tag", nil, "")

View File

@@ -38,8 +38,8 @@ var aliasCmd = &cobra.Command{
},
}
var aliasDeleteCmd = &cobra.Command{
Use: "delete <name>", Short: "Delete an alias", Args: cobra.ExactArgs(1),
var aliasDelCmd = &cobra.Command{
Use: "del <name>", Short: "Delete an alias", Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
if err := cfg.DeleteAlias(args[0]); err != nil {
fmt.Fprintln(os.Stderr, err)
@@ -51,6 +51,6 @@ var aliasDeleteCmd = &cobra.Command{
func init() {
rootCmd.AddCommand(aliasCmd)
aliasCmd.AddCommand(aliasDeleteCmd)
aliasCmd.AddCommand(aliasDelCmd)
aliasCmd.Flags().StringVar(&aliasDesc, "desc", "", "description for the alias")
}

View File

@@ -13,8 +13,8 @@ import (
)
var dForce bool
var deleteCmd = &cobra.Command{
Use: "delete <id>", Short: "Delete a node", Args: cobra.ExactArgs(1),
var delCmd = &cobra.Command{
Use: "del <id>", Short: "Delete a node", Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
d, err := db.GetDB()
if err != nil {
@@ -46,6 +46,6 @@ var deleteCmd = &cobra.Command{
}
func init() {
rootCmd.AddCommand(deleteCmd)
deleteCmd.Flags().BoolVarP(&dForce, "force", "f", false, "")
rootCmd.AddCommand(delCmd)
delCmd.Flags().BoolVarP(&dForce, "force", "f", false, "")
}