mirror of
https://github.com/kopia/kopia.git
synced 2025-12-24 07:07:52 -05:00
cli: major refactoring of how CLI commands are registered The goal is to eliminate flags as global variables to allow for better testing. Each command and subcommand and most sets of flags are now their own struct with 'setup()' methods that attached the flags or subcommand to the provided parent. This change is 94.3% mechanical, but is fully organic and hand-made. * introduced cli.appServices interface which provides the environment in which commands run * remove auto-maintenance global flag * removed globals in memory_tracking.go * removed globals from cli_progress.go * removed globals from the update_check.go * moved configPath into TheApp * removed remaining globals from config.go * refactored logfile to get rid of global variables * removed 'app' global variable * linter fixes * fixed password_*.go build * fixed BSD build
12 lines
233 B
Go
12 lines
233 B
Go
package cli
|
|
|
|
type commandSession struct {
|
|
list commandSessionList
|
|
}
|
|
|
|
func (c *commandSession) setup(svc appServices, parent commandParent) {
|
|
cmd := parent.Command("session", "Session commands.").Hidden()
|
|
|
|
c.list.setup(svc, cmd)
|
|
}
|