From 9922ce97bfe1d1362bd8b66cdede89d39a674c57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Olsen?= Date: Mon, 13 Feb 2017 16:02:47 +0100 Subject: [PATCH 1/5] Use lowercase consistently in help text --- src/cmds/restic/cmd_backup.go | 4 ++-- src/cmds/restic/cmd_check.go | 4 ++-- src/cmds/restic/cmd_find.go | 6 +++--- src/cmds/restic/cmd_unlock.go | 2 +- src/cmds/restic/cmd_version.go | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/cmds/restic/cmd_backup.go b/src/cmds/restic/cmd_backup.go index 7af1a5df9..dca861298 100644 --- a/src/cmds/restic/cmd_backup.go +++ b/src/cmds/restic/cmd_backup.go @@ -68,10 +68,10 @@ func init() { f := cmdBackup.Flags() f.StringVar(&backupOptions.Parent, "parent", "", "use this parent snapshot (default: last snapshot in the repo that has the same target files/directories)") - f.BoolVarP(&backupOptions.Force, "force", "f", false, `force re-reading the target files/directories. Overrides the "parent" flag`) + f.BoolVarP(&backupOptions.Force, "force", "f", false, `force re-reading the target files/directories (overrides the "parent" flag)`) f.StringSliceVarP(&backupOptions.Excludes, "exclude", "e", []string{}, "exclude a `pattern` (can be specified multiple times)") f.StringVar(&backupOptions.ExcludeFile, "exclude-file", "", "read exclude patterns from a file") - f.BoolVarP(&backupOptions.ExcludeOtherFS, "one-file-system", "x", false, "Exclude other file systems") + f.BoolVarP(&backupOptions.ExcludeOtherFS, "one-file-system", "x", false, "exclude other file systems") f.BoolVar(&backupOptions.Stdin, "stdin", false, "read backup from stdin") f.StringVar(&backupOptions.StdinFilename, "stdin-filename", "stdin", "file name to use when reading from stdin") f.StringSliceVar(&backupOptions.Tags, "tag", []string{}, "add a `tag` for the new snapshot (can be specified multiple times)") diff --git a/src/cmds/restic/cmd_check.go b/src/cmds/restic/cmd_check.go index 093bbe1b2..074cf6f27 100644 --- a/src/cmds/restic/cmd_check.go +++ b/src/cmds/restic/cmd_check.go @@ -38,8 +38,8 @@ func init() { cmdRoot.AddCommand(cmdCheck) f := cmdCheck.Flags() - f.BoolVar(&checkOptions.ReadData, "read-data", false, "Read all data blobs") - f.BoolVar(&checkOptions.CheckUnused, "check-unused", false, "Find unused blobs") + f.BoolVar(&checkOptions.ReadData, "read-data", false, "read all data blobs") + f.BoolVar(&checkOptions.CheckUnused, "check-unused", false, "find unused blobs") } func newReadProgress(gopts GlobalOptions, todo restic.Stat) *restic.Progress { diff --git a/src/cmds/restic/cmd_find.go b/src/cmds/restic/cmd_find.go index 0dfe32085..0eef529a6 100644 --- a/src/cmds/restic/cmd_find.go +++ b/src/cmds/restic/cmd_find.go @@ -36,9 +36,9 @@ func init() { cmdRoot.AddCommand(cmdFind) f := cmdFind.Flags() - f.StringVarP(&findOptions.Oldest, "oldest", "o", "", "Oldest modification date/time") - f.StringVarP(&findOptions.Newest, "newest", "n", "", "Newest modification date/time") - f.StringVarP(&findOptions.Snapshot, "snapshot", "s", "", "Snapshot ID to search in") + f.StringVarP(&findOptions.Oldest, "oldest", "o", "", "oldest modification date/time") + f.StringVarP(&findOptions.Newest, "newest", "n", "", "newest modification date/time") + f.StringVarP(&findOptions.Snapshot, "snapshot", "s", "", "snapshot ID to search in") } type findPattern struct { diff --git a/src/cmds/restic/cmd_unlock.go b/src/cmds/restic/cmd_unlock.go index 38004ea64..6601909cb 100644 --- a/src/cmds/restic/cmd_unlock.go +++ b/src/cmds/restic/cmd_unlock.go @@ -27,7 +27,7 @@ var unlockOptions UnlockOptions func init() { cmdRoot.AddCommand(unlockCmd) - unlockCmd.Flags().BoolVar(&unlockOptions.RemoveAll, "remove-all", false, "Remove all locks, even non-stale ones") + unlockCmd.Flags().BoolVar(&unlockOptions.RemoveAll, "remove-all", false, "remove all locks, even non-stale ones") } func runUnlock(opts UnlockOptions, gopts GlobalOptions) error { diff --git a/src/cmds/restic/cmd_version.go b/src/cmds/restic/cmd_version.go index 9290af0a3..d13ec068f 100644 --- a/src/cmds/restic/cmd_version.go +++ b/src/cmds/restic/cmd_version.go @@ -9,7 +9,7 @@ import ( var versionCmd = &cobra.Command{ Use: "version", - Short: "Print version information", + Short: "print version information", Long: ` The "version" command prints detailed information about the build environment and the version of this software. From 2eb75bb941ebb1b0f4041248e9e43289c7eda5d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Olsen?= Date: Mon, 13 Feb 2017 16:05:25 +0100 Subject: [PATCH 2/5] Consistently refer to 'the' instead of 'a' repository in help text --- src/cmds/restic/cmd_dump.go | 2 +- src/cmds/restic/cmd_key.go | 2 +- src/cmds/restic/cmd_list.go | 2 +- src/cmds/restic/cmd_snapshots.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cmds/restic/cmd_dump.go b/src/cmds/restic/cmd_dump.go index 2f3ad0149..350e4d7dd 100644 --- a/src/cmds/restic/cmd_dump.go +++ b/src/cmds/restic/cmd_dump.go @@ -22,7 +22,7 @@ var cmdDump = &cobra.Command{ Use: "dump [indexes|snapshots|trees|all|packs]", Short: "dump data structures", Long: ` -The "dump" command dumps data structures from a repository as JSON objects. It +The "dump" command dumps data structures from the repository as JSON objects. It is used for debugging purposes only.`, RunE: func(cmd *cobra.Command, args []string) error { return runDump(globalOptions, args) diff --git a/src/cmds/restic/cmd_key.go b/src/cmds/restic/cmd_key.go index db5365d67..2fba516d9 100644 --- a/src/cmds/restic/cmd_key.go +++ b/src/cmds/restic/cmd_key.go @@ -14,7 +14,7 @@ var cmdKey = &cobra.Command{ Use: "key [list|add|rm|passwd] [ID]", Short: "manage keys (passwords)", Long: ` -The "key" command manages keys (passwords) for accessing a repository. +The "key" command manages keys (passwords) for accessing the repository. `, RunE: func(cmd *cobra.Command, args []string) error { return runKey(globalOptions, args) diff --git a/src/cmds/restic/cmd_list.go b/src/cmds/restic/cmd_list.go index 6eb321b5d..6f35ed7b3 100644 --- a/src/cmds/restic/cmd_list.go +++ b/src/cmds/restic/cmd_list.go @@ -11,7 +11,7 @@ import ( var cmdList = &cobra.Command{ Use: "list [blobs|packs|index|snapshots|keys|locks]", - Short: "list items in the repository", + Short: "list objects in the repository", Long: ` `, diff --git a/src/cmds/restic/cmd_snapshots.go b/src/cmds/restic/cmd_snapshots.go index e4cedcaf4..92a9084ac 100644 --- a/src/cmds/restic/cmd_snapshots.go +++ b/src/cmds/restic/cmd_snapshots.go @@ -15,7 +15,7 @@ var cmdSnapshots = &cobra.Command{ Use: "snapshots", Short: "list all snapshots", Long: ` -The "snapshots" command lists all snapshots stored in a repository. +The "snapshots" command lists all snapshots stored in the repository. `, RunE: func(cmd *cobra.Command, args []string) error { return runSnapshots(snapshotOptions, globalOptions, args) From 514a11346d9471f4d50ea890410d17245d27db37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Olsen?= Date: Mon, 13 Feb 2017 16:06:27 +0100 Subject: [PATCH 3/5] Add long description of list command in help text --- src/cmds/restic/cmd_list.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmds/restic/cmd_list.go b/src/cmds/restic/cmd_list.go index 6f35ed7b3..105f70a5e 100644 --- a/src/cmds/restic/cmd_list.go +++ b/src/cmds/restic/cmd_list.go @@ -13,7 +13,7 @@ var cmdList = &cobra.Command{ Use: "list [blobs|packs|index|snapshots|keys|locks]", Short: "list objects in the repository", Long: ` - +The "list" command allows listing objects in the repository based on type. `, RunE: func(cmd *cobra.Command, args []string) error { return runList(globalOptions, args) From 511278b66aa7871093845a6beab23ea2a0e4cb66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Olsen?= Date: Mon, 13 Feb 2017 16:07:29 +0100 Subject: [PATCH 4/5] Fix wrong description of rebuild-index command in help text --- src/cmds/restic/cmd_rebuild_index.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmds/restic/cmd_rebuild_index.go b/src/cmds/restic/cmd_rebuild_index.go index 2dfac08f8..e4a6c680a 100644 --- a/src/cmds/restic/cmd_rebuild_index.go +++ b/src/cmds/restic/cmd_rebuild_index.go @@ -10,8 +10,8 @@ var cmdRebuildIndex = &cobra.Command{ Use: "rebuild-index [flags]", Short: "build a new index file", Long: ` -The "rebuild-index" command creates a new index by combining the index files -into a new one. +The "rebuild-index" command creates a new index based on the pack files in the +repository. `, RunE: func(cmd *cobra.Command, args []string) error { return runRebuildIndex(globalOptions) From c35e48291d1612b233d4d5feae734f1be081e55e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Olsen?= Date: Mon, 13 Feb 2017 16:16:34 +0100 Subject: [PATCH 5/5] Fix correct number of arguments for key command --- src/cmds/restic/cmd_key.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmds/restic/cmd_key.go b/src/cmds/restic/cmd_key.go index 2fba516d9..7e51def40 100644 --- a/src/cmds/restic/cmd_key.go +++ b/src/cmds/restic/cmd_key.go @@ -120,7 +120,7 @@ func changePassword(gopts GlobalOptions, repo *repository.Repository) error { } func runKey(gopts GlobalOptions, args []string) error { - if len(args) < 1 || (args[0] == "rm" && len(args) != 2) { + if len(args) < 1 || (args[0] == "rm" && len(args) != 2) || (args[0] != "rm" && len(args) != 1) { return errors.Fatal("wrong number of arguments") }