2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-29 00:06:32 +00:00

Update usage strings to put flags before args

The standard UNIX-style ordering of command-line arguments places
optional flags before other positional arguments. All of restic's
commands support this ordering, but some of the usage strings showed the
flags after the positional arguments (which restic also parses just
fine). This change updates the doc strings to reflect the standard
ordering.

Because the `restic help` command comes directly from Cobra, there does
not appear to be a way to update the argument ordering in its usage
string, so it maintains the non-standard ordering (positional arguments
before optional flags).
This commit is contained in:
Jason Cox 2020-08-27 03:29:43 +00:00
parent eb7c00387c
commit 2447f3f110
7 changed files with 7 additions and 7 deletions

View File

@ -14,7 +14,7 @@ import (
) )
var cmdDiff = &cobra.Command{ var cmdDiff = &cobra.Command{
Use: "diff snapshot-ID snapshot-ID", Use: "diff [flags] snapshot-ID snapshot-ID",
Short: "Show differences between two snapshots", Short: "Show differences between two snapshots",
Long: ` Long: `
The "diff" command shows differences from the first to the second snapshot. The The "diff" command shows differences from the first to the second snapshot. The

View File

@ -9,7 +9,7 @@ import (
) )
var cmdGenerate = &cobra.Command{ var cmdGenerate = &cobra.Command{
Use: "generate [command]", Use: "generate [flags]",
Short: "Generate manual pages and auto-completion files (bash, zsh)", Short: "Generate manual pages and auto-completion files (bash, zsh)",
Long: ` Long: `
The "generate" command writes automatically generated files (like the man pages The "generate" command writes automatically generated files (like the man pages

View File

@ -16,7 +16,7 @@ import (
) )
var cmdKey = &cobra.Command{ var cmdKey = &cobra.Command{
Use: "key [list|add|remove|passwd] [ID]", Use: "key [flags] [list|add|remove|passwd] [ID]",
Short: "Manage keys (passwords)", Short: "Manage keys (passwords)",
Long: ` Long: `
The "key" command manages keys (passwords) for accessing the repository. The "key" command manages keys (passwords) for accessing the repository.

View File

@ -9,7 +9,7 @@ import (
) )
var cmdList = &cobra.Command{ var cmdList = &cobra.Command{
Use: "list [blobs|packs|index|snapshots|keys|locks]", Use: "list [flags] [blobs|packs|index|snapshots|keys|locks]",
Short: "List objects in the repository", Short: "List objects in the repository",
Long: ` Long: `
The "list" command allows listing objects in the repository based on type. The "list" command allows listing objects in the repository based on type.

View File

@ -8,7 +8,7 @@ import (
) )
var cmdMigrate = &cobra.Command{ var cmdMigrate = &cobra.Command{
Use: "migrate [name]", Use: "migrate [flags] [name]",
Short: "Apply migrations", Short: "Apply migrations",
Long: ` Long: `
The "migrate" command applies migrations to a repository. When no migration The "migrate" command applies migrations to a repository. When no migration

View File

@ -14,7 +14,7 @@ import (
) )
var cmdSnapshots = &cobra.Command{ var cmdSnapshots = &cobra.Command{
Use: "snapshots [snapshotID ...]", Use: "snapshots [flags] [snapshotID ...]",
Short: "List all snapshots", Short: "List all snapshots",
Long: ` Long: `
The "snapshots" command lists all snapshots stored in the repository. The "snapshots" command lists all snapshots stored in the repository.

View File

@ -292,7 +292,7 @@ Restic can write out man pages and bash/zsh compatible autocompletion scripts:
and the auto-completion files for bash and zsh). and the auto-completion files for bash and zsh).
Usage: Usage:
restic generate [command] [flags] restic generate [flags] [command]
Flags: Flags:
--bash-completion file write bash completion file --bash-completion file write bash completion file