From 94676757156e930c4af249bb82f8c4c131edfdcd Mon Sep 17 00:00:00 2001 From: lew Date: Tue, 23 Dec 2025 08:42:20 +0000 Subject: [PATCH] chore(cmd): updates Shorts, and test expectations. --- cmd/del-db.go | 2 +- cmd/del.go | 2 +- cmd/get.go | 4 ++-- cmd/git.go | 9 ++++++-- cmd/init.go | 2 +- cmd/list-dbs.go | 2 +- cmd/list.go | 2 +- cmd/root.go | 2 +- testdata/help__del-db__ok.ct | 4 ++-- testdata/help__del__ok.ct | 4 ++-- testdata/help__get__ok.ct | 4 ++-- testdata/help__list-dbs__ok.ct | 4 ++-- testdata/help__list__ok.ct | 4 ++-- testdata/help__ok.ct | 40 +++++++++++++++++++--------------- testdata/help__set__ok.ct | 4 ++-- testdata/root__ok.ct | 20 +++++++++-------- 16 files changed, 60 insertions(+), 49 deletions(-) diff --git a/cmd/del-db.go b/cmd/del-db.go index e563f33..540bd9e 100644 --- a/cmd/del-db.go +++ b/cmd/del-db.go @@ -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, diff --git a/cmd/del.go b/cmd/del.go index a2e6072..846216c 100644 --- a/cmd/del.go +++ b/cmd/del.go @@ -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, diff --git a/cmd/get.go b/cmd/get.go index 7056c31..0f50e46 100644 --- a/cmd/get.go +++ b/cmd/get.go @@ -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. diff --git a/cmd/git.go b/cmd/git.go index fc00b9e..caa3015 100644 --- a/cmd/git.go +++ b/cmd/git.go @@ -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, diff --git a/cmd/init.go b/cmd/init.go index 6f07de8..d0259b2 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -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, diff --git a/cmd/list-dbs.go b/cmd/list-dbs.go index effde4f..33a5ba1 100644 --- a/cmd/list-dbs.go +++ b/cmd/list-dbs.go @@ -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, diff --git a/cmd/list.go b/cmd/list.go index 69fc6c9..b5a46fa 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -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, diff --git a/cmd/root.go b/cmd/root.go index 80d9a79..4f01fe0 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -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, } diff --git a/testdata/help__del-db__ok.ct b/testdata/help__del-db__ok.ct index c758df0..b634f62 100644 --- a/testdata/help__del-db__ok.ct +++ b/testdata/help__del-db__ok.ct @@ -1,6 +1,6 @@ $ pda help del-db $ pda del-db --help -Delete a database. +Delete a database Usage: pda del-db DB [flags] @@ -11,7 +11,7 @@ Aliases: Flags: -h, --help help for del-db -i, --interactive Prompt yes/no for each deletion -Delete a database. +Delete a database Usage: pda del-db DB [flags] diff --git a/testdata/help__del__ok.ct b/testdata/help__del__ok.ct index 6ec88b7..42f3fb2 100644 --- a/testdata/help__del__ok.ct +++ b/testdata/help__del__ok.ct @@ -1,6 +1,6 @@ $ pda help del $ pda del --help -Delete one or more keys. Optionally specify a db. +Delete one or more keys Usage: pda del KEY[@DB] [KEY[@DB] ...] [flags] @@ -13,7 +13,7 @@ Flags: --glob-sep string Characters treated as separators for globbing (default "/-_.@: ") -h, --help help for del -i, --interactive Prompt yes/no for each deletion -Delete one or more keys. Optionally specify a db. +Delete one or more keys Usage: pda del KEY[@DB] [KEY[@DB] ...] [flags] diff --git a/testdata/help__get__ok.ct b/testdata/help__get__ok.ct index 0edc4f2..23557f2 100644 --- a/testdata/help__get__ok.ct +++ b/testdata/help__get__ok.ct @@ -1,6 +1,6 @@ $ pda help get $ pda get --help -Get a value for a key. Optionally specify a db. +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. @@ -21,7 +21,7 @@ Flags: --no-template directly output template syntax -c, --run execute the result as a shell command --secret display values marked as secret -Get a value for a key. Optionally specify a db. +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. diff --git a/testdata/help__list-dbs__ok.ct b/testdata/help__list-dbs__ok.ct index bf0f0de..05945f2 100644 --- a/testdata/help__list-dbs__ok.ct +++ b/testdata/help__list-dbs__ok.ct @@ -1,6 +1,6 @@ $ pda help list-dbs $ pda list-dbs --help -List all dbs. +List all databases Usage: pda list-dbs [flags] @@ -10,7 +10,7 @@ Aliases: Flags: -h, --help help for list-dbs -List all dbs. +List all databases Usage: pda list-dbs [flags] diff --git a/testdata/help__list__ok.ct b/testdata/help__list__ok.ct index 349f4cb..f87b112 100644 --- a/testdata/help__list__ok.ct +++ b/testdata/help__list__ok.ct @@ -1,6 +1,6 @@ $ pda help list $ pda list --help -List the contents of a db. +List the contents of a database Usage: pda list [DB] [flags] @@ -19,7 +19,7 @@ Flags: --no-values suppress the value column -S, --secret display values marked as secret -t, --ttl append a TTL column when entries expire -List the contents of a db. +List the contents of a database Usage: pda list [DB] [flags] diff --git a/testdata/help__ok.ct b/testdata/help__ok.ct index 61f9903..d701f24 100644 --- a/testdata/help__ok.ct +++ b/testdata/help__ok.ct @@ -14,18 +14,20 @@ Usage: Available Commands: completion Generate the autocompletion script for the specified shell - cp Make a copy of a key. - del Delete one or more keys. Optionally specify a db. - del-db Delete a database. + cp Make a copy of a key + del Delete one or more keys + del-db Delete a database dump Dump all key/value pairs as NDJSON - get Get a value for a key. Optionally specify a db. + get Get the value of a key + git Run any arbitrary command. Use with caution. help Help about any command - list List the contents of a db. - list-dbs List all dbs. - mv Move a key between (or within) databases. + init Initialise pda! version control + list List the contents of a database + list-dbs List all databases + mv Move a key restore Restore key/value pairs from an NDJSON dump - set Set a value for a key by passing VALUE or Stdin. Optionally specify a db. - vcs Version control utilities + set Set a key to a given value + sync Manually sync your stores with Git version Display pda! version Flags: @@ -46,18 +48,20 @@ Usage: Available Commands: completion Generate the autocompletion script for the specified shell - cp Make a copy of a key. - del Delete one or more keys. Optionally specify a db. - del-db Delete a database. + cp Make a copy of a key + del Delete one or more keys + del-db Delete a database dump Dump all key/value pairs as NDJSON - get Get a value for a key. Optionally specify a db. + get Get the value of a key + git Run any arbitrary command. Use with caution. help Help about any command - list List the contents of a db. - list-dbs List all dbs. - mv Move a key between (or within) databases. + init Initialise pda! version control + list List the contents of a database + list-dbs List all databases + mv Move a key restore Restore key/value pairs from an NDJSON dump - set Set a value for a key by passing VALUE or Stdin. Optionally specify a db. - vcs Version control utilities + set Set a key to a given value + sync Manually sync your stores with Git version Display pda! version Flags: diff --git a/testdata/help__set__ok.ct b/testdata/help__set__ok.ct index 3eb19fd..9fc0925 100644 --- a/testdata/help__set__ok.ct +++ b/testdata/help__set__ok.ct @@ -1,6 +1,6 @@ $ pda help set $ pda set --help -Set a value for a key by passing VALUE or Stdin. Optionally specify a db. +Set a key to a given value or stdin. Optionally specify a db. PDA supports parsing Go templates. Actions are delimited with {{ }}. @@ -22,7 +22,7 @@ Flags: -i, --interactive Prompt before overwriting an existing key --secret Mark the stored value as a secret -t, --ttl duration Expire the key after the provided duration (e.g. 24h, 30m) -Set a value for a key by passing VALUE or Stdin. Optionally specify a db. +Set a key to a given value or stdin. Optionally specify a db. PDA supports parsing Go templates. Actions are delimited with {{ }}. diff --git a/testdata/root__ok.ct b/testdata/root__ok.ct index fac97c5..01aae35 100644 --- a/testdata/root__ok.ct +++ b/testdata/root__ok.ct @@ -13,18 +13,20 @@ Usage: Available Commands: completion Generate the autocompletion script for the specified shell - cp Make a copy of a key. - del Delete one or more keys. Optionally specify a db. - del-db Delete a database. + cp Make a copy of a key + del Delete one or more keys + del-db Delete a database dump Dump all key/value pairs as NDJSON - get Get a value for a key. Optionally specify a db. + get Get the value of a key + git Run any arbitrary command. Use with caution. help Help about any command - list List the contents of a db. - list-dbs List all dbs. - mv Move a key between (or within) databases. + init Initialise pda! version control + list List the contents of a database + list-dbs List all databases + mv Move a key restore Restore key/value pairs from an NDJSON dump - set Set a value for a key by passing VALUE or Stdin. Optionally specify a db. - vcs Version control utilities + set Set a key to a given value + sync Manually sync your stores with Git version Display pda! version Flags: