diff --git a/.changelog/17958.txt b/.changelog/17958.txt new file mode 100644 index 000000000000..b76ae7a9febb --- /dev/null +++ b/.changelog/17958.txt @@ -0,0 +1,3 @@ +```release-note:bug +cli: make snapshot name requiered in creating volume snapshots +``` diff --git a/command/volume_snapshot_create.go b/command/volume_snapshot_create.go index f37eb3eef6ca..9cd567477575 100644 --- a/command/volume_snapshot_create.go +++ b/command/volume_snapshot_create.go @@ -19,7 +19,7 @@ type VolumeSnapshotCreateCommand struct { func (c *VolumeSnapshotCreateCommand) Help() string { helpText := ` -Usage: nomad volume snapshot create snapshot_name +Usage: nomad volume snapshot create Create a snapshot of an external storage volume. This command requires a volume ID or prefix and snapthost name. If there is an exact match based on @@ -99,8 +99,8 @@ func (c *VolumeSnapshotCreateCommand) Run(args []string) int { // Check that we at least one argument args = flags.Args() - if l := len(args); l <= 1 { - c.Ui.Error("This command takes two argument: ") + if l := len(args); l != 2 { + c.Ui.Error("This command takes two arguments: ") c.Ui.Error(commandErrorText(c)) return 1 }