Skip to content

Commit

Permalink
Merge pull request #186 from ipfs/fix/bad-subcommand
Browse files Browse the repository at this point in the history
ipfs-cluster-service: Do not run with unknown subcommands
  • Loading branch information
ZenGround0 committed Oct 20, 2017
2 parents 03b21bf + eca012b commit 4a87599
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ipfs-cluster-service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ configuration.
},
},
{
Name: "run",
Name: "daemon",
Usage: "run the IPFS Cluster peer (default)",
Action: run,
Action: daemon,
},
}

Expand All @@ -253,7 +253,15 @@ configuration.
app.Run(os.Args)
}

// run daemon() by default, or error.
func run(c *cli.Context) error {
if len(c.Args()) > 0 {
return fmt.Errorf("Unknown subcommand. Run \"%s help\" for more info", programName)
}
return daemon(c)
}

func daemon(c *cli.Context) error {
// Load all the configurations
cfg, clusterCfg, apiCfg, ipfshttpCfg, consensusCfg, monCfg, diskInfCfg, numpinInfCfg := makeConfigs()
err := cfg.LoadJSONFromFile(configPath)
Expand Down

0 comments on commit 4a87599

Please sign in to comment.