Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriele Bartolini <[email protected]>
  • Loading branch information
gbartolini committed Dec 4, 2024
1 parent 0cdb726 commit 0f15371
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions internal/cmd/plugin/backup/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func NewCmd() *cobra.Command {
}

backupSubcommand := &cobra.Command{
Use: "backup [cluster]",
Use: "backup CLUSTER",
Short: "Request an on-demand backup for a PostgreSQL Cluster",
GroupID: plugin.GroupIDDatabase,
Args: plugin.RequiresArguments(1),
Expand Down Expand Up @@ -167,7 +167,7 @@ func NewCmd() *cobra.Command {
"backup-name",
"",
"The name of the Backup resource that will be created, "+
"defaults to \"[cluster]-[current_timestamp]\"",
"defaults to \"CLUSTER-CURRENT_TIMESTAMP\"",
)
backupSubcommand.Flags().StringVarP(
&backupTarget,
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/plugin/destroy/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
// NewCmd create the new "destroy" subcommand
func NewCmd() *cobra.Command {
destroyCmd := &cobra.Command{
Use: "destroy [cluster] [node]",
Short: "Destroy the instance named [cluster]-[node] or [node] with the associated PVC",
Use: "destroy CLUSTER INSTANCE",
Short: "Destroy the instance named CLUSTER-INSTANCE with the associated PVC",
GroupID: plugin.GroupIDCluster,
Args: plugin.RequiresArguments(2),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
8 changes: 4 additions & 4 deletions internal/cmd/plugin/fence/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (

var (
fenceOnCmd = &cobra.Command{
Use: "on [cluster] [node]",
Short: `Fence an instance named [cluster]-[node] or [node]`,
Use: "on CLUSTER INSTANCE",
Short: `Fence an instance named CLUSTER-INSTANCE`,
Args: plugin.RequiresArguments(2),
RunE: func(cmd *cobra.Command, args []string) error {
clusterName := args[0]
Expand All @@ -42,8 +42,8 @@ var (
}

fenceOffCmd = &cobra.Command{
Use: "off [cluster] [node]",
Short: `Remove fence for an instance named [cluster]-[node] or [node]`,
Use: "off CLUSTER INSTANCE",
Short: `Remove fence for an instance named CLUSTER-INSTANCE`,
Args: plugin.RequiresArguments(2),
RunE: func(cmd *cobra.Command, args []string) error {
clusterName := args[0]
Expand Down
12 changes: 6 additions & 6 deletions internal/cmd/plugin/hibernate/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (

var (
hibernateOnCmd = &cobra.Command{
Use: "on [cluster]",
Short: "Hibernates the cluster named [cluster]",
Use: "on CLUSTER",
Short: "Hibernates the cluster named CLUSTER",
Args: plugin.RequiresArguments(1),
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return plugin.CompleteClusters(cmd.Context(), args, toComplete), cobra.ShellCompDirectiveNoFileComp
Expand All @@ -49,8 +49,8 @@ var (
}

hibernateOffCmd = &cobra.Command{
Use: "off [cluster]",
Short: "Bring the cluster named [cluster] back from hibernation",
Use: "off CLUSTER",
Short: "Bring the cluster named CLUSTER back from hibernation",
Args: plugin.RequiresArguments(1),
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return plugin.CompleteClusters(cmd.Context(), args, toComplete), cobra.ShellCompDirectiveNoFileComp
Expand All @@ -63,8 +63,8 @@ var (
}

hibernateStatusCmd = &cobra.Command{
Use: "status [cluster]",
Short: "Prints the hibernation status for the [cluster]",
Use: "status CLUSTER",
Short: "Prints the hibernation status for the CLUSTER",
Args: plugin.RequiresArguments(1),
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return plugin.CompleteClusters(cmd.Context(), args, toComplete), cobra.ShellCompDirectiveNoFileComp
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/plugin/maintenance/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewCmd() *cobra.Command {
}

maintenanceCmd.AddCommand(&cobra.Command{
Use: "set [cluster]",
Use: "set CLUSTER",
Short: "Sets maintenance mode",
Long: "This command will set maintenance mode on a single cluster or on all clusters " +
"in the current namespace if not specified differently through flags",
Expand All @@ -58,7 +58,7 @@ func NewCmd() *cobra.Command {
})

maintenanceCmd.AddCommand(&cobra.Command{
Use: "unset [cluster]",
Use: "unset CLUSTER",
Short: "Removes maintenance mode",
Long: "This command will unset maintenance mode on a single cluster or on all clusters " +
"in the current namespace if not specified differently through flags",
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/plugin/pgbench/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func NewCmd() *cobra.Command {
run := &pgBenchRun{}

pgBenchCmd := &cobra.Command{
Use: "pgbench [cluster] [-- pgBenchCommandArgs...]",
Use: "pgbench CLUSTER [-- PGBENCH_COMMAND_ARGS...]",
Short: "Creates a pgbench job",
Args: validateCommandArgs,
Long: "Creates a pgbench job to run against the specified Postgres Cluster.",
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/plugin/pgbench/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var _ = Describe("NewCmd", func() {
It("should create a cobra.Command with correct defaults", func() {
cmd := NewCmd()

Expect(cmd.Use).To(Equal("pgbench [cluster] [-- pgBenchCommandArgs...]"))
Expect(cmd.Use).To(Equal("pgbench CLUSTER [-- PGBENCH_COMMAND_ARGS...]"))
Expect(cmd.Short).To(Equal("Creates a pgbench job"))
Expect(cmd.Long).To(Equal("Creates a pgbench job to run against the specified Postgres Cluster."))
Expect(cmd.Example).To(Equal(jobExample))
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/plugin/promote/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
// NewCmd create the new "promote" subcommand
func NewCmd() *cobra.Command {
promoteCmd := &cobra.Command{
Use: "promote [cluster] [node]",
Short: "Promote the pod named [cluster]-[node] or [node] to primary",
Use: "promote CLUSTER INSTANCE",
Short: "Promote the pod named CLUSTER-INSTANCE to primary",
GroupID: plugin.GroupIDCluster,
Args: plugin.RequiresArguments(2),
RunE: func(_ *cobra.Command, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/plugin/psql/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func NewCmd() *cobra.Command {
var passStdin bool

cmd := &cobra.Command{
Use: "psql [cluster] [-- psqlArgs...]",
Use: "psql CLUSTER [-- PSQL_ARGS...]",
Short: "Start a psql session targeting a CloudNativePG cluster",
Args: validatePsqlArgs,
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/plugin/reload/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
// NewCmd creates the new "reset" command
func NewCmd() *cobra.Command {
restartCmd := &cobra.Command{
Use: "reload [clusterName]",
Use: "reload CLUSTER",
Short: `Reload a cluster`,
Long: `Triggers a reconciliation loop for all the cluster's instances, rolling out new configurations if present.`,
GroupID: plugin.GroupIDCluster,
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/plugin/status/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
// NewCmd create the new "status" subcommand
func NewCmd() *cobra.Command {
statusCmd := &cobra.Command{
Use: "status [cluster]",
Use: "status CLUSTER",
Short: "Get the status of a PostgreSQL cluster",
Args: plugin.RequiresArguments(1),
GroupID: plugin.GroupIDDatabase,
Expand Down

0 comments on commit 0f15371

Please sign in to comment.