diff --git a/README.md b/README.md index 59c8c66..d19c9a8 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ and more, written in pure Go, and inspired by [skate](https://github.com/charmbr

-`pda!` canonically stores key-value pairs in [badger](https://github.com/dgraph-io/badger) databases for the sake of speed, but supports exporting everything out to a handful of different plaintext formats too, including but not limited to [CSV](https://en.wikipedia.org/wiki/Comma-separated_values), [TSV](https://en.wikipedia.org/wiki/Tab-separated_values), [newline-delimited JSON](https://en.wikipedia.org/wiki/JSON_streaming#Newline-delimited_JSON), and [Markdown](https://en.wikipedia.org/wiki/Markdown) and [HTML](https://en.wikipedia.org/wiki/HTML_element#Tables) tables. `pda!` uses newline-delimited JSON for version control; a full snapshot of every existing key-value pair across all stores can be manually requested with the snapshot command, or auto-commit can be enabled in the config to automatically generate a descriptive commit for every change made. +`pda!` canonically stores key-value pairs in [badger](https://github.com/dgraph-io/badger) stores for the sake of speed, but supports exporting everything out to a handful of different plaintext formats too, including but not limited to [CSV](https://en.wikipedia.org/wiki/Comma-separated_values), [TSV](https://en.wikipedia.org/wiki/Tab-separated_values), [newline-delimited JSON](https://en.wikipedia.org/wiki/JSON_streaming#Newline-delimited_JSON), and [Markdown](https://en.wikipedia.org/wiki/Markdown) and [HTML](https://en.wikipedia.org/wiki/HTML_element#Tables) tables. `pda!` uses newline-delimited JSON for version control; a full snapshot of every existing key-value pair across all stores can be manually requested with the snapshot command, or auto-commit can be enabled in the config to automatically generate a descriptive commit for every change made.

@@ -69,10 +69,10 @@ Available Commands: cp # Copy a value. mv # Move a value. del # Delete a value. - del-db # Delete a whole database. - list-dbs # List all databases. - dump # Export a database as NDJSON. - restore # Imports NDJSON into a database. + del-store # Delete a whole store. + list-stores # List all stores. + dump # Export a store as NDJSON. + restore # Imports NDJSON into a store. init # Initialise or fetch a Git repo for version control. sync # Export, commit, pull, restore, and push changes. git # Run git in the pda VCS repository. @@ -215,11 +215,11 @@ pda restore --glob a* -f my_backup You can have as many stores as you want. ```bash -# Save to a spceific store. +# Save to a specific store. pda set alice@birthdays 11/11/1998 # See which stores have contents. -pda list-dbs +pda list-stores # @default # @birthdays @@ -235,7 +235,7 @@ pda dump birthdays > friends_birthdays pda restore birthdays < friends_birthdays # Delete it. -pda del-db birthdays --force +pda del-store birthdays --force ```

@@ -378,7 +378,7 @@ pda get hello --no-template Globs can be used in a few commands where their use makes sense. `gobwas/glob` is used for matching. -Searching for globs is inherently slower than looking for direct matches, so globs are opt-in via a repeatable `--glob/-g` flag by default rather than having every string treated as a glob by default. Realistically the performance impact will be negligible unless you have many thousands of entries in the same database. +Searching for globs is inherently slower than looking for direct matches, so globs are opt-in via a repeatable `--glob/-g` flag by default rather than having every string treated as a glob by default. Realistically the performance impact will be negligible unless you have many thousands of entries in the same store.

diff --git a/cmd/del-db.go b/cmd/del-db.go index 540bd9e..cc5d425 100644 --- a/cmd/del-db.go +++ b/cmd/del-db.go @@ -31,43 +31,43 @@ import ( "github.com/spf13/cobra" ) -// delDbCmd represents the set command -var delDbCmd = &cobra.Command{ - Use: "del-db DB", - Short: "Delete a database", - Aliases: []string{"delete-db", "rm-db", "remove-db"}, +// delStoreCmd represents the set command +var delStoreCmd = &cobra.Command{ + Use: "del-store STORE", + Short: "Delete a store", + Aliases: []string{"delete-store", "rm-store", "remove-store"}, Args: cobra.ExactArgs(1), - RunE: delDb, + RunE: delStore, SilenceUsage: true, } -func delDb(cmd *cobra.Command, args []string) error { +func delStore(cmd *cobra.Command, args []string) error { store := &Store{} dbName, err := store.parseDB(args[0], false) if err != nil { - return fmt.Errorf("cannot delete-db '%s': %v", args[0], err) + return fmt.Errorf("cannot delete-store '%s': %v", args[0], err) } var notFound errNotFound path, err := store.FindStore(dbName) if errors.As(err, ¬Found) { - return fmt.Errorf("cannot delete-db '%s': %v", dbName, err) + return fmt.Errorf("cannot delete-store '%s': %v", dbName, err) } if err != nil { - return fmt.Errorf("cannot delete-db '%s': %v", dbName, err) + return fmt.Errorf("cannot delete-store '%s': %v", dbName, err) } interactive, err := cmd.Flags().GetBool("interactive") if err != nil { - return fmt.Errorf("cannot delete-db '%s': %v", dbName, err) + return fmt.Errorf("cannot delete-store '%s': %v", dbName, err) } if interactive || config.Store.AlwaysPromptDelete { - message := fmt.Sprintf("delete-db '%s': are you sure? (y/n)", args[0]) + message := fmt.Sprintf("delete-store '%s': are you sure? (y/n)", args[0]) fmt.Println(message) var confirm string if _, err := fmt.Scanln(&confirm); err != nil { - return fmt.Errorf("cannot delete-db '%s': %v", dbName, err) + return fmt.Errorf("cannot delete-store '%s': %v", dbName, err) } if strings.ToLower(confirm) != "y" { return nil @@ -81,12 +81,12 @@ func delDb(cmd *cobra.Command, args []string) error { func executeDeletion(path string) error { if err := os.RemoveAll(path); err != nil { - return fmt.Errorf("cannot delete-db '%s': %v", path, err) + return fmt.Errorf("cannot delete-store '%s': %v", path, err) } return nil } func init() { - delDbCmd.Flags().BoolP("interactive", "i", false, "Prompt yes/no for each deletion") - rootCmd.AddCommand(delDbCmd) + delStoreCmd.Flags().BoolP("interactive", "i", false, "Prompt yes/no for each deletion") + rootCmd.AddCommand(delStoreCmd) } diff --git a/cmd/del.go b/cmd/del.go index 846216c..ad27031 100644 --- a/cmd/del.go +++ b/cmd/del.go @@ -34,7 +34,7 @@ import ( // delCmd represents the set command var delCmd = &cobra.Command{ - Use: "del KEY[@DB] [KEY[@DB] ...]", + Use: "del KEY[@STORE] [KEY[@STORE] ...]", Short: "Delete one or more keys", Aliases: []string{"delete", "rm", "remove"}, Args: cobra.ArbitraryArgs, diff --git a/cmd/dump.go b/cmd/dump.go index fe0f7f0..060f6ce 100644 --- a/cmd/dump.go +++ b/cmd/dump.go @@ -45,7 +45,7 @@ type dumpEntry struct { } var dumpCmd = &cobra.Command{ - Use: "dump [DB]", + Use: "dump [STORE]", Short: "Dump all key/value pairs as NDJSON", Aliases: []string{"export"}, Args: cobra.MaximumNArgs(1), @@ -130,7 +130,7 @@ func encodeText(entry *dumpEntry, key []byte, v []byte) error { return nil } -// DumpOptions controls how a database is dumped to NDJSON. +// DumpOptions controls how a store is dumped to NDJSON. type DumpOptions struct { Encoding string IncludeSecret bool diff --git a/cmd/get.go b/cmd/get.go index 0f50e46..28edda2 100644 --- a/cmd/get.go +++ b/cmd/get.go @@ -38,9 +38,9 @@ import ( // getCmd represents the get command var getCmd = &cobra.Command{ - Use: "get KEY[@DB]", + Use: "get KEY[@STORE]", Short: "Get the value of a key", - Long: `Get the value of a key. Optionally specify a db. + Long: `Get the value of a key. Optionally specify a store. {{ .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 caa3015..1dbe4b7 100644 --- a/cmd/git.go +++ b/cmd/git.go @@ -32,9 +32,9 @@ import ( var gitCmd = &cobra.Command{ Use: "git [args...]", Short: "Run any arbitrary command. Use with caution.", - Long: `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. +Be wary of how pda! version control operates before using this. Regular data is stored in "PDA_DATA/pda/stores" as a store; the Git repository is in "PDA_DATA/pda/vcs" and contains a plaintext replica of the store data. 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, diff --git a/cmd/keyspec.go b/cmd/keyspec.go index ce4c4ec..1f6739f 100644 --- a/cmd/keyspec.go +++ b/cmd/keyspec.go @@ -31,17 +31,17 @@ import ( type KeySpec struct { Raw string // Whole, unmodified user input RawKey string // Key segment - RawDB string // DB segment + RawDB string // Store segment Key string // Normalised Key - DB string // Normalised DB + DB string // Normalised store } -// ParseKey parses "KEY[@DB]" into a normalized KeySpec. -// When defaults is true, a missing DB defaults to the configured default. +// ParseKey parses "KEY[@STORE]" into a normalized KeySpec. +// When defaults is true, a missing store defaults to the configured default. func ParseKey(raw string, defaults bool) (KeySpec, error) { parts := strings.Split(raw, "@") if len(parts) > 2 { - return KeySpec{}, fmt.Errorf("bad key format, use KEY@DB") + return KeySpec{}, fmt.Errorf("bad key format, use KEY@STORE") } rawKey := parts[0] @@ -49,7 +49,7 @@ func ParseKey(raw string, defaults bool) (KeySpec, error) { if len(parts) == 2 { rawDB = parts[1] if strings.TrimSpace(rawDB) == "" { - return KeySpec{}, fmt.Errorf("bad key format, use KEY@DB") + return KeySpec{}, fmt.Errorf("bad key format, use KEY@STORE") } if err := validateDBName(rawDB); err != nil { return KeySpec{}, err @@ -80,7 +80,7 @@ func (k KeySpec) Full() string { } // Display returns the normalized key reference -// but omits the default database if none was set manually +// but omits the default store if none was set manually func (k KeySpec) Display() string { if k.DB == "" || k.DB == config.Store.DefaultStoreName { return k.Key diff --git a/cmd/list-dbs.go b/cmd/list-dbs.go index 33a5ba1..633f0c9 100644 --- a/cmd/list-dbs.go +++ b/cmd/list-dbs.go @@ -28,20 +28,20 @@ import ( ) // delCmd represents the set command -var listDbsCmd = &cobra.Command{ - Use: "list-dbs", - Short: "List all databases", - Aliases: []string{"ls-dbs", "lsd"}, +var listStoresCmd = &cobra.Command{ + Use: "list-stores", + Short: "List all stores", + Aliases: []string{"ls-stores", "lsd"}, Args: cobra.NoArgs, - RunE: listDbs, + RunE: listStores, SilenceUsage: true, } -func listDbs(cmd *cobra.Command, args []string) error { +func listStores(cmd *cobra.Command, args []string) error { store := &Store{} dbs, err := store.AllStores() if err != nil { - return fmt.Errorf("cannot list-dbs: %v", err) + return fmt.Errorf("cannot list-stores: %v", err) } for _, db := range dbs { fmt.Println("@" + db) @@ -50,5 +50,5 @@ func listDbs(cmd *cobra.Command, args []string) error { } func init() { - rootCmd.AddCommand(listDbsCmd) + rootCmd.AddCommand(listStoresCmd) } diff --git a/cmd/list.go b/cmd/list.go index b5a46fa..3dd83a8 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -32,8 +32,8 @@ import ( ) var listCmd = &cobra.Command{ - Use: "list [DB]", - Short: "List the contents of a database", + Use: "list [STORE]", + Short: "List the contents of a store", Aliases: []string{"ls"}, Args: cobra.MaximumNArgs(1), RunE: list, @@ -52,7 +52,7 @@ func list(cmd *cobra.Command, args []string) error { if _, err := store.FindStore(dbName); err != nil { var notFound errNotFound if errors.As(err, ¬Found) { - return fmt.Errorf("cannot ls '%s': No such DB", args[0]) + return fmt.Errorf("cannot ls '%s': No such store", args[0]) } return fmt.Errorf("cannot ls '%s': %v", args[0], err) } diff --git a/cmd/mv.go b/cmd/mv.go index 522a1dc..4dc1c75 100644 --- a/cmd/mv.go +++ b/cmd/mv.go @@ -31,14 +31,14 @@ import ( ) var cpCmd = &cobra.Command{ - Use: "cp FROM[@DB] TO[@DB]", + Use: "cp FROM[@STORE] TO[@STORE]", Short: "Make a copy of a key", Args: cobra.ExactArgs(2), RunE: cp, } var mvCmd = &cobra.Command{ - Use: "mv FROM[@DB] TO[@DB]", + Use: "mv FROM[@STORE] TO[@STORE]", Short: "Move a key", Args: cobra.ExactArgs(2), RunE: mv, diff --git a/cmd/restore.go b/cmd/restore.go index b42c983..7e994f7 100644 --- a/cmd/restore.go +++ b/cmd/restore.go @@ -36,7 +36,7 @@ import ( ) var restoreCmd = &cobra.Command{ - Use: "restore [DB]", + Use: "restore [STORE]", Short: "Restore key/value pairs from an NDJSON dump", Aliases: []string{"import"}, Args: cobra.MaximumNArgs(1), diff --git a/cmd/set.go b/cmd/set.go index 1592454..483c5e8 100644 --- a/cmd/set.go +++ b/cmd/set.go @@ -33,9 +33,9 @@ import ( // setCmd represents the set command var setCmd = &cobra.Command{ - Use: "set KEY[@DB] [VALUE]", + Use: "set KEY[@STORE] [VALUE]", Short: "Set a key to a given value", - Long: `Set a key to a given value or stdin. Optionally specify a db. + Long: `Set a key to a given value or stdin. Optionally specify a store. PDA supports parsing Go templates. Actions are delimited with {{ }}. diff --git a/cmd/shared.go b/cmd/shared.go index 67760ca..3dcaa61 100644 --- a/cmd/shared.go +++ b/cmd/shared.go @@ -176,10 +176,10 @@ func (s *Store) parseDB(v string, defaults bool) (string, error) { if defaults { return config.Store.DefaultStoreName, nil } - return "", fmt.Errorf("cannot parse db: bad db format, use DB or @DB") + return "", fmt.Errorf("cannot parse store: bad store format, use STORE or @STORE") } if err := validateDBName(db); err != nil { - return "", fmt.Errorf("cannot parse db: %w", err) + return "", fmt.Errorf("cannot parse store: %w", err) } return strings.ToLower(db), nil } @@ -262,7 +262,7 @@ func ensureSubpath(base, target string) error { func validateDBName(name string) error { if strings.ContainsAny(name, `/\~`) { - return fmt.Errorf("bad db format, use DB or @DB") + return fmt.Errorf("bad store format, use STORE or @STORE") } return nil } @@ -279,7 +279,7 @@ func formatExpiry(expiresAt uint64) string { return fmt.Sprintf("%s (in %s)", expiry.Format(time.RFC3339), remaining.Round(time.Second)) } -// Keys returns all keys for the provided database name (or default if empty). +// Keys returns all keys for the provided store name (or default if empty). // Keys are returned in lowercase to mirror stored key format. func (s *Store) Keys(dbName string) ([]string, error) { db, err := s.open(dbName) diff --git a/cmd/vcs.go b/cmd/vcs.go index 53c47e1..0e81140 100644 --- a/cmd/vcs.go +++ b/cmd/vcs.go @@ -93,7 +93,7 @@ func snapshotDB(store *Store, repoDir, db string) error { } // exportAllStores writes every Badger store to ndjson files under repoDir/stores -// and removes stale snapshot files for deleted databases. +// and removes stale snapshot files for deleted stores. func exportAllStores(store *Store, repoDir string) error { stores, err := store.AllStores() if err != nil { @@ -335,7 +335,7 @@ func restoreAllSnapshots(store *Store, repoDir string) error { return err } if err := os.RemoveAll(dbPath); err != nil { - return fmt.Errorf("remove db '%s': %w", db, err) + return fmt.Errorf("remove store '%s': %w", db, err) } } @@ -353,7 +353,7 @@ func wipeAllStores(store *Store) error { return err } if err := os.RemoveAll(path); err != nil { - return fmt.Errorf("remove db '%s': %w", db, err) + return fmt.Errorf("remove store '%s': %w", db, err) } } return nil diff --git a/testdata/del-db__err__with__invalid_db.ct b/testdata/del-db__err__with__invalid_db.ct index 0d8d373..4d8a1e1 100644 --- a/testdata/del-db__err__with__invalid_db.ct +++ b/testdata/del-db__err__with__invalid_db.ct @@ -1,2 +1,2 @@ -$ pda del-db foo/bar --> FAIL -Error: cannot delete-db 'foo/bar': cannot parse db: bad db format, use DB or @DB +$ pda del-store foo/bar --> FAIL +Error: cannot delete-store 'foo/bar': cannot parse store: bad store format, use STORE or @STORE diff --git a/testdata/get__err__with__invalid_db.ct b/testdata/get__err__with__invalid_db.ct index c082ae3..6be4beb 100644 --- a/testdata/get__err__with__invalid_db.ct +++ b/testdata/get__err__with__invalid_db.ct @@ -1,2 +1,2 @@ $ pda get key@foo/bar --> FAIL -Error: cannot get 'key@foo/bar': bad db format, use DB or @DB +Error: cannot get 'key@foo/bar': bad store format, use STORE or @STORE diff --git a/testdata/help__del-db__ok.ct b/testdata/help__del-db__ok.ct index b634f62..1ab2233 100644 --- a/testdata/help__del-db__ok.ct +++ b/testdata/help__del-db__ok.ct @@ -1,24 +1,24 @@ -$ pda help del-db -$ pda del-db --help -Delete a database +$ pda help del-store +$ pda del-store --help +Delete a store Usage: - pda del-db DB [flags] + pda del-store STORE [flags] Aliases: - del-db, delete-db, rm-db, remove-db + del-store, delete-store, rm-store, remove-store Flags: - -h, --help help for del-db + -h, --help help for del-store -i, --interactive Prompt yes/no for each deletion -Delete a database +Delete a store Usage: - pda del-db DB [flags] + pda del-store STORE [flags] Aliases: - del-db, delete-db, rm-db, remove-db + del-store, delete-store, rm-store, remove-store Flags: - -h, --help help for del-db + -h, --help help for del-store -i, --interactive Prompt yes/no for each deletion diff --git a/testdata/help__del__ok.ct b/testdata/help__del__ok.ct index 42f3fb2..9d53415 100644 --- a/testdata/help__del__ok.ct +++ b/testdata/help__del__ok.ct @@ -3,7 +3,7 @@ $ pda del --help Delete one or more keys Usage: - pda del KEY[@DB] [KEY[@DB] ...] [flags] + pda del KEY[@STORE] [KEY[@STORE] ...] [flags] Aliases: del, delete, rm, remove @@ -16,7 +16,7 @@ Flags: Delete one or more keys Usage: - pda del KEY[@DB] [KEY[@DB] ...] [flags] + pda del KEY[@STORE] [KEY[@STORE] ...] [flags] Aliases: del, delete, rm, remove diff --git a/testdata/help__dump__ok.ct b/testdata/help__dump__ok.ct index c471a6d..19cc6d8 100644 --- a/testdata/help__dump__ok.ct +++ b/testdata/help__dump__ok.ct @@ -3,7 +3,7 @@ $ pda dump --help Dump all key/value pairs as NDJSON Usage: - pda dump [DB] [flags] + pda dump [STORE] [flags] Aliases: dump, export @@ -17,7 +17,7 @@ Flags: Dump all key/value pairs as NDJSON Usage: - pda dump [DB] [flags] + pda dump [STORE] [flags] Aliases: dump, export diff --git a/testdata/help__get__ok.ct b/testdata/help__get__ok.ct index 23557f2..c484fa9 100644 --- a/testdata/help__get__ok.ct +++ b/testdata/help__get__ok.ct @@ -1,6 +1,6 @@ $ pda help get $ pda get --help -Get the value of a key. Optionally specify a db. +Get the value of a key. Optionally specify a store. {{ .TEMPLATES }} can be filled by passing TEMPLATE=VALUE as an additional argument after the initial KEY being fetched. @@ -10,7 +10,7 @@ For example: pda get greeting NAME=World Usage: - pda get KEY[@DB] [flags] + pda get KEY[@STORE] [flags] Aliases: get, g @@ -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 the value of a key. Optionally specify a db. +Get the value of a key. Optionally specify a store. {{ .TEMPLATES }} can be filled by passing TEMPLATE=VALUE as an additional argument after the initial KEY being fetched. @@ -31,7 +31,7 @@ For example: pda get greeting NAME=World Usage: - pda get KEY[@DB] [flags] + pda get KEY[@STORE] [flags] Aliases: get, g diff --git a/testdata/help__list-dbs__ok.ct b/testdata/help__list-dbs__ok.ct index 05945f2..5f4a311 100644 --- a/testdata/help__list-dbs__ok.ct +++ b/testdata/help__list-dbs__ok.ct @@ -1,22 +1,22 @@ -$ pda help list-dbs -$ pda list-dbs --help -List all databases +$ pda help list-stores +$ pda list-stores --help +List all stores Usage: - pda list-dbs [flags] + pda list-stores [flags] Aliases: - list-dbs, ls-dbs, lsd + list-stores, ls-stores, lsd Flags: - -h, --help help for list-dbs -List all databases + -h, --help help for list-stores +List all stores Usage: - pda list-dbs [flags] + pda list-stores [flags] Aliases: - list-dbs, ls-dbs, lsd + list-stores, ls-stores, lsd Flags: - -h, --help help for list-dbs + -h, --help help for list-stores diff --git a/testdata/help__list__ok.ct b/testdata/help__list__ok.ct index f87b112..f259b55 100644 --- a/testdata/help__list__ok.ct +++ b/testdata/help__list__ok.ct @@ -1,9 +1,9 @@ $ pda help list $ pda list --help -List the contents of a database +List the contents of a store Usage: - pda list [DB] [flags] + pda list [STORE] [flags] Aliases: list, ls @@ -19,10 +19,10 @@ 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 database +List the contents of a store Usage: - pda list [DB] [flags] + pda list [STORE] [flags] Aliases: list, ls diff --git a/testdata/help__ok.ct b/testdata/help__ok.ct index d701f24..e14ce8e 100644 --- a/testdata/help__ok.ct +++ b/testdata/help__ok.ct @@ -16,14 +16,14 @@ Available Commands: completion Generate the autocompletion script for the specified shell cp Make a copy of a key del Delete one or more keys - del-db Delete a database + del-store Delete a store dump Dump all key/value pairs as NDJSON get Get the value of a key git Run any arbitrary command. Use with caution. help Help about any command init Initialise pda! version control - list List the contents of a database - list-dbs List all databases + list List the contents of a store + list-stores List all stores mv Move a key restore Restore key/value pairs from an NDJSON dump set Set a key to a given value @@ -50,14 +50,14 @@ Available Commands: completion Generate the autocompletion script for the specified shell cp Make a copy of a key del Delete one or more keys - del-db Delete a database + del-store Delete a store dump Dump all key/value pairs as NDJSON get Get the value of a key git Run any arbitrary command. Use with caution. help Help about any command init Initialise pda! version control - list List the contents of a database - list-dbs List all databases + list List the contents of a store + list-stores List all stores mv Move a key restore Restore key/value pairs from an NDJSON dump set Set a key to a given value diff --git a/testdata/help__restore__ok.ct b/testdata/help__restore__ok.ct index 63a3771..3f1c4fb 100644 --- a/testdata/help__restore__ok.ct +++ b/testdata/help__restore__ok.ct @@ -3,7 +3,7 @@ $ pda restore --help Restore key/value pairs from an NDJSON dump Usage: - pda restore [DB] [flags] + pda restore [STORE] [flags] Aliases: restore, import @@ -17,7 +17,7 @@ Flags: Restore key/value pairs from an NDJSON dump Usage: - pda restore [DB] [flags] + pda restore [STORE] [flags] Aliases: restore, import diff --git a/testdata/help__set__ok.ct b/testdata/help__set__ok.ct index 9fc0925..37c8f10 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 key to a given value or stdin. Optionally specify a db. +Set a key to a given value or stdin. Optionally specify a store. PDA supports parsing Go templates. Actions are delimited with {{ }}. @@ -12,7 +12,7 @@ For example: '{{ enum .NAME "Alice" "Bob" }}' allows only NAME=Alice or NAME=Bob. Usage: - pda set KEY[@DB] [VALUE] [flags] + pda set KEY[@STORE] [VALUE] [flags] Aliases: set, s @@ -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 key to a given value or stdin. Optionally specify a db. +Set a key to a given value or stdin. Optionally specify a store. PDA supports parsing Go templates. Actions are delimited with {{ }}. @@ -34,7 +34,7 @@ For example: '{{ enum .NAME "Alice" "Bob" }}' allows only NAME=Alice or NAME=Bob. Usage: - pda set KEY[@DB] [VALUE] [flags] + pda set KEY[@STORE] [VALUE] [flags] Aliases: set, s diff --git a/testdata/list__err__with__invalid_db.ct b/testdata/list__err__with__invalid_db.ct index b2594dc..f53a448 100644 --- a/testdata/list__err__with__invalid_db.ct +++ b/testdata/list__err__with__invalid_db.ct @@ -1,2 +1,2 @@ $ pda ls foo/bar --> FAIL -Error: cannot ls 'foo/bar': cannot parse db: bad db format, use DB or @DB +Error: cannot ls 'foo/bar': cannot parse store: bad store format, use STORE or @STORE diff --git a/testdata/root__ok.ct b/testdata/root__ok.ct index 01aae35..580ee43 100644 --- a/testdata/root__ok.ct +++ b/testdata/root__ok.ct @@ -15,14 +15,14 @@ Available Commands: completion Generate the autocompletion script for the specified shell cp Make a copy of a key del Delete one or more keys - del-db Delete a database + del-store Delete a store dump Dump all key/value pairs as NDJSON get Get the value of a key git Run any arbitrary command. Use with caution. help Help about any command init Initialise pda! version control - list List the contents of a database - list-dbs List all databases + list List the contents of a store + list-stores List all stores mv Move a key restore Restore key/value pairs from an NDJSON dump set Set a key to a given value