Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

fix cli errors #273

Closed
wants to merge 1 commit into from
Closed

fix cli errors #273

wants to merge 1 commit into from

Conversation

jay0lee
Copy link
Contributor

@jay0lee jay0lee commented Jul 18, 2016

-codegangsta/cli is now urfave/cli
@@ -161,12 +161,12 @@ var commonCommands = []cli.Command{
}

// getConfig returns a config object
func getConfig(context *cli.Context) *lib.Config {
func getConfig(context *cli.Context) (*lib.Config, error) {
config, _, err := lib.GetConfig(context)
if err != nil {
log.Fatalln(err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered returning err in these kinds of cases?

@agoode agoode self-assigned this Jul 18, 2016
@agoode
Copy link
Contributor

agoode commented Jul 18, 2016

There might be a better way to handle errors now using the cli framework.

If it doesn't seem like the cli error handling would be very helpful, I am happy accepting this change if you put some comments where we call the cli code explaining this.

app.Action = func(context *cli.Context) {
os.Exit(connector(context))
app.Action = func(context *cli.Context) error {
return_code, _ := connector(context)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whitespace here is inconsistent, please run go fmt.

@agoode
Copy link
Contributor

agoode commented Jul 30, 2016

Resolved by #283

@agoode agoode closed this Jul 30, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

codegangsta/cli deprecated cli.App.RunAndExitOnError
3 participants