1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00
Files
jc/docs/parsers/update_alt_gs.md

74 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

2022-04-22 15:23:11 -07:00
[Home](https://kellyjonbrazil.github.io/jc/)
<a id="jc.parsers.update_alt_gs"></a>
2024-03-14 22:46:52 -07:00
# jc.parsers.update_alt_gs
2022-04-22 15:23:11 -07:00
jc - JSON Convert `update-alternatives --get-selections` command output parser
Usage (cli):
$ update-alternatives --get-selections | jc --update-alt-gs
2022-08-15 13:51:48 -07:00
or
2022-04-22 15:23:11 -07:00
$ jc update-alternatives --get-selections
Usage (module):
import jc
result = jc.parse('update-alt-gs',
update_alternatives_get_selections_command_output)
Schema:
[
{
"name": string,
"status": string,
"current": string
}
]
Examples:
$ update-alternatives --get-selections | jc --update-alt-gs -p
[
{
"name": "arptables",
"status": "auto",
"current": "/usr/sbin/arptables-nft"
},
{
"name": "awk",
"status": "auto",
"current": "/usr/bin/gawk"
}
]
<a id="jc.parsers.update_alt_gs.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
2023-12-21 14:55:21 -08:00
Source: [`jc/parsers/update_alt_gs.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/update_alt_gs.py)
2022-04-22 15:23:11 -07:00
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)