Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error output and exit code #58

Merged
merged 6 commits into from
Oct 31, 2019
Merged

Better error output and exit code #58

merged 6 commits into from
Oct 31, 2019

Conversation

toshimaru
Copy link
Owner

@toshimaru toshimaru commented Oct 30, 2019

closes #57

Before

$ nyan x go.mod
open x: no such file or directory
module github.com/toshimaru/nyan

go 1.13

require (
	github.com/alecthomas/chroma v0.6.8
	github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1 // indirect
	github.com/dlclark/regexp2 v1.1.8 // indirect
	github.com/mattn/go-colorable v0.1.4
	github.com/mattn/go-isatty v0.0.10
	github.com/spf13/cobra v0.0.5
	github.com/stretchr/testify v1.3.0
)

$ echo $?
0
$ nyan x
open x: no such file or directory
Error: open x: no such file or directory
Usage:
  nyan [OPTION]... [FILE]... [flags]

Examples:
   ...

After

$  go run main.go -- x go.mod
Error: open x: no such file or directory
module github.com/toshimaru/nyan

go 1.13

require (
	github.com/alecthomas/chroma v0.6.8
	github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1 // indirect
	github.com/dlclark/regexp2 v1.1.8 // indirect
	github.com/mattn/go-colorable v0.1.4
	github.com/mattn/go-isatty v0.0.10
	github.com/spf13/cobra v0.0.5
	github.com/stretchr/testify v1.3.0
)
exit status 1

$ echo $?
1
$ go run main.go -- x
Error: open x: no such file or directory
exit status 1

@toshimaru toshimaru self-assigned this Oct 30, 2019
@toshimaru toshimaru merged commit 607496e into master Oct 31, 2019
@toshimaru toshimaru deleted the better-error-out branch October 31, 2019 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid filename Exit Code
1 participant