Skip to content

Commit

Permalink
Review addressed and changlog added
Browse files Browse the repository at this point in the history
  • Loading branch information
yazdan committed Jul 29, 2023
1 parent e7232d3 commit f274147
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .changelog/17958.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
cli: make snapshot name requiered in creating volume snapshots
```
6 changes: 3 additions & 3 deletions command/volume_snapshot_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type VolumeSnapshotCreateCommand struct {

func (c *VolumeSnapshotCreateCommand) Help() string {
helpText := `
Usage: nomad volume snapshot create <volume id> snapshot_name
Usage: nomad volume snapshot create <volume id> <snapshot_name>
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
Expand Down Expand Up @@ -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: <vol id> <snapshot name>")
if l := len(args); l != 2 {
c.Ui.Error("This command takes two arguments: <vol id> <snapshot name>")
c.Ui.Error(commandErrorText(c))
return 1
}
Expand Down

0 comments on commit f274147

Please sign in to comment.