1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-21 00:19:42 +02:00

update docs

This commit is contained in:
Kelly Brazil
2019-11-11 18:30:46 -08:00
parent 363fd3eab4
commit 146e29f7cb
47 changed files with 5370 additions and 2233 deletions

View File

@ -5,48 +5,50 @@ Usage:
Examples:
$ history | jc --history -p
[
{
"line": "118",
"command": "sleep 100"
},
{
"line": "119",
"command": "ls /bin"
},
{
"line": "120",
"command": "echo \"hello\""
},
{
"line": "121",
"command": "docker images"
},
...
]
$ history | jc --history -p
[
{
"line": "118",
"command": "sleep 100"
},
{
"line": "119",
"command": "ls /bin"
},
{
"line": "120",
"command": "echo \"hello\""
},
{
"line": "121",
"command": "docker images"
},
...
]
$ history | jc --history -p -r
{
"118": "sleep 100",
"119": "ls /bin",
"120": "echo \"hello\"",
"121": "docker images",
...
}
$ history | jc --history -p -r
{
"118": "sleep 100",
"119": "ls /bin",
"120": "echo \"hello\"",
"121": "docker images",
...
}
"""
import jc
def process(proc_data):
'''schema:
[
{
"line": string,
"command": string
}
]
'''
"""
schema:
[
{
"line": string,
"command": string
}
]
"""
# rebuild output for added semantic information
processed = []
@ -60,6 +62,15 @@ def process(proc_data):
def parse(data, raw=False, quiet=False):
"""
Main parsing function
Arguments:
raw: (boolean) output preprocessed JSON if True
quiet: (boolean) suppress warning messages if True
"""
# compatible options: linux, darwin, cygwin, win32, aix, freebsd
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']