mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-07-13 01:20:24 +02:00
doc update
This commit is contained in:
@ -210,6 +210,7 @@ option.
|
|||||||
| ` --ping-s` | `ping` and `ping6` command streaming parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/ping_s) |
|
| ` --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-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) |
|
| ` --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) |
|
| ` --ps` | `ps` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/ps) |
|
||||||
| ` --route` | `route` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/route) |
|
| ` --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) |
|
| ` --rpm-qi` | `rpm -qi` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/rpm_qi) |
|
||||||
@ -266,6 +267,8 @@ option.
|
|||||||
- `-u` unbuffer output
|
- `-u` unbuffer output
|
||||||
- `-v` version information
|
- `-v` version information
|
||||||
- `-y` YAML output
|
- `-y` YAML output
|
||||||
|
- `-B` generate Bash shell completion script
|
||||||
|
- `-Z` generate Zsh shell completion script
|
||||||
|
|
||||||
### Exit Codes
|
### Exit Codes
|
||||||
Any fatal errors within `jc` will generate an exit code of `100`, otherwise the
|
Any fatal errors within `jc` will generate an exit code of `100`, otherwise the
|
||||||
|
@ -128,4 +128,4 @@ Returns:
|
|||||||
### Parser Information
|
### Parser Information
|
||||||
Compatibility: linux, darwin, aix, freebsd
|
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
71
docs/parsers/postconf.md
Normal 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)
|
15
man/jc.1
15
man/jc.1
@ -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
|
.SH NAME
|
||||||
\fBjc\fP \- JSON Convert JSONifies the output of many CLI tools and file-types
|
\fBjc\fP \- JSON Convert JSONifies the output of many CLI tools and file-types
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@ -337,6 +337,11 @@ Key/Value file parser
|
|||||||
\fB--pip-show\fP
|
\fB--pip-show\fP
|
||||||
`pip show` command parser
|
`pip show` command parser
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B
|
||||||
|
\fB--postconf\fP
|
||||||
|
`postconf -M` command parser
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B
|
.B
|
||||||
\fB--ps\fP
|
\fB--ps\fP
|
||||||
@ -578,6 +583,14 @@ version information
|
|||||||
.B
|
.B
|
||||||
\fB-y\fP
|
\fB-y\fP
|
||||||
YAML output
|
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
|
.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.
|
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.
|
||||||
|
@ -73,6 +73,14 @@ version information
|
|||||||
.B
|
.B
|
||||||
\fB-y\fP
|
\fB-y\fP
|
||||||
YAML output
|
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
|
.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.
|
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.
|
||||||
|
@ -165,6 +165,8 @@ option.
|
|||||||
- `-u` unbuffer output
|
- `-u` unbuffer output
|
||||||
- `-v` version information
|
- `-v` version information
|
||||||
- `-y` YAML output
|
- `-y` YAML output
|
||||||
|
- `-B` generate Bash shell completion script
|
||||||
|
- `-Z` generate Zsh shell completion script
|
||||||
|
|
||||||
### Exit Codes
|
### Exit Codes
|
||||||
Any fatal errors within `jc` will generate an exit code of `100`, otherwise the
|
Any fatal errors within `jc` will generate an exit code of `100`, otherwise the
|
||||||
|
Reference in New Issue
Block a user