1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-13 01:20:24 +02:00

doc update

This commit is contained in:
Kelly Brazil
2022-06-05 17:40:05 -07:00
parent 26415e2978
commit da6c98826b
6 changed files with 99 additions and 2 deletions

View File

@ -210,6 +210,7 @@ option.
| ` --ping-s` | `ping` and `ping6` command streaming parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/ping_s) |
| ` --pip-list` | `pip list` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/pip_list) |
| ` --pip-show` | `pip show` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/pip_show) |
| ` --postconf` | `postconf -M` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/postconf) |
| ` --ps` | `ps` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/ps) |
| ` --route` | `route` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/route) |
| ` --rpm-qi` | `rpm -qi` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/rpm_qi) |
@ -266,6 +267,8 @@ option.
- `-u` unbuffer output
- `-v` version information
- `-y` YAML output
- `-B` generate Bash shell completion script
- `-Z` generate Zsh shell completion script
### Exit Codes
Any fatal errors within `jc` will generate an exit code of `100`, otherwise the

View File

@ -128,4 +128,4 @@ Returns:
### Parser Information
Compatibility: linux, darwin, aix, freebsd
Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com)
Version 1.5 by Kelly Brazil (kellyjonbrazil@gmail.com)

71
docs/parsers/postconf.md Normal file
View File

@ -0,0 +1,71 @@
[Home](https://kellyjonbrazil.github.io/jc/)
<a id="jc.parsers.postconf"></a>
# jc.parsers.postconf
jc - JSON Convert `postconf -M` command output parser
Usage (cli):
$ postconf -M | jc --postconf
or
$ jc postconf -M
Usage (module):
import jc
result = jc.parse('postconf', postconf_command_output)
Schema:
[
{
"service_name": string,
"service_type": string,
"private": boolean/null, # [0]
"unprivileged": boolean/null, # [0]
"chroot": boolean/null, # [0]
"wake_up_time": integer/null, # [0]
"no_wake_up_before_first_use": boolean/null, # [1]
"process_limit": integer/null, # [0]
"command": string
}
]
[0] '-' converted to null/None
[1] null/None if `wake_up_time` is null/None
Examples:
$ postconf | jc --postconf -p
[]
$ postconf | jc --postconf -p -r
[]
<a id="jc.parsers.postconf.parse"></a>
### parse
```python
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]
```
Main text parsing function
Parameters:
data: (string) text data to parse
raw: (boolean) unprocessed output if True
quiet: (boolean) suppress warning messages if True
Returns:
List of Dictionaries. Raw or processed structured data.
### Parser Information
Compatibility: linux
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)

View File

@ -1,4 +1,4 @@
.TH jc 1 2022-05-31 1.20.0 "JSON Convert"
.TH jc 1 2022-06-05 1.20.1 "JSON Convert"
.SH NAME
\fBjc\fP \- JSON Convert JSONifies the output of many CLI tools and file-types
.SH SYNOPSIS
@ -337,6 +337,11 @@ Key/Value file parser
\fB--pip-show\fP
`pip show` command parser
.TP
.B
\fB--postconf\fP
`postconf -M` command parser
.TP
.B
\fB--ps\fP
@ -578,6 +583,14 @@ version information
.B
\fB-y\fP
YAML output
.TP
.B
\fB-B\fP
generate Bash shell completion script
.TP
.B
\fB-Z\fP
generate Zsh shell completion script
.SH EXIT CODES
Any fatal errors within \fBjc\fP will generate an exit code of \fB100\fP, otherwise the exit code will be \fB0\fP. When using the "Magic" syntax (e.g. \fBjc ifconfig eth0\fP), \fBjc\fP will store the exit code of the program being parsed and add it to the \fBjc\fP exit code. This way it is easier to determine if an error was from the parsed program or \fBjc\fP.

View File

@ -73,6 +73,14 @@ version information
.B
\fB-y\fP
YAML output
.TP
.B
\fB-B\fP
generate Bash shell completion script
.TP
.B
\fB-Z\fP
generate Zsh shell completion script
.SH EXIT CODES
Any fatal errors within \fBjc\fP will generate an exit code of \fB100\fP, otherwise the exit code will be \fB0\fP. When using the "Magic" syntax (e.g. \fBjc ifconfig eth0\fP), \fBjc\fP will store the exit code of the program being parsed and add it to the \fBjc\fP exit code. This way it is easier to determine if an error was from the parsed program or \fBjc\fP.

View File

@ -165,6 +165,8 @@ option.
- `-u` unbuffer output
- `-v` version information
- `-y` YAML output
- `-B` generate Bash shell completion script
- `-Z` generate Zsh shell completion script
### Exit Codes
Any fatal errors within `jc` will generate an exit code of `100`, otherwise the