From 0ade5faec9a20c988114b3071487bf240582d4cb Mon Sep 17 00:00:00 2001 From: lew Date: Thu, 20 Nov 2025 14:40:10 +0000 Subject: [PATCH] test(help): OK test cases --- testdata/help__del-db__ok.ct | 24 ++++++++++++++ testdata/help__del__ok.ct | 24 ++++++++++++++ testdata/help__dump__ok.ct | 26 +++++++++++++++ testdata/help__get__ok.ct | 44 ++++++++++++++++++++++++++ testdata/help__help__ok.ct | 18 +++++++++++ testdata/help__list-dbs__ok.ct | 22 +++++++++++++ testdata/help__list__ok.ct | 36 +++++++++++++++++++++ testdata/help__ok.ct | 58 ++++++++++++++++++++++++++++++++++ testdata/help__restore__ok.ct | 24 ++++++++++++++ testdata/help__set__ok.ct | 44 ++++++++++++++++++++++++++ 10 files changed, 320 insertions(+) create mode 100644 testdata/help__del-db__ok.ct create mode 100644 testdata/help__del__ok.ct create mode 100644 testdata/help__dump__ok.ct create mode 100644 testdata/help__get__ok.ct create mode 100644 testdata/help__help__ok.ct create mode 100644 testdata/help__list-dbs__ok.ct create mode 100644 testdata/help__list__ok.ct create mode 100644 testdata/help__ok.ct create mode 100644 testdata/help__restore__ok.ct create mode 100644 testdata/help__set__ok.ct diff --git a/testdata/help__del-db__ok.ct b/testdata/help__del-db__ok.ct new file mode 100644 index 0000000..4b81a50 --- /dev/null +++ b/testdata/help__del-db__ok.ct @@ -0,0 +1,24 @@ +$ pda help del-db +$ pda del-db --help +Delete a database. + +Usage: + pda del-db DB [flags] + +Aliases: + del-db, delete-db, rm-db, remove-db + +Flags: + -f, --force Force delete without confirmation + -h, --help help for del-db +Delete a database. + +Usage: + pda del-db DB [flags] + +Aliases: + del-db, delete-db, rm-db, remove-db + +Flags: + -f, --force Force delete without confirmation + -h, --help help for del-db diff --git a/testdata/help__del__ok.ct b/testdata/help__del__ok.ct new file mode 100644 index 0000000..a87a965 --- /dev/null +++ b/testdata/help__del__ok.ct @@ -0,0 +1,24 @@ +$ pda help del +$ pda del --help +Delete a key. Optionally specify a db. + +Usage: + pda del KEY[@DB] [flags] + +Aliases: + del, delete, rm, remove + +Flags: + -f, --force Force delete without confirmation + -h, --help help for del +Delete a key. Optionally specify a db. + +Usage: + pda del KEY[@DB] [flags] + +Aliases: + del, delete, rm, remove + +Flags: + -f, --force Force delete without confirmation + -h, --help help for del diff --git a/testdata/help__dump__ok.ct b/testdata/help__dump__ok.ct new file mode 100644 index 0000000..ae6042c --- /dev/null +++ b/testdata/help__dump__ok.ct @@ -0,0 +1,26 @@ +$ pda help dump +$ pda dump --help +Dump all key/value pairs as NDJSON + +Usage: + pda dump [DB] [flags] + +Aliases: + dump, export + +Flags: + -e, --encoding string value encoding: auto, base64, or text (default "auto") + -h, --help help for dump + --secret Include entries marked as secret +Dump all key/value pairs as NDJSON + +Usage: + pda dump [DB] [flags] + +Aliases: + dump, export + +Flags: + -e, --encoding string value encoding: auto, base64, or text (default "auto") + -h, --help help for dump + --secret Include entries marked as secret diff --git a/testdata/help__get__ok.ct b/testdata/help__get__ok.ct new file mode 100644 index 0000000..0edc4f2 --- /dev/null +++ b/testdata/help__get__ok.ct @@ -0,0 +1,44 @@ +$ pda help get +$ pda get --help +Get a value for a key. Optionally specify a db. + +{{ .TEMPLATES }} can be filled by passing TEMPLATE=VALUE as an +additional argument after the initial KEY being fetched. + +For example: + pda set greeting 'Hello, {{ .NAME }}!' + pda get greeting NAME=World + +Usage: + pda get KEY[@DB] [flags] + +Aliases: + get, g + +Flags: + -h, --help help for get + -b, --include-binary include binary data in text output + --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. + +{{ .TEMPLATES }} can be filled by passing TEMPLATE=VALUE as an +additional argument after the initial KEY being fetched. + +For example: + pda set greeting 'Hello, {{ .NAME }}!' + pda get greeting NAME=World + +Usage: + pda get KEY[@DB] [flags] + +Aliases: + get, g + +Flags: + -h, --help help for get + -b, --include-binary include binary data in text output + --no-template directly output template syntax + -c, --run execute the result as a shell command + --secret display values marked as secret diff --git a/testdata/help__help__ok.ct b/testdata/help__help__ok.ct new file mode 100644 index 0000000..05e4d41 --- /dev/null +++ b/testdata/help__help__ok.ct @@ -0,0 +1,18 @@ +$ pda help help +$ pda help --help +Help provides help for any command in the application. +Simply type pda help [path to command] for full details. + +Usage: + pda help [command] [flags] + +Flags: + -h, --help help for help +Help provides help for any command in the application. +Simply type pda help [path to command] for full details. + +Usage: + pda help [command] [flags] + +Flags: + -h, --help help for help diff --git a/testdata/help__list-dbs__ok.ct b/testdata/help__list-dbs__ok.ct new file mode 100644 index 0000000..bf0f0de --- /dev/null +++ b/testdata/help__list-dbs__ok.ct @@ -0,0 +1,22 @@ +$ pda help list-dbs +$ pda list-dbs --help +List all dbs. + +Usage: + pda list-dbs [flags] + +Aliases: + list-dbs, ls-dbs, lsd + +Flags: + -h, --help help for list-dbs +List all dbs. + +Usage: + pda list-dbs [flags] + +Aliases: + list-dbs, ls-dbs, lsd + +Flags: + -h, --help help for list-dbs diff --git a/testdata/help__list__ok.ct b/testdata/help__list__ok.ct new file mode 100644 index 0000000..4b3f714 --- /dev/null +++ b/testdata/help__list__ok.ct @@ -0,0 +1,36 @@ +$ pda help list +$ pda list --help +List the contents of a db. + +Usage: + pda list [DB] [flags] + +Aliases: + list, ls + +Flags: + -b, --binary include binary data in text output + -o, --format format output format (table|tsv|csv|markdown|html) (default table) + --header include header row + -h, --help help for list + --no-keys suppress the key column + --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. + +Usage: + pda list [DB] [flags] + +Aliases: + list, ls + +Flags: + -b, --binary include binary data in text output + -o, --format format output format (table|tsv|csv|markdown|html) (default table) + --header include header row + -h, --help help for list + --no-keys suppress the key column + --no-values suppress the value column + -S, --secret display values marked as secret + -t, --ttl append a TTL column when entries expire diff --git a/testdata/help__ok.ct b/testdata/help__ok.ct new file mode 100644 index 0000000..fb5709c --- /dev/null +++ b/testdata/help__ok.ct @@ -0,0 +1,58 @@ +$ pda help +$ pda --help + ▄▄ + ██ + ██▄███▄ ▄███▄██ ▄█████▄ + ██▀ ▀██ ██▀ ▀██ ▀ ▄▄▄██ + ██ ██ ██ ██ ▄██▀▀▀██ + ███▄▄██▀ ▀██▄▄███ ██▄▄▄███ + ██ ▀▀▀ ▀▀▀ ▀▀ ▀▀▀▀ ▀▀ + ██ (c) 2025 Lewis Wynne + +Usage: + pda [command] + +Available Commands: + completion Generate the autocompletion script for the specified shell + del Delete a key. Optionally specify a db. + del-db Delete a database. + dump Dump all key/value pairs as NDJSON + get Get a value for a key. Optionally specify a db. + help Help about any command + list List the contents of a db. + list-dbs List all dbs. + 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. + +Flags: + -h, --help help for pda + +Use "pda [command] --help" for more information about a command. + ▄▄ + ██ + ██▄███▄ ▄███▄██ ▄█████▄ + ██▀ ▀██ ██▀ ▀██ ▀ ▄▄▄██ + ██ ██ ██ ██ ▄██▀▀▀██ + ███▄▄██▀ ▀██▄▄███ ██▄▄▄███ + ██ ▀▀▀ ▀▀▀ ▀▀ ▀▀▀▀ ▀▀ + ██ (c) 2025 Lewis Wynne + +Usage: + pda [command] + +Available Commands: + completion Generate the autocompletion script for the specified shell + del Delete a key. Optionally specify a db. + del-db Delete a database. + dump Dump all key/value pairs as NDJSON + get Get a value for a key. Optionally specify a db. + help Help about any command + list List the contents of a db. + list-dbs List all dbs. + 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. + +Flags: + -h, --help help for pda + +Use "pda [command] --help" for more information about a command. diff --git a/testdata/help__restore__ok.ct b/testdata/help__restore__ok.ct new file mode 100644 index 0000000..765ac68 --- /dev/null +++ b/testdata/help__restore__ok.ct @@ -0,0 +1,24 @@ +$ pda help restore +$ pda restore --help +Restore key/value pairs from an NDJSON dump + +Usage: + pda restore [DB] [flags] + +Aliases: + restore, import + +Flags: + -f, --file string Path to an NDJSON dump (defaults to stdin) + -h, --help help for restore +Restore key/value pairs from an NDJSON dump + +Usage: + pda restore [DB] [flags] + +Aliases: + restore, import + +Flags: + -f, --file string Path to an NDJSON dump (defaults to stdin) + -h, --help help for restore diff --git a/testdata/help__set__ok.ct b/testdata/help__set__ok.ct new file mode 100644 index 0000000..1f4b32b --- /dev/null +++ b/testdata/help__set__ok.ct @@ -0,0 +1,44 @@ +$ pda help set +$ pda set --help +Set a value for a key by passing VALUE or Stdin. Optionally specify a db. + +PDA supports parsing Go templates. Actions are delimited with {{ }}. + +For example: + 'Hello, {{ .NAME }}' can be substituted with NAME="John Doe". + 'Hello, {{ env "USER" }}' will fetch the USER env variable. + 'Hello, {{ default "World" .NAME }}' will default to World if NAME is blank. + 'Hello, {{ require .NAME }}' will error if NAME is blank. + '{{ enum .NAME "Alice" "Bob" }}' allows only NAME=Alice or NAME=Bob. + +Usage: + pda set KEY[@DB] [VALUE] [flags] + +Aliases: + set, s + +Flags: + -h, --help help for set + --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. + +PDA supports parsing Go templates. Actions are delimited with {{ }}. + +For example: + 'Hello, {{ .NAME }}' can be substituted with NAME="John Doe". + 'Hello, {{ env "USER" }}' will fetch the USER env variable. + 'Hello, {{ default "World" .NAME }}' will default to World if NAME is blank. + 'Hello, {{ require .NAME }}' will error if NAME is blank. + '{{ enum .NAME "Alice" "Bob" }}' allows only NAME=Alice or NAME=Bob. + +Usage: + pda set KEY[@DB] [VALUE] [flags] + +Aliases: + set, s + +Flags: + -h, --help help for set + --secret Mark the stored value as a secret + -t, --ttl duration Expire the key after the provided duration (e.g. 24h, 30m)