Skip to content

Commit 7d3b59b

Browse files
authored
Update volume command help docs (#2922)
* update volume command help docs * typo * try fixing strings * i guess you can't just omit long * whitespace * test format fix * fix formatting * more fixes * test rm long desc * abort lol
1 parent d07b604 commit 7d3b59b

File tree

7 files changed

+31
-31
lines changed

7 files changed

+31
-31
lines changed

internal/command/volumes/create.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ import (
2222

2323
func newCreate() *cobra.Command {
2424
const (
25-
long = `Create new volume for app. --region flag must be included to specify
26-
region the volume exists in. --size flag is optional, defaults to 3,
27-
sets the size as the number of gigabytes the volume will consume.`
25+
short = "Create a new volume for an app."
2826

29-
short = "Create new volume for app"
27+
long = short + ` Volumes are persistent storage for
28+
Fly Machines. The default size is 3 GB. Learn how to add a volume to
29+
your app: https://fly.io/docs/apps/volume-storage/`
3030

3131
usage = "create <volumename>"
3232
)
@@ -46,28 +46,28 @@ sets the size as the number of gigabytes the volume will consume.`
4646
Name: "size",
4747
Shorthand: "s",
4848
Default: 3,
49-
Description: "Size of volume in gigabytes",
49+
Description: "The size of volume in gigabytes. The default is 3.",
5050
},
5151
flag.Bool{
5252
Name: "no-encryption",
53-
Description: "Do not encrypt the volume contents",
53+
Description: "Do not encrypt the volume contents. Volume contents are encrypted by default.",
5454
Default: false,
5555
},
5656
flag.Bool{
5757
Name: "require-unique-zone",
58-
Description: "Require volume to be placed in separate hardware zone from existing volumes",
58+
Description: "Place the volume in a separate hardware zone from existing volumes. This is the default.",
5959
Default: true,
6060
},
6161
flag.String{
6262
Name: "snapshot-id",
63-
Description: "Create volume from a specified snapshot",
63+
Description: "Create the volume from the specified snapshot",
6464
},
6565
flag.Yes(),
6666
flag.Int{
6767
Name: "count",
6868
Shorthand: "n",
6969
Default: 1,
70-
Description: "Number of volumes to create",
70+
Description: "The number of volumes to create",
7171
},
7272
flag.VMSizeFlags,
7373
)
@@ -179,7 +179,7 @@ func confirmVolumeCreate(ctx context.Context, appName string) (bool, error) {
179179
io := iostreams.FromContext(ctx)
180180
colorize := io.ColorScheme()
181181

182-
const msg = "Warning! Individual volumes are pinned to individual hosts. You should create two or more volumes per application. You will have downtime if you only create one. Learn more at https://fly.io/docs/reference/volumes/"
182+
const msg = "Warning! Every volume is pinned to a specific physical host. You should create two or more volumes per application to avoid downtime. Learn more at https://fly.io/docs/reference/volumes/"
183183
fmt.Fprintln(io.ErrOut, colorize.Red(msg))
184184

185185
switch confirmed, err := prompt.Confirm(ctx, "Do you still want to use the volumes feature?"); {

internal/command/volumes/destroy.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ import (
1919

2020
func newDestroy() *cobra.Command {
2121
const (
22-
long = `Destroy a volume`
22+
short = "Destroy a volume."
2323

24-
short = "Destroy a volume"
24+
long = short + " When you destroy a volume, you permanently delete all its data."
2525
)
2626

2727
cmd := command.New("destroy [id]", short, long, runDestroy,
@@ -89,7 +89,7 @@ func runDestroy(ctx context.Context) error {
8989
return fmt.Errorf("failed destroying volume: %w", err)
9090
}
9191

92-
fmt.Fprintf(io.Out, "Destroyed volume %s from %s\n", volID, data.Name)
92+
fmt.Fprintf(io.Out, "Destroyed volume ID: %s name: %s\n", volID, data.Name)
9393

9494
return nil
9595
}
@@ -121,7 +121,7 @@ func confirmVolumeDelete(ctx context.Context, volID string) (bool, error) {
121121

122122
var msg = "Deleting a volume is not reversible."
123123
if matches <= 2 {
124-
msg = fmt.Sprintf("Warning! Individual volumes are pinned to individual hosts. You should create two or more volumes per application. Deleting this volume will leave you with %d volume(s) for this application, and it is not reversible. Learn more at https://fly.io/docs/reference/volumes/", matches-1)
124+
msg = fmt.Sprintf("Warning! Every volume is pinned to a specific physical host. You should create two or more volumes per application. Deleting this volume will leave you with %d volume(s) for this application, and it is not reversible. Learn more at https://fly.io/docs/reference/volumes/", matches-1)
125125
}
126126
fmt.Fprintln(io.ErrOut, colorize.Red(msg))
127127

internal/command/volumes/extend.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ import (
2222

2323
func newExtend() *cobra.Command {
2424
const (
25-
long = `Extends a target volume to the size specified. The instance is automatically restarted for Nomad (V1) apps.
26-
Most Machines (V2 apps) don't require a restart. Older Machines get a message to manually restart the Machine
27-
to increase the size of the FS.`
25+
short = "Extend a volume to the specified size."
2826

29-
short = "Extend a target volume"
27+
long = short + ` Most Machines don't require a restart. Some older Machines get a message to manually restart the Machine to increase the size of the file system.`
3028

3129
usage = "extend [id]"
3230
)
@@ -132,9 +130,9 @@ func runExtend(ctx context.Context) error {
132130

133131
if app.PlatformVersion == "machines" {
134132
if needsRestart {
135-
fmt.Fprintln(out, colorize.Yellow("You will need to stop and start your machine to increase the size of the FS"))
133+
fmt.Fprintln(out, colorize.Yellow("You will need to stop and start your Machine to increase the size of the file system"))
136134
} else {
137-
fmt.Fprintln(out, colorize.Green("Your machine got its volume size extended without needing a restart"))
135+
fmt.Fprintln(out, colorize.Green("Your Machine got its volume size extended without needing a restart"))
138136
}
139137
}
140138

internal/command/volumes/fork.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ import (
2020

2121
func newFork() *cobra.Command {
2222
const (
23-
long = `Volume forking creates an independent copy of a storage volume for backup, testing, and experimentation without altering the original data.`
24-
short = "Forks the specified volume"
23+
short = "Fork the specified volume."
24+
25+
long = short + ` Volume forking creates an independent copy of a storage volume for backup, testing, and experimentation without altering the original data.`
26+
2527
usage = "fork [id]"
2628
)
2729

@@ -38,16 +40,16 @@ func newFork() *cobra.Command {
3840
flag.String{
3941
Name: "name",
4042
Shorthand: "n",
41-
Description: "Name of the new volume",
43+
Description: "The name of the new volume",
4244
},
4345
flag.Bool{
4446
Name: "machines-only",
45-
Description: "volume will be visible to machines platform only",
47+
Description: "volume will be visible to Machines platform only",
4648
Hidden: true,
4749
},
4850
flag.Bool{
4951
Name: "require-unique-zone",
50-
Description: "Require volume to be placed in separate hardware zone from existing volumes",
52+
Description: "Place the volume in a separate hardware zone from existing volumes. This is the default.",
5153
},
5254
)
5355

internal/command/volumes/list.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ import (
1818

1919
func newList() *cobra.Command {
2020
const (
21-
long = "List all the volumes associated with this application."
21+
short = "List the volumes associated with an app."
2222

23-
short = "List the volumes for app"
23+
long = short
2424
)
2525

2626
cmd := command.New("list", short, long, runList,

internal/command/volumes/show.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import (
2020

2121
func newShow() (cmd *cobra.Command) {
2222
const (
23-
long = `Show details of an app's volume`
23+
short = "Show the details of the specified volume."
2424

25-
short = "Show details of an app's volume"
25+
long = short
2626
)
2727

2828
cmd = command.New("show [id]", short, long, runShow,

internal/command/volumes/volumes.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ import (
2626

2727
func New() *cobra.Command {
2828
const (
29-
long = "Commands for managing Fly Volumes associated with an application"
29+
short = "Manage Fly Volumes."
3030

31-
short = "Volume management commands"
31+
long = short
3232

3333
usage = "volumes <command>"
3434
)

0 commit comments

Comments
 (0)