mirror of
https://github.com/restic/restic.git
synced 2025-10-19 07:33:21 +00:00

Rough steps: ``` mv cmd/restic/global* cmd/restic/secondary_repo* internal/global/ sed -i "s/package main/package global/" internal/global/*.go Rename "GlobalOptions" to "Options" in internal/global/ Replace everywhere " GlobalOptions" -> " global.Options" Replace everywhere "\*GlobalOptions" -> " *global.Options" Make SecondaryRepoOptions public Make create public Make version public ```
27 lines
589 B
Go
27 lines
589 B
Go
package main
|
|
|
|
import (
|
|
"github.com/restic/restic/internal/global"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func newKeyCommand(globalOptions *global.Options) *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "key",
|
|
Short: "Manage keys (passwords)",
|
|
Long: `
|
|
The "key" command allows you to set multiple access keys or passwords
|
|
per repository.
|
|
`,
|
|
DisableAutoGenTag: true,
|
|
GroupID: cmdGroupDefault,
|
|
}
|
|
|
|
cmd.AddCommand(
|
|
newKeyAddCommand(globalOptions),
|
|
newKeyListCommand(globalOptions),
|
|
newKeyPasswdCommand(globalOptions),
|
|
newKeyRemoveCommand(globalOptions),
|
|
)
|
|
return cmd
|
|
}
|