2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-23 19:38:57 +00:00

Merge pull request #1150 from restic/removed-date-from-manpage

Fix manpage generation
This commit is contained in:
Alexander Neumann 2017-08-06 21:46:44 +02:00
commit 2c22ff175c
45 changed files with 31 additions and 115 deletions

View File

@ -19,6 +19,7 @@ for convenience, and the command may need superuser rights, e.g.:
$ sudo restic autocomplete`, $ sudo restic autocomplete`,
DisableAutoGenTag: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
if err := cmdRoot.GenBashCompletionFile(autocompleteTarget); err != nil { if err := cmdRoot.GenBashCompletionFile(autocompleteTarget); err != nil {
return err return err

View File

@ -37,6 +37,7 @@ given as the arguments.
backupOptions.Hostname = hostname backupOptions.Hostname = hostname
} }
}, },
DisableAutoGenTag: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
if backupOptions.Stdin && backupOptions.FilesFrom == "-" { if backupOptions.Stdin && backupOptions.FilesFrom == "-" {
return errors.Fatal("cannot use both `--stdin` and `--files-from -`") return errors.Fatal("cannot use both `--stdin` and `--files-from -`")

View File

@ -20,6 +20,7 @@ var cmdCat = &cobra.Command{
Long: ` Long: `
The "cat" command is used to print internal objects to stdout. The "cat" command is used to print internal objects to stdout.
`, `,
DisableAutoGenTag: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return runCat(globalOptions, args) return runCat(globalOptions, args)
}, },

View File

@ -20,6 +20,7 @@ var cmdCheck = &cobra.Command{
The "check" command tests the repository for errors and reports any errors it The "check" command tests the repository for errors and reports any errors it
finds. It can also be used to read all data and therefore simulate a restore. finds. It can also be used to read all data and therefore simulate a restore.
`, `,
DisableAutoGenTag: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return runCheck(checkOptions, globalOptions, args) return runCheck(checkOptions, globalOptions, args)
}, },

View File

@ -25,6 +25,7 @@ var cmdDump = &cobra.Command{
Long: ` Long: `
The "dump" command dumps data structures from the repository as JSON objects. It The "dump" command dumps data structures from the repository as JSON objects. It
is used for debugging purposes only.`, is used for debugging purposes only.`,
DisableAutoGenTag: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return runDump(globalOptions, args) return runDump(globalOptions, args)
}, },

View File

@ -20,6 +20,7 @@ var cmdFind = &cobra.Command{
Long: ` Long: `
The "find" command searches for files or directories in snapshots stored in the The "find" command searches for files or directories in snapshots stored in the
repo. `, repo. `,
DisableAutoGenTag: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return runFind(findOptions, globalOptions, args) return runFind(findOptions, globalOptions, args)
}, },

View File

@ -18,6 +18,7 @@ The "forget" command removes snapshots according to a policy. Please note that
this command really only deletes the snapshot object in the repository, which this command really only deletes the snapshot object in the repository, which
is a reference to data stored there. In order to remove this (now unreferenced) is a reference to data stored there. In order to remove this (now unreferenced)
data after 'forget' was run successfully, see the 'prune' command. `, data after 'forget' was run successfully, see the 'prune' command. `,
DisableAutoGenTag: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return runForget(forgetOptions, globalOptions, args) return runForget(forgetOptions, globalOptions, args)
}, },

View File

@ -15,6 +15,7 @@ var cmdInit = &cobra.Command{
Long: ` Long: `
The "init" command initializes a new repository. The "init" command initializes a new repository.
`, `,
DisableAutoGenTag: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return runInit(globalOptions, args) return runInit(globalOptions, args)
}, },

View File

@ -17,6 +17,7 @@ var cmdKey = &cobra.Command{
Long: ` Long: `
The "key" command manages keys (passwords) for accessing the repository. The "key" command manages keys (passwords) for accessing the repository.
`, `,
DisableAutoGenTag: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return runKey(globalOptions, args) return runKey(globalOptions, args)
}, },

View File

@ -17,6 +17,7 @@ var cmdList = &cobra.Command{
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.
`, `,
DisableAutoGenTag: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return runList(globalOptions, args) return runList(globalOptions, args)
}, },

View File

@ -19,6 +19,7 @@ The "ls" command allows listing files and directories in a snapshot.
The special snapshot-ID "latest" can be used to list files and directories of the latest snapshot in the repository. The special snapshot-ID "latest" can be used to list files and directories of the latest snapshot in the repository.
`, `,
DisableAutoGenTag: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return runLs(lsOptions, globalOptions, args) return runLs(lsOptions, globalOptions, args)
}, },

View File

@ -16,6 +16,7 @@ The "manpage" command generates a manual page for a single command. It can also
be used to write all manual pages to a directory. If the output directory is be used to write all manual pages to a directory. If the output directory is
set and no command is specified, all manpages are written to the directory. set and no command is specified, all manpages are written to the directory.
`, `,
DisableAutoGenTag: true,
RunE: runManpage, RunE: runManpage,
} }
@ -42,7 +43,10 @@ func runManpage(cmd *cobra.Command, args []string) error {
return doc.GenManTree(cmdRoot, header, dir) return doc.GenManTree(cmdRoot, header, dir)
} }
if len(args) > 1 { switch {
case len(args) == 0:
return errors.Fatalf("no command given")
case len(args) > 1:
return errors.Fatalf("more than one command given: %v", args) return errors.Fatalf("more than one command given: %v", args)
} }

View File

@ -14,6 +14,7 @@ var cmdMigrate = &cobra.Command{
The "migrate" command applies migrations to a repository. When no migration The "migrate" command applies migrations to a repository. When no migration
name is explicitly given, a list of migrations that can be applied is printed. name is explicitly given, a list of migrations that can be applied is printed.
`, `,
DisableAutoGenTag: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return runMigrate(migrateOptions, globalOptions, args) return runMigrate(migrateOptions, globalOptions, args)
}, },

View File

@ -27,6 +27,7 @@ var cmdMount = &cobra.Command{
The "mount" command mounts the repository via fuse to a directory. This is a The "mount" command mounts the repository via fuse to a directory. This is a
read-only mount. read-only mount.
`, `,
DisableAutoGenTag: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return runMount(mountOptions, globalOptions, args) return runMount(mountOptions, globalOptions, args)
}, },

View File

@ -15,6 +15,7 @@ var optionsCmd = &cobra.Command{
The "options" command prints a list of extended options. The "options" command prints a list of extended options.
`, `,
Hidden: true, Hidden: true,
DisableAutoGenTag: true,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("All Extended Options:\n") fmt.Printf("All Extended Options:\n")
for _, opt := range options.List() { for _, opt := range options.List() {

View File

@ -20,6 +20,7 @@ var cmdPrune = &cobra.Command{
The "prune" command checks the repository and removes data that is not The "prune" command checks the repository and removes data that is not
referenced and therefore not needed any more. referenced and therefore not needed any more.
`, `,
DisableAutoGenTag: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return runPrune(globalOptions) return runPrune(globalOptions)
}, },

View File

@ -16,6 +16,7 @@ var cmdRebuildIndex = &cobra.Command{
The "rebuild-index" command creates a new index based on the pack files in the The "rebuild-index" command creates a new index based on the pack files in the
repository. repository.
`, `,
DisableAutoGenTag: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return runRebuildIndex(globalOptions) return runRebuildIndex(globalOptions)
}, },

View File

@ -19,6 +19,7 @@ a directory.
The special snapshot "latest" can be used to restore the latest snapshot in the The special snapshot "latest" can be used to restore the latest snapshot in the
repository. repository.
`, `,
DisableAutoGenTag: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return runRestore(restoreOptions, globalOptions, args) return runRestore(restoreOptions, globalOptions, args)
}, },

View File

@ -17,6 +17,7 @@ var cmdSnapshots = &cobra.Command{
Long: ` Long: `
The "snapshots" command lists all snapshots stored in the repository. The "snapshots" command lists all snapshots stored in the repository.
`, `,
DisableAutoGenTag: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return runSnapshots(snapshotOptions, globalOptions, args) return runSnapshots(snapshotOptions, globalOptions, args)
}, },

View File

@ -22,6 +22,7 @@ add tags to/remove tags from the existing set.
When no snapshot-ID is given, all snapshots matching the host, tag and path filter criteria are modified. When no snapshot-ID is given, all snapshots matching the host, tag and path filter criteria are modified.
`, `,
DisableAutoGenTag: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return runTag(tagOptions, globalOptions, args) return runTag(tagOptions, globalOptions, args)
}, },

View File

@ -13,6 +13,7 @@ var unlockCmd = &cobra.Command{
Long: ` Long: `
The "unlock" command removes stale locks that have been created by other restic processes. The "unlock" command removes stale locks that have been created by other restic processes.
`, `,
DisableAutoGenTag: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return runUnlock(unlockOptions, globalOptions) return runUnlock(unlockOptions, globalOptions)
}, },

View File

@ -14,6 +14,7 @@ var versionCmd = &cobra.Command{
The "version" command prints detailed information about the build environment The "version" command prints detailed information about the build environment
and the version of this software. and the version of this software.
`, `,
DisableAutoGenTag: true,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("restic %s\ncompiled with %v on %v/%v\n", fmt.Printf("restic %s\ncompiled with %v on %v/%v\n",
version, runtime.Version(), runtime.GOOS, runtime.GOARCH) version, runtime.Version(), runtime.GOOS, runtime.GOARCH)

View File

@ -27,6 +27,7 @@ directories in an encrypted repository stored on different backends.
`, `,
SilenceErrors: true, SilenceErrors: true,
SilenceUsage: true, SilenceUsage: true,
DisableAutoGenTag: true,
PersistentPreRunE: func(*cobra.Command, []string) error { PersistentPreRunE: func(*cobra.Command, []string) error {
// parse extended options // parse extended options

View File

@ -68,8 +68,3 @@ $ sudo restic autocomplete
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -94,8 +94,3 @@ given as the arguments.
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -53,8 +53,3 @@ The "cat" command is used to print internal objects to stdout.
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -62,8 +62,3 @@ finds. It can also be used to read all data and therefore simulate a restore.
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -54,8 +54,3 @@ is used for debugging purposes only.
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -86,8 +86,3 @@ repo.
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -112,8 +112,3 @@ data after 'forget' was run successfully, see the 'prune' command.
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -53,8 +53,3 @@ The "init" command initializes a new repository.
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -53,8 +53,3 @@ The "key" command manages keys (passwords) for accessing the repository.
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -53,8 +53,3 @@ The "list" command allows listing objects in the repository based on type.
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -72,8 +72,3 @@ The special snapshot\-ID "latest" can be used to list files and directories of t
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -59,8 +59,3 @@ set and no command is specified, all manpages are written to the directory.
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -58,8 +58,3 @@ name is explicitly given, a list of migrations that can be applied is printed.
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -78,8 +78,3 @@ read\-only mount.
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -54,8 +54,3 @@ referenced and therefore not needed any more.
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -54,8 +54,3 @@ repository.
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -82,8 +82,3 @@ repository.
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -65,8 +65,3 @@ The "snapshots" command lists all snapshots stored in the repository.
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -84,8 +84,3 @@ When no snapshot\-ID is given, all snapshots matching the host, tag and path fil
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -57,8 +57,3 @@ The "unlock" command removes stale locks that have been created by other restic
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -54,8 +54,3 @@ and the version of this software.
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic(1)\fP \fBrestic(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra

View File

@ -52,8 +52,3 @@ directories in an encrypted repository stored on different backends.
.SH SEE ALSO .SH SEE ALSO
.PP .PP
\fBrestic\-autocomplete(1)\fP, \fBrestic\-backup(1)\fP, \fBrestic\-cat(1)\fP, \fBrestic\-check(1)\fP, \fBrestic\-dump(1)\fP, \fBrestic\-find(1)\fP, \fBrestic\-forget(1)\fP, \fBrestic\-init(1)\fP, \fBrestic\-key(1)\fP, \fBrestic\-list(1)\fP, \fBrestic\-ls(1)\fP, \fBrestic\-manpage(1)\fP, \fBrestic\-migrate(1)\fP, \fBrestic\-mount(1)\fP, \fBrestic\-prune(1)\fP, \fBrestic\-rebuild\-index(1)\fP, \fBrestic\-restore(1)\fP, \fBrestic\-snapshots(1)\fP, \fBrestic\-tag(1)\fP, \fBrestic\-unlock(1)\fP, \fBrestic\-version(1)\fP \fBrestic\-autocomplete(1)\fP, \fBrestic\-backup(1)\fP, \fBrestic\-cat(1)\fP, \fBrestic\-check(1)\fP, \fBrestic\-dump(1)\fP, \fBrestic\-find(1)\fP, \fBrestic\-forget(1)\fP, \fBrestic\-init(1)\fP, \fBrestic\-key(1)\fP, \fBrestic\-list(1)\fP, \fBrestic\-ls(1)\fP, \fBrestic\-manpage(1)\fP, \fBrestic\-migrate(1)\fP, \fBrestic\-mount(1)\fP, \fBrestic\-prune(1)\fP, \fBrestic\-rebuild\-index(1)\fP, \fBrestic\-restore(1)\fP, \fBrestic\-snapshots(1)\fP, \fBrestic\-tag(1)\fP, \fBrestic\-unlock(1)\fP, \fBrestic\-version(1)\fP
.SH HISTORY
.PP
5\-Aug\-2017 Auto generated by spf13/cobra