diff --git a/EXAMPLES.md b/EXAMPLES.md index f719279d..5ad605de 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -714,7 +714,6 @@ dig -x 1.1.1.1 | jc --dig -p # or: jc -p dig -x 1.1.1.1 dir | jc --dir -p # or: jc -p dir ``` ```json - [ { "date": "03/24/2021", @@ -2479,7 +2478,7 @@ route -ee | jc --route -p # or: jc -p route -ee } ] ``` -### rpm -qai +### rpm -qi ```bash rpm_qia | jc --rpm_qi -p # or: jc -p rpm -qia ``` diff --git a/docs/parsers/dir.md b/docs/parsers/dir.md index 2fdeff77..d58c693b 100644 --- a/docs/parsers/dir.md +++ b/docs/parsers/dir.md @@ -12,11 +12,11 @@ The `epoch` calculated timestamp field is naive (i.e. based on the local time of Usage (cli): - $ dir | jc --dir + C:> dir | jc --dir or - $ jc dir + C:> jc dir Usage (module): @@ -29,7 +29,7 @@ Compatibility: Examples: - $ dir | jc --dir -p + C:> dir | jc --dir -p [ { "date": "03/24/2021", @@ -70,7 +70,7 @@ Examples: ... ] - $ dir | jc --dir -p -r + C:> dir | jc --dir -p -r [ { "date": "03/24/2021", diff --git a/jc/parsers/dir.py b/jc/parsers/dir.py index 114dec3d..38a26bb2 100644 --- a/jc/parsers/dir.py +++ b/jc/parsers/dir.py @@ -10,11 +10,11 @@ The `epoch` calculated timestamp field is naive (i.e. based on the local time of Usage (cli): - $ dir | jc --dir + C:> dir | jc --dir or - $ jc dir + C:> jc dir Usage (module): @@ -27,7 +27,7 @@ Compatibility: Examples: - $ dir | jc --dir -p + C:> dir | jc --dir -p [ { "date": "03/24/2021", @@ -68,7 +68,7 @@ Examples: ... ] - $ dir | jc --dir -p -r + C:> dir | jc --dir -p -r [ { "date": "03/24/2021", diff --git a/man/jc.1.gz b/man/jc.1.gz new file mode 100644 index 00000000..43a9638f Binary files /dev/null and b/man/jc.1.gz differ diff --git a/mangen.py b/mangen.py index adda2da5..6b72355d 100755 --- a/mangen.py +++ b/mangen.py @@ -1,6 +1,9 @@ #!/usr/bin/env python3 # Genereate man page from jc metadata using jinja2 templates from datetime import date +import os +import gzip +import shutil import jc.cli from jinja2 import Environment, FileSystemLoader @@ -12,3 +15,9 @@ output = template.render(today=date.today(), with open('man/jc.1', 'w') as f: f.write(output) + +with open('man/jc.1', 'rb') as f_in: + with gzip.open('man/jc.1.gz', 'wb') as f_out: + shutil.copyfileobj(f_in, f_out) + +os.remove('man/jc.1')