From 42eacc85e2f749651066f03984e3ec4e456596e0 Mon Sep 17 00:00:00 2001 From: Rajeev Date: Fri, 18 Oct 2024 13:18:12 +0530 Subject: [PATCH] #23671 Added synopsis for operator root and operator gossip command. (#23855) Co-authored-by: James Rasell --- .changelog/23671.txt | 3 +++ command/commands.go | 10 ++++++++++ command/operator_gossip.go | 33 +++++++++++++++++++++++++++++++++ command/operator_root.go | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+) create mode 100644 .changelog/23671.txt create mode 100644 command/operator_gossip.go create mode 100644 command/operator_root.go diff --git a/.changelog/23671.txt b/.changelog/23671.txt new file mode 100644 index 000000000..772821555 --- /dev/null +++ b/.changelog/23671.txt @@ -0,0 +1,3 @@ +```release-note:improvement +cli: Added synopsis for `operator root` and `operator gossip` command +``` diff --git a/command/commands.go b/command/commands.go index 026eed15e..89e0b35a1 100644 --- a/command/commands.go +++ b/command/commands.go @@ -731,6 +731,11 @@ func Commands(metaPtr *Meta, agentUi cli.Ui) map[string]cli.CommandFactory { Meta: meta, }, nil }, + "operator gossip": func() (cli.Command, error) { + return &OperatorGossipCommand{ + Meta: meta, + }, nil + }, "operator gossip keyring": func() (cli.Command, error) { return &OperatorGossipKeyringCommand{ Meta: meta, @@ -819,6 +824,11 @@ func Commands(metaPtr *Meta, agentUi cli.Ui) map[string]cli.CommandFactory { Meta: meta, }, nil }, + "operator root": func() (cli.Command, error) { + return &OperatorRootCommand{ + Meta: meta, + }, nil + }, "operator root keyring": func() (cli.Command, error) { return &OperatorRootKeyringCommand{ Meta: meta, diff --git a/command/operator_gossip.go b/command/operator_gossip.go new file mode 100644 index 000000000..a5009fcce --- /dev/null +++ b/command/operator_gossip.go @@ -0,0 +1,33 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package command + +import ( + "strings" + + "github.com/mitchellh/cli" +) + +type OperatorGossipCommand struct { + Meta +} + +func (*OperatorGossipCommand) Help() string { + helpText := ` +Usage: nomad operator gossip [options] [args] + + This command is accessed by using one of the subcommands below. +` + return strings.TrimSpace(helpText) +} + +func (*OperatorGossipCommand) Synopsis() string { + return "Provides access to the Gossip protocol" +} + +func (f *OperatorGossipCommand) Name() string { return "operator gossip" } + +func (f *OperatorGossipCommand) Run(_ []string) int { + return cli.RunResultHelp +} diff --git a/command/operator_root.go b/command/operator_root.go new file mode 100644 index 000000000..de8b04257 --- /dev/null +++ b/command/operator_root.go @@ -0,0 +1,34 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package command + +import ( + "strings" + + "github.com/mitchellh/cli" +) + +type OperatorRootCommand struct { + Meta +} + +func (*OperatorRootCommand) Help() string { + helpText := ` +Usage: nomad operator root [options] [args] + + This command is accessed by using one of the subcommands below. +` + + return strings.TrimSpace(helpText) +} + +func (*OperatorRootCommand) Synopsis() string { + return "Provides access to root encryption keys" +} + +func (f *OperatorRootCommand) Name() string { return "operator root" } + +func (f *OperatorRootCommand) Run(_ []string) int { + return cli.RunResultHelp +}