()
| 85 | ) |
| 86 | |
| 87 | func main() { |
| 88 | app := cli.NewApp() |
| 89 | app.Name = "runc" |
| 90 | app.Version = strings.TrimSpace(version) + extraVersion |
| 91 | app.Usage = usage |
| 92 | |
| 93 | cli.VersionPrinter = printVersion |
| 94 | |
| 95 | root := "/run/runc" |
| 96 | xdgDirUsed := false |
| 97 | xdgRuntimeDir := os.Getenv("XDG_RUNTIME_DIR") |
| 98 | if xdgRuntimeDir != "" && shouldHonorXDGRuntimeDir() { |
| 99 | root = xdgRuntimeDir + "/runc" |
| 100 | xdgDirUsed = true |
| 101 | } |
| 102 | |
| 103 | app.Flags = []cli.Flag{ |
| 104 | cli.BoolFlag{ |
| 105 | Name: "debug", |
| 106 | Usage: "enable debug logging", |
| 107 | }, |
| 108 | cli.StringFlag{ |
| 109 | Name: "log", |
| 110 | Value: "", |
| 111 | Usage: "set the log file to write runc logs to (default is '/dev/stderr')", |
| 112 | }, |
| 113 | cli.StringFlag{ |
| 114 | Name: "log-format", |
| 115 | Value: "text", |
| 116 | Usage: "set the log format ('text' (default), or 'json')", |
| 117 | }, |
| 118 | cli.StringFlag{ |
| 119 | Name: "root", |
| 120 | Value: root, |
| 121 | Usage: "root directory for storage of container state (this should be located in tmpfs)", |
| 122 | }, |
| 123 | cli.BoolFlag{ |
| 124 | Name: "systemd-cgroup", |
| 125 | Usage: "enable systemd cgroup support, expects cgroupsPath to be of form \"slice:prefix:name\" for e.g. \"system.slice:runc:434234\"", |
| 126 | }, |
| 127 | cli.StringFlag{ |
| 128 | Name: "rootless", |
| 129 | Value: "auto", |
| 130 | Usage: "ignore cgroup permission errors ('true', 'false', or 'auto')", |
| 131 | }, |
| 132 | } |
| 133 | app.Commands = []cli.Command{ |
| 134 | checkpointCommand, |
| 135 | createCommand, |
| 136 | deleteCommand, |
| 137 | eventsCommand, |
| 138 | execCommand, |
| 139 | killCommand, |
| 140 | listCommand, |
| 141 | pauseCommand, |
| 142 | psCommand, |
| 143 | restoreCommand, |
| 144 | resumeCommand, |
nothing calls this directly
no test coverage detected
searching dependent graphs…