cmd: switch to --connect and --listen flags

Signed-off-by: Aleksa Sarai <asarai@suse.de>
This commit is contained in:
Aleksa Sarai 2016-10-10 20:57:17 +11:00
parent 316e85f0b4
commit 3f48986ea0
No known key found for this signature in database
GPG key ID: 9E18AA267DDB8DB4
3 changed files with 9 additions and 8 deletions

View file

@ -53,7 +53,7 @@ func main() {
Usage: "ocid container dir",
},
cli.StringFlag{
Name: "socket",
Name: "listen",
Value: "/var/run/ocid.sock",
Usage: "path to ocid socket",
},
@ -67,7 +67,7 @@ func main() {
Usage: "enable debug output for logging",
},
cli.BoolFlag{
Name: "selinux-enabled",
Name: "selinux",
Usage: "enable selinux support",
},
cli.StringFlag{
@ -86,7 +86,7 @@ func main() {
if c.GlobalBool("debug") {
logrus.SetLevel(logrus.DebugLevel)
}
if !c.GlobalBool("selinux-enabled") {
if !c.GlobalBool("selinux") {
selinux.SetDisabled()
}
if path := c.GlobalString("log"); path != "" {
@ -108,11 +108,12 @@ func main() {
default:
return fmt.Errorf("unknown log-format %q", c.GlobalString("log-format"))
}
return nil
}
app.Action = func(c *cli.Context) error {
socketPath := c.String("socket")
socketPath := c.String("listen")
// Remove the socket if it already exists
if _, err := os.Stat(socketPath); err == nil {
if err := os.Remove(socketPath); err != nil {