mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
change from line buffer output to unbuffer output
This commit is contained in:
@ -185,11 +185,11 @@ The JSON output can be compact (default) or pretty formatted with the `-p` optio
|
|||||||
- `-a` about `jc`. Prints information about `jc` and the parsers (in JSON, of course!)
|
- `-a` about `jc`. Prints information about `jc` and the parsers (in JSON, of course!)
|
||||||
- `-d` debug mode. Prints trace messages if parsing issues are encountered (use `-dd` for verbose debugging)
|
- `-d` debug mode. Prints trace messages if parsing issues are encountered (use `-dd` for verbose debugging)
|
||||||
- `-h` help. Use `jc -h --parser_name` for parser documentation
|
- `-h` help. Use `jc -h --parser_name` for parser documentation
|
||||||
- `-l` line buffer output
|
|
||||||
- `-m` monochrome JSON output
|
- `-m` monochrome JSON output
|
||||||
- `-p` pretty format the JSON output
|
- `-p` pretty format the JSON output
|
||||||
- `-q` quiet mode. Suppresses parser warning messages
|
- `-q` quiet mode. Suppresses parser warning messages
|
||||||
- `-r` raw output. Provides a more literal JSON output, typically with string values and no additional semantic processing
|
- `-r` raw output. Provides a more literal JSON output, typically with string values and no additional semantic processing
|
||||||
|
- `-u` unbuffer output
|
||||||
- `-v` version information
|
- `-v` version information
|
||||||
|
|
||||||
### Exit Codes
|
### Exit Codes
|
||||||
|
@ -331,11 +331,11 @@ def helptext():
|
|||||||
-a about jc
|
-a about jc
|
||||||
-d debug (-dd for verbose debug)
|
-d debug (-dd for verbose debug)
|
||||||
-h help (-h --parser_name for parser documentation)
|
-h help (-h --parser_name for parser documentation)
|
||||||
-l line buffer output
|
|
||||||
-m monochrome output
|
-m monochrome output
|
||||||
-p pretty print output
|
-p pretty print output
|
||||||
-q quiet - suppress parser warnings
|
-q quiet - suppress parser warnings
|
||||||
-r raw JSON output
|
-r raw JSON output
|
||||||
|
-u unbuffer output
|
||||||
-v version info
|
-v version info
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
@ -522,12 +522,12 @@ def main():
|
|||||||
about = 'a' in options
|
about = 'a' in options
|
||||||
debug = 'd' in options
|
debug = 'd' in options
|
||||||
verbose_debug = True if options.count('d') > 1 else False
|
verbose_debug = True if options.count('d') > 1 else False
|
||||||
linebuf = 'l' in options
|
|
||||||
mono = 'm' in options
|
mono = 'm' in options
|
||||||
help_me = 'h' in options
|
help_me = 'h' in options
|
||||||
pretty = 'p' in options
|
pretty = 'p' in options
|
||||||
quiet = 'q' in options
|
quiet = 'q' in options
|
||||||
raw = 'r' in options
|
raw = 'r' in options
|
||||||
|
unbuffer = 'u' in options
|
||||||
version_info = 'v' in options
|
version_info = 'v' in options
|
||||||
|
|
||||||
if verbose_debug:
|
if verbose_debug:
|
||||||
@ -628,7 +628,7 @@ def main():
|
|||||||
env_colors=jc_colors,
|
env_colors=jc_colors,
|
||||||
mono=mono,
|
mono=mono,
|
||||||
piped_out=piped_output()),
|
piped_out=piped_output()),
|
||||||
flush=linebuf)
|
flush=unbuffer)
|
||||||
|
|
||||||
sys.exit(combined_exit_code(magic_exit_code, 0))
|
sys.exit(combined_exit_code(magic_exit_code, 0))
|
||||||
|
|
||||||
@ -641,7 +641,7 @@ def main():
|
|||||||
env_colors=jc_colors,
|
env_colors=jc_colors,
|
||||||
mono=mono,
|
mono=mono,
|
||||||
piped_out=piped_output()),
|
piped_out=piped_output()),
|
||||||
flush=linebuf)
|
flush=unbuffer)
|
||||||
|
|
||||||
sys.exit(combined_exit_code(magic_exit_code, 0))
|
sys.exit(combined_exit_code(magic_exit_code, 0))
|
||||||
|
|
||||||
|
10
man/jc.1
10
man/jc.1
@ -1,4 +1,4 @@
|
|||||||
.TH jc 1 2021-09-13 1.17.0 "JSON CLI output utility"
|
.TH jc 1 2021-09-16 1.17.0 "JSON CLI output utility"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
jc \- JSONifies the output of many CLI tools and file-types
|
jc \- JSONifies the output of many CLI tools and file-types
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@ -418,10 +418,6 @@ debug - show traceback (\fB-dd\fP for verbose traceback)
|
|||||||
help (\fB-h --parser_name\fP for parser documentation)
|
help (\fB-h --parser_name\fP for parser documentation)
|
||||||
.TP
|
.TP
|
||||||
.B
|
.B
|
||||||
\fB-l\fP
|
|
||||||
line buffer output
|
|
||||||
.TP
|
|
||||||
.B
|
|
||||||
\fB-m\fP
|
\fB-m\fP
|
||||||
monochrome output
|
monochrome output
|
||||||
.TP
|
.TP
|
||||||
@ -438,6 +434,10 @@ quiet - suppress warnings
|
|||||||
raw JSON output
|
raw JSON output
|
||||||
.TP
|
.TP
|
||||||
.B
|
.B
|
||||||
|
\fB-u\fP
|
||||||
|
unbuffer output (useful for slow streaming data with streaming parsers)
|
||||||
|
.TP
|
||||||
|
.B
|
||||||
\fB-v\fP
|
\fB-v\fP
|
||||||
version information
|
version information
|
||||||
|
|
||||||
|
@ -43,10 +43,6 @@ debug - show traceback (\fB-dd\fP for verbose traceback)
|
|||||||
help (\fB-h --parser_name\fP for parser documentation)
|
help (\fB-h --parser_name\fP for parser documentation)
|
||||||
.TP
|
.TP
|
||||||
.B
|
.B
|
||||||
\fB-l\fP
|
|
||||||
line buffer output
|
|
||||||
.TP
|
|
||||||
.B
|
|
||||||
\fB-m\fP
|
\fB-m\fP
|
||||||
monochrome output
|
monochrome output
|
||||||
.TP
|
.TP
|
||||||
@ -63,6 +59,10 @@ quiet - suppress warnings
|
|||||||
raw JSON output
|
raw JSON output
|
||||||
.TP
|
.TP
|
||||||
.B
|
.B
|
||||||
|
\fB-u\fP
|
||||||
|
unbuffer output (useful for slow streaming data with streaming parsers)
|
||||||
|
.TP
|
||||||
|
.B
|
||||||
\fB-v\fP
|
\fB-v\fP
|
||||||
version information
|
version information
|
||||||
|
|
||||||
|
@ -110,11 +110,11 @@ The JSON output can be compact (default) or pretty formatted with the `-p` optio
|
|||||||
- `-a` about `jc`. Prints information about `jc` and the parsers (in JSON, of course!)
|
- `-a` about `jc`. Prints information about `jc` and the parsers (in JSON, of course!)
|
||||||
- `-d` debug mode. Prints trace messages if parsing issues are encountered (use `-dd` for verbose debugging)
|
- `-d` debug mode. Prints trace messages if parsing issues are encountered (use `-dd` for verbose debugging)
|
||||||
- `-h` help. Use `jc -h --parser_name` for parser documentation
|
- `-h` help. Use `jc -h --parser_name` for parser documentation
|
||||||
- `-l` line buffer output
|
|
||||||
- `-m` monochrome JSON output
|
- `-m` monochrome JSON output
|
||||||
- `-p` pretty format the JSON output
|
- `-p` pretty format the JSON output
|
||||||
- `-q` quiet mode. Suppresses parser warning messages
|
- `-q` quiet mode. Suppresses parser warning messages
|
||||||
- `-r` raw output. Provides a more literal JSON output, typically with string values and no additional semantic processing
|
- `-r` raw output. Provides a more literal JSON output, typically with string values and no additional semantic processing
|
||||||
|
- `-u` unbuffer output
|
||||||
- `-v` version information
|
- `-v` version information
|
||||||
|
|
||||||
### Exit Codes
|
### Exit Codes
|
||||||
|
Reference in New Issue
Block a user