Skip to content

Commit

Permalink
ensure config blackbox_decode is used consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
stronnag committed Jan 16, 2022
1 parent eba20d2 commit 43e033d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions manual/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,9 @@ For example:

A warning will be displayed if the configuration file in not syntactically correct; in such cases its contents will be ignored. There is a somewhat [complete example](https://github.com/stronnag/bbl2kml/wiki/Sample-Config-file) in the wiki that can be used as a template.

!!! Note "JSON Syntax"
The keys in the JSON file use hyphen (`-`), not underscore (`_`).

Note also that the command interpreter allows `-flag` or `--flag` for any option.

## Limitations, Bugs, Bug Reporting
Expand Down
2 changes: 1 addition & 1 deletion pkg/bbl/bblreader.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func get_durations(fn string, meta []types.FlightMeta) {
}

func get_bb_duration(bbfile string, idx string) time.Duration {
cmd := exec.Command("blackbox_decode", "--stdout", "--index", idx, bbfile)
cmd := exec.Command(options.Config.Blackbox_decode, "--stdout", "--index", idx, bbfile)
out, err := cmd.StdoutPipe()
defer cmd.Wait()
defer out.Close()
Expand Down
5 changes: 5 additions & 0 deletions pkg/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ func ParseCLI(gv func() string) ([]string, string) {
if err != nil {
fmt.Fprintf(os.Stderr, "Warning: config file ignored due to error: %v\n", err)
}

if os.Getenv("DUMP_CONFIG") != "" {
fmt.Fprintf(os.Stderr, "%+v\n", Config)
}

files := flag.Args()
return files, app
}

0 comments on commit 43e033d

Please sign in to comment.