1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-19 00:17:51 +02:00
Files
jc/docs/parsers/systemctl_luf.md
Kelly Brazil 3daf90c5fe doc formatting
2022-08-15 13:51:48 -07:00

74 lines
1.3 KiB
Markdown

[Home](https://kellyjonbrazil.github.io/jc/)
<a id="jc.parsers.systemctl_luf"></a>
# jc.parsers.systemctl\_luf
jc - JSON Convert `systemctl list-unit-files` command output
parser
Usage (cli):
$ systemctl list-unit-files | jc --systemctl-luf
or
$ jc systemctl list-unit-files
Usage (module):
import jc
result = jc.parse('systemctl_luf', systemctl_luf_command_output)
Schema:
[
{
"unit_file": string,
"state": string
}
]
Examples:
$ systemctl list-unit-files | jc --systemctl-luf -p
[
{
"unit_file": "proc-sys-fs-binfmt_misc.automount",
"state": "static"
},
{
"unit_file": "dev-hugepages.mount",
"state": "static"
},
{
"unit_file": "dev-mqueue.mount",
"state": "static"
},
...
]
<a id="jc.parsers.systemctl_luf.parse"></a>
### parse
```python
def parse(data, raw=False, quiet=False)
```
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.5 by Kelly Brazil (kellyjonbrazil@gmail.com)