Skip to content

Commit

Permalink
Improve parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
creekorful committed Oct 30, 2021
1 parent fba5ab3 commit 5323cae
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions parakeet.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,23 @@ func main() {

flag.Parse()

if *inputFileFlag == "" {
log.Fatalf("missing -input")
}

channelName := trimSuffixes(filepath.Base(*inputFileFlag), []string{".txt", ".log"})

if *outputFileFlag == "" {
*outputFileFlag = channelName + ".html"
}

inputFile, err := os.Open(*inputFileFlag)
if err != nil {
panic(err)
log.Fatal(err)
}
defer inputFile.Close()

ch, err := parseLog(trimSuffixes(filepath.Base(*inputFileFlag), []string{".txt", ".log"}), inputFile)
ch, err := parseLog(channelName, inputFile)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 5323cae

Please sign in to comment.