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

add parser metadata tags and category view to help

This commit is contained in:
Kelly Brazil
2022-12-27 13:59:10 -08:00
parent 6674f549f2
commit 68717e8493
191 changed files with 254 additions and 17 deletions

View File

@ -1,8 +1,10 @@
jc changelog jc changelog
20221223 v1.23.4 20221227 v1.23.4
- Add `iwconfig` command parser - Add `iwconfig` command parser
- Fix `proc` parser magic signature detection for `/proc/pid/stat` hacks - Fix `proc` parser magic signature detection for `/proc/pid/stat` hacks
- Add category tags to parser metadata
- Add "list parsers by category" view to help
- Fix python 3.6-related issues - Fix python 3.6-related issues
- Add python 3.6 to automated tests - Add python 3.6 to automated tests

View File

@ -9,7 +9,7 @@ from datetime import datetime, timezone
import textwrap import textwrap
import shlex import shlex
import subprocess import subprocess
from typing import List, Union, Optional, TextIO from typing import List, Dict, Union, Optional, TextIO
from types import ModuleType from types import ModuleType
from .lib import ( from .lib import (
__version__, parser_info, all_parser_info, parsers, _get_parser, _parser_is_streaming, __version__, parser_info, all_parser_info, parsers, _get_parser, _parser_is_streaming,
@ -64,12 +64,12 @@ if PYGMENTS_INSTALLED:
class JcCli(): class JcCli():
__slots__ = ( __slots__ = (
'data_in', 'data_out', 'options', 'args', 'parser_module', 'parser_name', 'indent', 'pad', 'data_in', 'data_out', 'options', 'args', 'parser_module', 'parser_name', 'indent', 'pad',
'custom_colors', 'show_hidden', 'ascii_only', 'json_separators', 'json_indent', 'custom_colors', 'show_hidden', 'show_categories', 'ascii_only', 'json_separators',
'run_timestamp', 'about', 'debug', 'verbose_debug', 'force_color', 'mono', 'help_me', 'json_indent', 'run_timestamp', 'about', 'debug', 'verbose_debug', 'force_color', 'mono',
'pretty', 'quiet', 'ignore_exceptions', 'raw', 'meta_out', 'unbuffer', 'version_info', 'help_me', 'pretty', 'quiet', 'ignore_exceptions', 'raw', 'meta_out', 'unbuffer',
'yaml_output', 'bash_comp', 'zsh_comp', 'magic_found_parser', 'magic_options', 'version_info', 'yaml_output', 'bash_comp', 'zsh_comp', 'magic_found_parser',
'magic_run_command', 'magic_run_command_str', 'magic_stdout', 'magic_stderr', 'magic_options', 'magic_run_command', 'magic_run_command_str', 'magic_stdout',
'magic_returncode' 'magic_stderr', 'magic_returncode'
) )
def __init__(self) -> None: def __init__(self) -> None:
@ -83,6 +83,7 @@ class JcCli():
self.pad: int = 0 self.pad: int = 0
self.custom_colors: CustomColorType = {} self.custom_colors: CustomColorType = {}
self.show_hidden: bool = False self.show_hidden: bool = False
self.show_categories: bool = False
self.ascii_only: bool = False self.ascii_only: bool = False
self.json_separators: Optional[tuple[str, str]] = (',', ':') self.json_separators: Optional[tuple[str, str]] = (',', ':')
self.json_indent: Optional[int] = None self.json_indent: Optional[int] = None
@ -198,6 +199,41 @@ class JcCli():
return ptext return ptext
def parser_categories_text(self) -> str:
"""Return lists of parsers by category"""
category_text: str = ''
padding_char: str = ' '
all_parsers = all_parser_info(show_hidden=True, show_deprecated=False)
generic = [{'arg': x['argument'], 'desc': x['description']} for x in all_parsers if 'generic' in x['tags']]
standard = [{'arg': x['argument'], 'desc': x['description']} for x in all_parsers if 'standard' in x['tags']]
command = [{'arg': x['argument'], 'desc': x['description']} for x in all_parsers if 'command' in x['tags']]
file_str_bin = [
{'arg': x['argument'], 'desc': x['description']} for x in all_parsers
if 'file' in x['tags'] or
'string' in x['tags'] or
'binary' in x['tags']
]
streaming = [{'arg': x['argument'], 'desc': x['description']} for x in all_parsers if x.get('streaming')]
categories: Dict = {
'Generic Parsers:': generic,
'Standard Spec Parsers:': standard,
'File/String/Binary Parsers:': file_str_bin,
'Streaming Parsers:': streaming,
'Command Parsers:': command
}
for cat, cat_objs in categories.items():
category_text += f'{cat} ({len(cat_objs)})\n'
for p in cat_objs:
parser_arg: str = p.get('arg', 'UNKNOWN')
parser_desc: str = p.get('desc', 'No description available.')
padding: int = self.pad - len(parser_arg)
padding_text: str = padding_char * padding
category_text += f'{parser_arg}{padding_text}{parser_desc}\n'
category_text += '\n'
return category_text[:-1]
def options_text(self) -> str: def options_text(self) -> str:
"""Return the argument and description information from each option""" """Return the argument and description information from each option"""
otext: str = '' otext: str = ''
@ -236,8 +272,6 @@ class JcCli():
def helptext(self) -> str: def helptext(self) -> str:
"""Return the help text with the list of parsers""" """Return the help text with the list of parsers"""
self.indent = 4
self.pad = 20
parsers_string: str = self.parsers_text() parsers_string: str = self.parsers_text()
options_string: str = self.options_text() options_string: str = self.options_text()
helptext_string: str = f'{helptext_preamble_string}{parsers_string}\nOptions:\n{options_string}\n{helptext_end_string}' helptext_string: str = f'{helptext_preamble_string}{parsers_string}\nOptions:\n{options_string}\n{helptext_end_string}'
@ -248,6 +282,13 @@ class JcCli():
Pages the parser documentation if a parser is found in the arguments, Pages the parser documentation if a parser is found in the arguments,
otherwise the general help text is printed. otherwise the general help text is printed.
""" """
self.indent = 4
self.pad = 20
if self.show_categories:
utils._safe_print(self.parser_categories_text())
return
for arg in self.args: for arg in self.args:
parser_name: str = self.parser_shortname(arg) parser_name: str = self.parser_shortname(arg)
@ -655,6 +696,7 @@ class JcCli():
self.force_color = 'C' in self.options self.force_color = 'C' in self.options
self.help_me = 'h' in self.options self.help_me = 'h' in self.options
self.show_hidden = self.options.count('h') > 1 # verbose help self.show_hidden = self.options.count('h') > 1 # verbose help
self.show_categories = self.options.count('h') > 2
self.pretty = 'p' in self.options self.pretty = 'p' in self.options
self.quiet = 'q' in self.options self.quiet = 'q' in self.options
self.ignore_exceptions = self.options.count('q') > 1 self.ignore_exceptions = self.options.count('q') > 1

View File

@ -91,6 +91,7 @@ Examples:
Parser Documentation: Parser Documentation:
$ jc --help --dig $ jc --help --dig
Show Hidden Parsers: More Help:
$ jc -hh $ jc -hh # show hidden parsers
$ jc -hhh # list parsers by category
''' '''

View File

@ -20,6 +20,7 @@ if sys.version_info >= (3, 8):
"author_email": str, "author_email": str,
"compatible": List[str], "compatible": List[str],
"magic_commands": List[str], "magic_commands": List[str],
"tags": List[str],
"documentation": str, "documentation": str,
"streaming": bool, "streaming": bool,
"plugin": bool, "plugin": bool,

View File

@ -233,6 +233,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['acpi'] magic_commands = ['acpi']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -86,6 +86,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['darwin'] compatible = ['darwin']
magic_commands = ['airport -I'] magic_commands = ['airport -I']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -115,6 +115,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['darwin'] compatible = ['darwin']
magic_commands = ['airport -s'] magic_commands = ['airport -s']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -125,6 +125,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'aix', 'freebsd', 'darwin'] compatible = ['linux', 'aix', 'freebsd', 'darwin']
magic_commands = ['arp'] magic_commands = ['arp']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -130,6 +130,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['generic', 'string']
__version__ = info.version __version__ = info.version

View File

@ -115,6 +115,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['generic', 'string']
__version__ = info.version __version__ = info.version

View File

@ -127,6 +127,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['blkid'] magic_commands = ['blkid']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -106,6 +106,7 @@ class info():
author_email = 'andreas.weiden@gmail.com' author_email = 'andreas.weiden@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
magic_commands = ['cbt'] magic_commands = ['cbt']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -129,6 +129,8 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
details = 'Using the pycef library at https://github.com/DavidJBianco/pycef/releases/tag/v1.11-2' details = 'Using the pycef library at https://github.com/DavidJBianco/pycef/releases/tag/v1.11-2'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['standard', 'file', 'string']
__version__ = info.version __version__ = info.version

View File

@ -103,6 +103,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
details = 'Using the pycef library at https://github.com/DavidJBianco/pycef/releases/tag/v1.11-2' details = 'Using the pycef library at https://github.com/DavidJBianco/pycef/releases/tag/v1.11-2'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['standard', 'file', 'string']
streaming = True streaming = True

View File

@ -63,6 +63,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['chage --list', 'chage -l'] magic_commands = ['chage --list', 'chage -l']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -60,6 +60,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'aix', 'freebsd']
magic_commands = ['cksum', 'sum'] magic_commands = ['cksum', 'sum']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -179,6 +179,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['standard', 'file', 'string']
__version__ = info.version __version__ = info.version

View File

@ -95,6 +95,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['standard', 'file', 'string']
streaming = True streaming = True

View File

@ -180,6 +180,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'aix', 'freebsd']
magic_commands = ['crontab'] magic_commands = ['crontab']
tags = ['file', 'command']
__version__ = info.version __version__ = info.version

View File

@ -176,6 +176,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'aix', 'freebsd']
tags = ['file', 'command']
__version__ = info.version __version__ = info.version

View File

@ -86,6 +86,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
details = 'Using the python standard csv library' details = 'Using the python standard csv library'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['standard', 'file', 'string']
__version__ = info.version __version__ = info.version

View File

@ -69,6 +69,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
details = 'Using the python standard csv library' details = 'Using the python standard csv library'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['standard', 'file', 'string']
streaming = True streaming = True

View File

@ -84,6 +84,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'freebsd'] compatible = ['linux', 'darwin', 'freebsd']
magic_commands = ['date'] magic_commands = ['date']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -75,6 +75,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
details = 'Using the pyiso8601 library from https://github.com/micktwomey/pyiso8601/releases/tag/1.0.2' details = 'Using the pyiso8601 library from https://github.com/micktwomey/pyiso8601/releases/tag/1.0.2'
compatible = ['linux', 'aix', 'freebsd', 'darwin', 'win32', 'cygwin'] compatible = ['linux', 'aix', 'freebsd', 'darwin', 'win32', 'cygwin']
tags = ['standard', 'string']
__version__ = info.version __version__ = info.version

View File

@ -105,6 +105,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'freebsd'] compatible = ['linux', 'darwin', 'freebsd']
magic_commands = ['df'] magic_commands = ['df']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -328,6 +328,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'aix', 'freebsd', 'darwin', 'win32', 'cygwin'] compatible = ['linux', 'aix', 'freebsd', 'darwin', 'win32', 'cygwin']
magic_commands = ['dig'] magic_commands = ['dig']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -126,6 +126,7 @@ class info():
author = 'Rasheed Elsaleh' author = 'Rasheed Elsaleh'
author_email = 'rasheed@rebelliondefense.com' author_email = 'rasheed@rebelliondefense.com'
compatible = ['win32'] compatible = ['win32']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -131,6 +131,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['dmidecode'] magic_commands = ['dmidecode']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -138,6 +138,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['dpkg -l'] magic_commands = ['dpkg -l']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -98,6 +98,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'aix', 'freebsd']
magic_commands = ['du'] magic_commands = ['du']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -47,6 +47,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['standard', 'string']
__version__ = info.version __version__ = info.version

View File

@ -78,6 +78,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
magic_commands = ['env', 'printenv'] magic_commands = ['env', 'printenv']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -69,6 +69,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'aix', 'freebsd', 'darwin'] compatible = ['linux', 'aix', 'freebsd', 'darwin']
magic_commands = ['file'] magic_commands = ['file']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -99,6 +99,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['findmnt'] magic_commands = ['findmnt']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -98,6 +98,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'freebsd']
magic_commands = ['finger'] magic_commands = ['finger']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -48,6 +48,9 @@ class info():
# compatible options: linux, darwin, cygwin, win32, aix, freebsd # compatible options: linux, darwin, cygwin, win32, aix, freebsd
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
# tags options: generic, standard, file, string, binary, command
tags = ['command']
magic_commands = ['foo'] magic_commands = ['foo']

View File

@ -58,6 +58,9 @@ class info():
# compatible options: linux, darwin, cygwin, win32, aix, freebsd # compatible options: linux, darwin, cygwin, win32, aix, freebsd
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
# tags options: generic, standard, file, string, binary, command
tags = ['command']
streaming = True streaming = True

View File

@ -79,6 +79,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['free'] magic_commands = ['free']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -90,6 +90,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'freebsd'] compatible = ['linux', 'freebsd']
tags = ['file']
__version__ = info.version __version__ = info.version

View File

@ -159,6 +159,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
magic_commands = ['git log'] magic_commands = ['git log']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -93,6 +93,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['command']
streaming = True streaming = True

View File

@ -72,6 +72,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
magic_commands = ['git ls-remote'] magic_commands = ['git ls-remote']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -126,6 +126,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['gpg --with-colons'] magic_commands = ['gpg --with-colons']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -114,6 +114,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'aix', 'freebsd']
tags = ['file']
__version__ = info.version __version__ = info.version

View File

@ -82,6 +82,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'aix', 'freebsd'] compatible = ['linux', 'aix', 'freebsd']
tags = ['file']
__version__ = info.version __version__ = info.version

View File

@ -43,6 +43,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'aix', 'freebsd']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -76,6 +76,7 @@ class info():
compatible = ['linux', 'darwin', 'cygwin', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'aix', 'freebsd']
magic_commands = ['md5sum', 'md5', 'shasum', 'sha1sum', 'sha224sum', magic_commands = ['md5sum', 'md5', 'shasum', 'sha1sum', 'sha224sum',
'sha256sum', 'sha384sum', 'sha512sum'] 'sha256sum', 'sha384sum', 'sha512sum']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -323,6 +323,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['hciconfig'] magic_commands = ['hciconfig']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -69,6 +69,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
details = 'Optimizations by https://github.com/philippeitis' details = 'Optimizations by https://github.com/philippeitis'
compatible = ['linux', 'darwin', 'cygwin', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'aix', 'freebsd']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -79,6 +79,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['file']
__version__ = info.version __version__ = info.version

View File

@ -112,6 +112,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'aix', 'freebsd']
magic_commands = ['id'] magic_commands = ['id']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -225,6 +225,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'aix', 'freebsd', 'darwin'] compatible = ['linux', 'aix', 'freebsd', 'darwin']
magic_commands = ['ifconfig'] magic_commands = ['ifconfig']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -76,6 +76,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
details = 'Using configparser from the standard library' details = 'Using configparser from the standard library'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['standard', 'file', 'string']
__version__ = info.version __version__ = info.version

View File

@ -166,6 +166,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['iostat'] magic_commands = ['iostat']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -113,6 +113,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
tags = ['command']
streaming = True streaming = True

View File

@ -538,6 +538,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['standard', 'string']
__version__ = info.version __version__ = info.version

View File

@ -169,6 +169,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['iptables'] magic_commands = ['iptables']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -17,6 +17,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
details = 'Deprecated - please use datetime-iso' details = 'Deprecated - please use datetime-iso'
compatible = ['linux', 'aix', 'freebsd', 'darwin', 'win32', 'cygwin'] compatible = ['linux', 'aix', 'freebsd', 'darwin', 'win32', 'cygwin']
tags = ['standard', 'string']
deprecated = True deprecated = True

View File

@ -129,6 +129,7 @@ class info():
details = 'Enhancements by Philipp Schmitt (https://pschmitt.dev/)' details = 'Enhancements by Philipp Schmitt (https://pschmitt.dev/)'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['iw dev'] magic_commands = ['iw dev']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -93,6 +93,7 @@ class info():
author_email = 'vrince@gmail.com' author_email = 'vrince@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['iwconfig'] magic_commands = ['iwconfig']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -83,6 +83,7 @@ class info():
author = 'Matt J' author = 'Matt J'
author_email = 'https://github.com/listuser' author_email = 'https://github.com/listuser'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['file']
__version__ = info.version __version__ = info.version

View File

@ -99,6 +99,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'aix', 'freebsd']
magic_commands = ['jobs'] magic_commands = ['jobs']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -56,6 +56,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['standard', 'string']
__version__ = info.version __version__ = info.version

View File

@ -1,4 +1,4 @@
"""jc - JSON Convert `Key/Value` file parser """jc - JSON Convert `Key/Value` file and string parser
Supports files containing simple key/value pairs. Supports files containing simple key/value pairs.
@ -55,11 +55,12 @@ Examples:
class info(): class info():
"""Provides parser metadata (version, author, etc.)""" """Provides parser metadata (version, author, etc.)"""
version = '1.2' version = '1.2'
description = 'Key/Value file parser' description = 'Key/Value file and string parser'
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
details = 'This is a wrapper for the INI parser' details = 'This is a wrapper for the INI parser'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['generic', 'file', 'string']
__version__ = info.version __version__ = info.version

View File

@ -113,6 +113,7 @@ class info():
details = 'Enhancements by https://github.com/zerolagtime' details = 'Enhancements by https://github.com/zerolagtime'
compatible = ['linux', 'darwin', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'aix', 'freebsd']
magic_commands = ['last', 'lastb'] magic_commands = ['last', 'lastb']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -124,6 +124,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'aix', 'freebsd']
magic_commands = ['ls', 'vdir'] magic_commands = ['ls', 'vdir']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -82,6 +82,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'aix', 'freebsd']
tags = ['command']
streaming = True streaming = True

View File

@ -281,6 +281,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['lsblk'] magic_commands = ['lsblk']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -132,6 +132,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['lsmod'] magic_commands = ['lsmod']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -126,6 +126,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'aix', 'freebsd']
magic_commands = ['lsof'] magic_commands = ['lsof']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -129,6 +129,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['lspci'] magic_commands = ['lspci']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -275,6 +275,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['lsusb'] magic_commands = ['lsusb']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -71,6 +71,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['file']
__version__ = info.version __version__ = info.version

View File

@ -235,6 +235,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['mdadm'] magic_commands = ['mdadm']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -81,6 +81,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'freebsd'] compatible = ['linux', 'darwin', 'freebsd']
magic_commands = ['mount'] magic_commands = ['mount']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -122,6 +122,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['mpstat'] magic_commands = ['mpstat']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -106,6 +106,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
tags = ['command']
streaming = True streaming = True

View File

@ -361,6 +361,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'freebsd'] compatible = ['linux', 'darwin', 'freebsd']
magic_commands = ['netstat'] magic_commands = ['netstat']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -155,6 +155,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['nmcli'] magic_commands = ['nmcli']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -213,6 +213,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'freebsd'] compatible = ['linux', 'freebsd']
magic_commands = ['ntpq'] magic_commands = ['ntpq']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -161,6 +161,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['file']
__version__ = info.version __version__ = info.version

View File

@ -48,6 +48,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['os-prober'] magic_commands = ['os-prober']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -99,6 +99,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'aix', 'freebsd']
tags = ['file']
__version__ = info.version __version__ = info.version

View File

@ -81,6 +81,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['file']
__version__ = info.version __version__ = info.version

View File

@ -54,6 +54,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['file']
__version__ = info.version __version__ = info.version

View File

@ -134,6 +134,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['pidstat'] magic_commands = ['pidstat']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -88,6 +88,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
tags = ['command']
streaming = True streaming = True

View File

@ -170,6 +170,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'freebsd'] compatible = ['linux', 'darwin', 'freebsd']
magic_commands = ['ping', 'ping6'] magic_commands = ['ping', 'ping6']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -90,6 +90,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'freebsd'] compatible = ['linux', 'darwin', 'freebsd']
tags = ['command']
streaming = True streaming = True

View File

@ -54,6 +54,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
magic_commands = ['pip list', 'pip3 list'] magic_commands = ['pip list', 'pip3 list']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -72,6 +72,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
magic_commands = ['pip show', 'pip3 show'] magic_commands = ['pip show', 'pip3 show']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -58,6 +58,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
tags = ['standard', 'file', 'string', 'binary']
__version__ = info.version __version__ = info.version

View File

@ -97,6 +97,7 @@ class info():
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
magic_commands = ['postconf -M'] magic_commands = ['postconf -M']
tags = ['command']
__version__ = info.version __version__ = info.version

View File

@ -125,6 +125,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
tags = ['file']
__version__ = info.version __version__ = info.version

View File

@ -108,6 +108,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
tags = ['file']
hidden = True hidden = True

View File

@ -92,6 +92,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
tags = ['file']
hidden = True hidden = True

View File

@ -227,6 +227,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
tags = ['file']
hidden = True hidden = True

View File

@ -123,6 +123,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
tags = ['file']
hidden = True hidden = True

View File

@ -83,6 +83,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
tags = ['file']
hidden = True hidden = True

View File

@ -183,6 +183,7 @@ class info():
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux'] compatible = ['linux']
tags = ['file']
hidden = True hidden = True

Some files were not shown because too many files have changed in this diff Show More