Skip to content

Commit

Permalink
Better null char handling
Browse files Browse the repository at this point in the history
  • Loading branch information
zix99 committed Jul 29, 2024
1 parent 02b0449 commit 9b456df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion cmd/gendocs.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ func gendocCommand() *cli.Command {
text, _ = c.App.ToMarkdown()
text = addDepthToMd(strings.NewReader(text), 1)
}
fmt.Print(strings.ReplaceAll(text, "\x00", "")) //HACK: Some null characters are in generated docs (from array sep?)

// HACK: Some null characters are in generated docs (from array sep?)
// Normal cli help accounts for this, but markdown gen doesn't
fmt.Print(strings.ReplaceAll(text, "\x00", "\\x00"))

return nil
},
Flags: []cli.Flag{
Expand Down
4 changes: 2 additions & 2 deletions docs/cli-help.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Create a 2D heatmap of extracted data

**--csv, -o**="": Write final results to csv. Use - to output to stdout

**--delim**="": Character to tabulate on. Use {$} helper by default (default: )
**--delim**="": Character to tabulate on. Use {$} helper by default (default: \x00)

**--extract, -e**="": Expression that will generate the key to group by. Specify multiple times for multi-dimensions or use {$} helper (default: [{0}])

Expand Down Expand Up @@ -311,7 +311,7 @@ Create a 2D summarizing table of extracted data

**--csv, -o**="": Write final results to csv. Use - to output to stdout

**--delim**="": Character to tabulate on. Use {$} helper by default (default: )
**--delim**="": Character to tabulate on. Use {$} helper by default (default: \x00)

**--extra, -x**: Display row and column totals

Expand Down

0 comments on commit 9b456df

Please sign in to comment.