chore(cmd): updates Shorts, and test expectations.

This commit is contained in:
Lewis Wynne 2025-12-23 08:42:20 +00:00
parent ef597c5f22
commit 9467675715
16 changed files with 60 additions and 49 deletions

View file

@ -34,7 +34,7 @@ import (
// delDbCmd represents the set command
var delDbCmd = &cobra.Command{
Use: "del-db DB",
Short: "Delete a database.",
Short: "Delete a database",
Aliases: []string{"delete-db", "rm-db", "remove-db"},
Args: cobra.ExactArgs(1),
RunE: delDb,

View file

@ -35,7 +35,7 @@ import (
// delCmd represents the set command
var delCmd = &cobra.Command{
Use: "del KEY[@DB] [KEY[@DB] ...]",
Short: "Delete one or more keys. Optionally specify a db.",
Short: "Delete one or more keys",
Aliases: []string{"delete", "rm", "remove"},
Args: cobra.ArbitraryArgs,
RunE: del,

View file

@ -39,8 +39,8 @@ import (
// getCmd represents the get command
var getCmd = &cobra.Command{
Use: "get KEY[@DB]",
Short: "Get a value for a key. Optionally specify a db.",
Long: `Get a value for a key. Optionally specify a db.
Short: "Get the value of a key",
Long: `Get the value of a key. Optionally specify a db.
{{ .TEMPLATES }} can be filled by passing TEMPLATE=VALUE as an
additional argument after the initial KEY being fetched.

View file

@ -30,8 +30,13 @@ import (
)
var gitCmd = &cobra.Command{
Use: "git [args...]",
Short: "Run git in the pda VCS repository",
Use: "git [args...]",
Short: "Run any arbitrary command. Use with caution.",
Long: `Run any arbitrary command. Use with caution.
Be wary of how pda! version control operates before using this. Regular data is stored in "PDA_DATA/pda/stores" as a database; the Git repository is in "PDA_DATA/pda/vcs" and contains a replica of the database stored as plaintext.
The regular sync command (or auto-syncing) exports pda! data into plaintext in the Git repository. If you manually modify the repository without using the built-in commands, or exporting your data to the folder in the correct format first, you may desynchronize your repository.`,
Args: cobra.ArbitraryArgs,
DisableFlagParsing: true,
SilenceUsage: true,

View file

@ -33,7 +33,7 @@ import (
var initCmd = &cobra.Command{
Use: "init [remote-url]",
Short: "Initialise (or fetch) Git-backed version control.",
Short: "Initialise pda! version control",
SilenceUsage: true,
Args: cobra.MaximumNArgs(1),
RunE: vcsInit,

View file

@ -30,7 +30,7 @@ import (
// delCmd represents the set command
var listDbsCmd = &cobra.Command{
Use: "list-dbs",
Short: "List all dbs.",
Short: "List all databases",
Aliases: []string{"ls-dbs", "lsd"},
Args: cobra.NoArgs,
RunE: listDbs,

View file

@ -33,7 +33,7 @@ import (
var listCmd = &cobra.Command{
Use: "list [DB]",
Short: "List the contents of a db.",
Short: "List the contents of a database",
Aliases: []string{"ls"},
Args: cobra.MaximumNArgs(1),
RunE: list,

View file

@ -32,7 +32,7 @@ import (
// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "pda",
Short: "A key-value store.",
Short: "A key-value store tool",
Long: asciiArt,
}