Skip to content

if we run into a user input err then exit with 1 instead 0 #7

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func write_file(filename string, data string) {
func exit_on_error(message string, err error) {
if err != nil {
fmt.Println(fmt.Sprintf("%s %s: %s", red("[X]"), bold(message), err.Error()))
os.Exit(0)
os.Exit(1)
}
}

Expand Down Expand Up @@ -192,7 +192,7 @@ func contains_any(elements []string, str string) string {
}

func main() {
parser := argparse.NewParser("sammler", "") //, usage_prologue)
parser := argparse.NewParser("sammler", "") // usage prologue
//var out *string = parser.String("o", "out", &argparse.Options{Required: false, Default:"default", Help: "Save found strings to a file"})
var file *[]string = parser.List("f", "file", &argparse.Options{Required: false, Help: "Files/strings to analyze"})
var all *bool = parser.Flag("a", "all", &argparse.Options{Required: false, Help: "Analyze all files from current directory"})
Expand Down