RootCommand creates root command in command tree
()
| 79 | |
| 80 | // RootCommand creates root command in command tree |
| 81 | func RootCommand() *commander.Command { |
| 82 | cmd := &commander.Command{ |
| 83 | UsageLine: os.Args[0], |
| 84 | Short: "Debian repository management tool", |
| 85 | Long: ` |
| 86 | aptly is a tool to create partial and full mirrors of remote |
| 87 | repositories, manage local repositories, filter them, merge, |
| 88 | upgrade individual packages, take snapshots and publish them |
| 89 | back as Debian repositories. |
| 90 | |
| 91 | aptly's goal is to establish repeatability and controlled changes |
| 92 | in a package-centric environment. aptly allows one to fix a set of packages |
| 93 | in a repository, so that package installation and upgrade becomes |
| 94 | deterministic. At the same time aptly allows one to perform controlled, |
| 95 | fine-grained changes in repository contents to transition your |
| 96 | package environment to new version.`, |
| 97 | Flag: *flag.NewFlagSet("aptly", flag.ExitOnError), |
| 98 | Subcommands: []*commander.Command{ |
| 99 | makeCmdConfig(), |
| 100 | makeCmdDB(), |
| 101 | makeCmdGraph(), |
| 102 | makeCmdMirror(), |
| 103 | makeCmdRepo(), |
| 104 | makeCmdServe(), |
| 105 | makeCmdSnapshot(), |
| 106 | makeCmdTask(), |
| 107 | makeCmdPublish(), |
| 108 | makeCmdVersion(), |
| 109 | makeCmdPackage(), |
| 110 | makeCmdAPI(), |
| 111 | }, |
| 112 | } |
| 113 | |
| 114 | cmd.Flag.Int("db-open-attempts", 10, "number of attempts to open DB if it's locked by other instance") |
| 115 | cmd.Flag.Bool("dep-follow-suggests", false, "when processing dependencies, follow Suggests") |
| 116 | cmd.Flag.Bool("dep-follow-source", false, "when processing dependencies, follow from binary to Source packages") |
| 117 | cmd.Flag.Bool("dep-follow-recommends", false, "when processing dependencies, follow Recommends") |
| 118 | cmd.Flag.Bool("dep-follow-all-variants", false, "when processing dependencies, follow a & b if dependency is 'a|b'") |
| 119 | cmd.Flag.Bool("dep-verbose-resolve", false, "when processing dependencies, print detailed logs") |
| 120 | cmd.Flag.String("architectures", "", "list of architectures to consider during (comma-separated), default to all available") |
| 121 | cmd.Flag.String("config", "", "location of configuration file (default locations in order: ~/.aptly.conf, /usr/local/etc/aptly.conf, /etc/aptly.conf)") |
| 122 | cmd.Flag.String("gpg-provider", "", "PGP implementation (\"gpg\", \"gpg1\", \"gpg2\" for external gpg or \"internal\" for Go internal implementation)") |
| 123 | |
| 124 | if aptly.EnableDebug { |
| 125 | cmd.Flag.String("cpuprofile", "", "write cpu profile to file") |
| 126 | cmd.Flag.String("memprofile", "", "write memory profile to this file") |
| 127 | cmd.Flag.String("memstats", "", "write memory stats periodically to this file") |
| 128 | cmd.Flag.Duration("meminterval", 100*time.Millisecond, "memory stats dump interval") |
| 129 | } |
| 130 | return cmd |
| 131 | } |