Skip to content

Commit 6c6cf9f

Browse files
authored
chore(cmx): Network update short flags, reporting help text changes (#580)
Signed-off-by: Kyle Squizzato <[email protected]>
1 parent b7aa736 commit 6c6cf9f

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

cli/cmd/network.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ func (r *runners) InitNetworkCommand(parent *cobra.Command) *cobra.Command {
1717
Long: `The 'network' command allows you to manage and interact with networks used for testing purposes.
1818
With this command you can list the networks in use by VMs and clusters.`,
1919
Example: `# List all networks
20-
replicated network ls`,
20+
replicated network ls
21+
22+
# Update a network with an airgap policy
23+
replicated network update <network-id> --policy airgap
24+
`,
2125
Hidden: false,
2226
}
2327
parent.AddCommand(cmd)

cli/cmd/network_update.go

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ import (
1111
func (r *runners) InitNetworkUpdateCommand(parent *cobra.Command) *cobra.Command {
1212
cmd := &cobra.Command{
1313
Use: "update [ID_OR_NAME]",
14-
Short: "Update network settings.",
14+
Short: "Update network settings",
1515
Long: `The 'update' command allows you to update various settings of a test network.
1616
1717
You can either specify the network ID directly or provide the network name, and the command will resolve the corresponding network ID.
1818
19-
Network Policies are currently a beta feature, and network reporting is currently an alpha feature.`,
19+
Network Policies are currently a beta feature.`,
2020
Example: `# Update a network using its ID
2121
replicated network update <network-id> --policy airgap
2222
@@ -26,29 +26,23 @@ replicated network update <network-name> --policy airgap
2626
# Update using --id or --name flags
2727
replicated network update --id <network-id> --policy airgap
2828
replicated network update --name <network-name> --policy airgap
29-
30-
# Enable report collection on a network
31-
replicated network update <network-id> --collect-report
32-
33-
# Disable report collection on a network
34-
replicated network update <network-id> --collect-report=false
35-
36-
# Update both policy and report collection on a network
37-
replicated network update <network-id> --policy airgap --collect-report`,
29+
`,
3830
RunE: r.updateNetwork,
3931
SilenceUsage: true,
4032
ValidArgsFunction: r.completeNetworkIDsAndNames,
4133
}
4234
parent.AddCommand(cmd)
4335

44-
cmd.PersistentFlags().StringVar(&r.args.updateNetworkName, "name", "", "Name of the network to update.")
36+
cmd.PersistentFlags().StringVar(&r.args.updateNetworkName, "name", "", "Name of the network to update")
4537
cmd.RegisterFlagCompletionFunc("name", r.completeNetworkNames)
4638

4739
cmd.PersistentFlags().StringVar(&r.args.updateNetworkID, "id", "", "id of the network to update (when name is not provided)")
4840
cmd.RegisterFlagCompletionFunc("id", r.completeNetworkIDs)
4941

50-
cmd.Flags().StringVar(&r.args.updateNetworkPolicy, "policy", "", "Update network policy setting")
51-
cmd.Flags().BoolVar(&r.args.updateNetworkCollectReport, "collect-report", false, "Enable report collection on this network (use --collect-report=false to disable)")
42+
cmd.Flags().StringVarP(&r.args.updateNetworkPolicy, "policy", "p", "", "Update network policy setting")
43+
cmd.Flags().BoolVarP(&r.args.updateNetworkCollectReport, "collect-report", "r", false, "Enable report collection on this network (use --collect-report=false to disable)")
44+
// TODO: Remove this once report collection is Beta, ensure we add
45+
// examples in the above help text as well.
5246
cmd.Flags().MarkHidden("collect-report")
5347
cmd.Flags().StringVar(&r.outputFormat, "output", "table", "The output format to use. One of: json|table|wide")
5448

0 commit comments

Comments
 (0)