1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-10-08 23:22:21 +02:00

clean up examples

This commit is contained in:
Kelly Brazil
2021-04-16 08:46:20 -07:00
parent 8390ae48c8
commit 3b0e2f03f3
2 changed files with 24 additions and 23 deletions

View File

@@ -320,27 +320,27 @@ def helptext():
{parsers_string} {parsers_string}
Options: Options:
-a about jc -a about jc
-d debug - show traceback (-dd for verbose traceback) -d debug (-dd for verbose debug)
-h help (use -h --parser_name for parser documentation) -h help (-h --parser_name for parser documentation)
-m monochrome output -m monochrome output
-p pretty print output -p pretty print output
-q quiet - suppress parser warnings -q quiet - suppress parser warnings
-r raw JSON output -r raw JSON output
-v version info -v version info
Example: Examples:
ls -al | jc --ls -p Standard Syntax:
$ dig www.google.com | jc --dig -p
or using the magic syntax: Magic Syntax:
$ jc -p dig www.google.com
jc -p ls -al Parser Documentation:
$ jc -h --dig
For parser documentation:
jc -h --ls
''' '''
return textwrap.dedent(helptext_string) return textwrap.dedent(helptext_string)
def help_doc(options): def help_doc(options):
""" """
Returns the parser documentation if a parser is found in the arguments, otherwise Returns the parser documentation if a parser is found in the arguments, otherwise
@@ -363,6 +363,7 @@ Version {parser.info.version} by {parser.info.author} ({parser.info.author_email
return helptext() return helptext()
def versiontext(): def versiontext():
"""Return the version text""" """Return the version text"""
versiontext_string = f'''\ versiontext_string = f'''\

View File

@@ -40,7 +40,7 @@ debug - show traceback (\fB-dd\fP for verbose traceback)
.TP .TP
.B .B
\fB-h\fP \fB-h\fP
help - use `-h --parser_name` for parser documentation help (\fB-h --parser_name\fP for parser documentation)
.TP .TP
.B .B
\fB-m\fP \fB-m\fP
@@ -96,21 +96,21 @@ Local plugin filenames must be valid python module names, therefore must consist
Note: The application data directory follows the XDG Base Directory Specification Note: The application data directory follows the XDG Base Directory Specification
.SH EXAMPLE .SH EXAMPLES
ls \fB-al\fP | jc \fB--ls\fP \fB-p\fP Standard Syntax:
.RS
$ dig www.google.com | jc \fB--dig\fP \fB-p\fP
or using the magic syntax: .RE
jc \fB-p\fP ls \fB-al\fP
Magic Syntax:
.RS
$ jc \fB-p\fP dig www.google.com
.RE
For parser documentation: For parser documentation:
.RS
$ jc \fB-h\fP \fB--dig\fP
jc \fB-h\fP \fB--ls\fP .RE
.SH AUTHOR .SH AUTHOR
{{ jc.author }} ({{ jc.author_email }}) {{ jc.author }} ({{ jc.author_email }})