Skip to content

Commit

Permalink
✨ Add long help texts
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Mar 10, 2022
1 parent 3f2e73d commit 5bf2565
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
23 changes: 20 additions & 3 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,26 @@ var (
)

var Command = &cobra.Command{
Use: "kubedb",
Short: "Interact with a database inside of Kubernetes",
Version: buildVersion(),
Use: "kubedb",
Short: "interact with a database inside of Kubernetes",
Version: buildVersion(),
Long: `kubedb is a command to interact with a database running in a Kubernetes cluster.
Multiple database types (referred to as the "grammar") are supported.
If the grammar is not configured via flag, it will be detected dynamically.
Supported Database Grammars:
- PostgreSQL
- MariaDB
If not configured via flag, some configuration variables will be loaded from the target pod's env vars.
Dynamic Env Var Variables:
- Database (fallback value: "db")
- Username (fallback value: "db" if PostgreSQL, "mariadb" if MariaDB)
- Password (required)
`,

PersistentPreRunE: preRun,
}

Expand Down
7 changes: 6 additions & 1 deletion cmd/dump/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ import (
)

var Command = &cobra.Command{
Use: "dump",
Use: "dump [filename]",
Aliases: []string{"d", "export"},
Short: "dump a database to a sql file",
Long: `The "dump" command dumps a running database to a sql file.
If no filename is provided, the filename will be generated.
For example, if a dump is performed in the namespace "clevyr" with no extra flags,
the generated filename might look like "clevyr_2022-04-01_094100.sql.gz"`,

Args: cobra.MaximumNArgs(1),
ValidArgsFunction: validArgs,
Expand Down
8 changes: 7 additions & 1 deletion cmd/restore/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ import (
)

var Command = &cobra.Command{
Use: "restore",
Use: "restore filename",
Aliases: []string{"r", "import"},
Short: "restore a database from a sql file",
Long: `The "restore" command restores a given sql file to a running database pod.
Supported Input Filetypes:
- Raw sql file. Typically with the ".sql" extension
- Gzipped sql file. Typically with the ".sql.gz" extension
- Postgres custom dump file. Typically with the ".dmp" extension (Only if the target database is Postgres)`,

Args: cobra.ExactArgs(1),
ValidArgsFunction: validArgs,
Expand Down

0 comments on commit 5bf2565

Please sign in to comment.