feat: rename create and delete commands to add and del
This commit is contained in:
18
README.md
18
README.md
@@ -28,10 +28,10 @@ go build -o ax .
|
|||||||
ax init .
|
ax init .
|
||||||
|
|
||||||
# Create an issue
|
# Create an issue
|
||||||
ax create "Implement feature X" --tag backend --prio high
|
ax add "Implement feature X" --tag backend --prio high
|
||||||
|
|
||||||
# Create with relations
|
# Create with relations
|
||||||
ax create "Fix bug in auth" --rel blocks:abc12
|
ax add "Fix bug in auth" --rel blocks:abc12
|
||||||
|
|
||||||
# List open issues
|
# List open issues
|
||||||
ax list --status open
|
ax list --status open
|
||||||
@@ -55,7 +55,7 @@ ax alias mywork "list --namespace myproject --status open" --desc "My project ta
|
|||||||
|
|
||||||
Create a new `.ax.db` database in the specified directory (default: current).
|
Create a new `.ax.db` database in the specified directory (default: current).
|
||||||
|
|
||||||
### `ax create <title> [flags]`
|
### `ax add <title> [flags]`
|
||||||
|
|
||||||
Create a new node.
|
Create a new node.
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ Query and list nodes.
|
|||||||
|
|
||||||
Open node content in `$EDITOR`.
|
Open node content in `$EDITOR`.
|
||||||
|
|
||||||
### `ax delete <id> [-f|--force]`
|
### `ax del <id> [-f|--force]`
|
||||||
|
|
||||||
Delete a node. Prompts for confirmation unless `--force`.
|
Delete a node. Prompts for confirmation unless `--force`.
|
||||||
|
|
||||||
@@ -163,10 +163,10 @@ Relations connect nodes together:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Create subtask
|
# Create subtask
|
||||||
ax create "Write tests" --rel subtask:abc12
|
ax add "Write tests" --rel subtask:abc12
|
||||||
|
|
||||||
# Block an issue
|
# Block an issue
|
||||||
ax create "Fix login" --rel blocks:def34
|
ax add "Fix login" --rel blocks:def34
|
||||||
|
|
||||||
# Assign to user
|
# Assign to user
|
||||||
ax update abc12 --rel assignee:alice
|
ax update abc12 --rel assignee:alice
|
||||||
@@ -178,10 +178,10 @@ Tags are flexible labels. Tags with pattern `_key::value` are properties:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Regular tag
|
# Regular tag
|
||||||
ax create "Task" --tag backend
|
ax add "Task" --tag backend
|
||||||
|
|
||||||
# Property tags (set via flags)
|
# Property tags (set via flags)
|
||||||
ax create "Task" --type issue --status open --prio high
|
ax add "Task" --type issue --status open --prio high
|
||||||
# Equivalent to: --tag _type::issue --tag _status::open --tag _prio::high
|
# Equivalent to: --tag _type::issue --tag _status::open --tag _prio::high
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -199,7 +199,7 @@ ax create "Task" --type issue --status open --prio high
|
|||||||
Use `@username` in title or content to automatically add to user's inbox:
|
Use `@username` in title or content to automatically add to user's inbox:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ax create "Review PR @alice" --content "@bob please check"
|
ax add "Review PR @alice" --content "@bob please check"
|
||||||
# Both alice and bob get this in their inbox
|
# Both alice and bob get this in their inbox
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ import (
|
|||||||
var cDue, cContent string
|
var cDue, cContent string
|
||||||
var cTags, cRels []string
|
var cTags, cRels []string
|
||||||
|
|
||||||
var createCmd = &cobra.Command{
|
var addCmd = &cobra.Command{
|
||||||
Use: "create <title>", Short: "Create a new node", Args: cobra.ExactArgs(1),
|
Use: "add <title>", Short: "Create a new node", Args: cobra.ExactArgs(1),
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
d, err := db.GetDB()
|
d, err := db.GetDB()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -59,10 +59,10 @@ var createCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(createCmd)
|
rootCmd.AddCommand(addCmd)
|
||||||
addPropertyFlags(createCmd)
|
addPropertyFlags(addCmd)
|
||||||
createCmd.Flags().Set("type", "issue")
|
addCmd.Flags().Set("type", "issue")
|
||||||
f := createCmd.Flags()
|
f := addCmd.Flags()
|
||||||
f.StringVar(&cDue, "due", "", "")
|
f.StringVar(&cDue, "due", "", "")
|
||||||
f.StringVar(&cContent, "content", "", "")
|
f.StringVar(&cContent, "content", "", "")
|
||||||
f.StringArrayVar(&cTags, "tag", nil, "")
|
f.StringArrayVar(&cTags, "tag", nil, "")
|
||||||
@@ -38,8 +38,8 @@ var aliasCmd = &cobra.Command{
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var aliasDeleteCmd = &cobra.Command{
|
var aliasDelCmd = &cobra.Command{
|
||||||
Use: "delete <name>", Short: "Delete an alias", Args: cobra.ExactArgs(1),
|
Use: "del <name>", Short: "Delete an alias", Args: cobra.ExactArgs(1),
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
if err := cfg.DeleteAlias(args[0]); err != nil {
|
if err := cfg.DeleteAlias(args[0]); err != nil {
|
||||||
fmt.Fprintln(os.Stderr, err)
|
fmt.Fprintln(os.Stderr, err)
|
||||||
@@ -51,6 +51,6 @@ var aliasDeleteCmd = &cobra.Command{
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(aliasCmd)
|
rootCmd.AddCommand(aliasCmd)
|
||||||
aliasCmd.AddCommand(aliasDeleteCmd)
|
aliasCmd.AddCommand(aliasDelCmd)
|
||||||
aliasCmd.Flags().StringVar(&aliasDesc, "desc", "", "description for the alias")
|
aliasCmd.Flags().StringVar(&aliasDesc, "desc", "", "description for the alias")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var dForce bool
|
var dForce bool
|
||||||
var deleteCmd = &cobra.Command{
|
var delCmd = &cobra.Command{
|
||||||
Use: "delete <id>", Short: "Delete a node", Args: cobra.ExactArgs(1),
|
Use: "del <id>", Short: "Delete a node", Args: cobra.ExactArgs(1),
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
d, err := db.GetDB()
|
d, err := db.GetDB()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -46,6 +46,6 @@ var deleteCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(deleteCmd)
|
rootCmd.AddCommand(delCmd)
|
||||||
deleteCmd.Flags().BoolVarP(&dForce, "force", "f", false, "")
|
delCmd.Flags().BoolVarP(&dForce, "force", "f", false, "")
|
||||||
}
|
}
|
||||||
@@ -20,7 +20,7 @@ type fileConfig struct {
|
|||||||
var defaultAliases = []*Alias{
|
var defaultAliases = []*Alias{
|
||||||
{Name: "mine", Command: "list --assignee $me --tag _status::open", Description: "Show open tasks assigned to you"},
|
{Name: "mine", Command: "list --assignee $me --tag _status::open", Description: "Show open tasks assigned to you"},
|
||||||
{Name: "due", Command: "list --tag _status::open --tag _due", Description: "Show open tasks with due dates"},
|
{Name: "due", Command: "list --tag _status::open --tag _due", Description: "Show open tasks with due dates"},
|
||||||
{Name: "new", Command: "create $@", Description: "Create a new task"},
|
{Name: "new", Command: "add $@", Description: "Create a new task"},
|
||||||
}
|
}
|
||||||
|
|
||||||
func LoadConfig() (Config, error) {
|
func LoadConfig() (Config, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user