mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-07-15 01:24:29 +02:00
doc update
This commit is contained in:
@ -5,8 +5,6 @@
|
|||||||
|
|
||||||
jc - JSON Convert `swapon` command output parser
|
jc - JSON Convert `swapon` command output parser
|
||||||
|
|
||||||
> Note: Must use `swapon`
|
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
$ swapon | jc --swapon
|
$ swapon | jc --swapon
|
||||||
@ -18,17 +16,17 @@ or
|
|||||||
Usage (module):
|
Usage (module):
|
||||||
|
|
||||||
import jc
|
import jc
|
||||||
result = jc.parse('swapon', uname_command_output)
|
result = jc.parse('swapon', swapon_command_output)
|
||||||
|
|
||||||
Schema:
|
Schema:
|
||||||
|
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": string,
|
"name": string,
|
||||||
"type": string,
|
"type": string,
|
||||||
"size": int,
|
"size": integer,
|
||||||
"used": int,
|
"used": integer,
|
||||||
"priority": int,
|
"priority": integer
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
"""jc - JSON Convert `swapon` command output parser
|
"""jc - JSON Convert `swapon` command output parser
|
||||||
|
|
||||||
> Note: Must use `swapon`
|
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
$ swapon | jc --swapon
|
$ swapon | jc --swapon
|
||||||
@ -13,17 +11,17 @@ or
|
|||||||
Usage (module):
|
Usage (module):
|
||||||
|
|
||||||
import jc
|
import jc
|
||||||
result = jc.parse('swapon', uname_command_output)
|
result = jc.parse('swapon', swapon_command_output)
|
||||||
|
|
||||||
Schema:
|
Schema:
|
||||||
|
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": string,
|
"name": string,
|
||||||
"type": string,
|
"type": string,
|
||||||
"size": int,
|
"size": integer,
|
||||||
"used": int,
|
"used": integer,
|
||||||
"priority": int,
|
"priority": integer
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -48,7 +46,6 @@ from typing import List, Dict, Union
|
|||||||
|
|
||||||
class info:
|
class info:
|
||||||
"""Provides parser metadata (version, author, etc.)"""
|
"""Provides parser metadata (version, author, etc.)"""
|
||||||
|
|
||||||
version = "1.0"
|
version = "1.0"
|
||||||
description = "`swapon` command parser"
|
description = "`swapon` command parser"
|
||||||
author = "Roey Darwish Dror"
|
author = "Roey Darwish Dror"
|
||||||
|
2
man/jc.1
2
man/jc.1
@ -1,4 +1,4 @@
|
|||||||
.TH jc 1 2023-12-16 1.24.0 "JSON Convert"
|
.TH jc 1 2023-12-17 1.24.0 "JSON Convert"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
\fBjc\fP \- JSON Convert JSONifies the output of many CLI tools, file-types,
|
\fBjc\fP \- JSON Convert JSONifies the output of many CLI tools, file-types,
|
||||||
and strings
|
and strings
|
||||||
|
@ -25,9 +25,9 @@ class Swapon(unittest.TestCase):
|
|||||||
cls.f_in[file] = a.read()
|
cls.f_in[file] = a.read()
|
||||||
cls.f_json[file] = json.loads(b.read())
|
cls.f_json[file] = json.loads(b.read())
|
||||||
|
|
||||||
def test_foo_nodata(self):
|
def test_swapon_nodata(self):
|
||||||
"""
|
"""
|
||||||
Test 'foo' with no data
|
Test 'swapon' with no data
|
||||||
"""
|
"""
|
||||||
self.assertEqual(parse('', quiet=True), [])
|
self.assertEqual(parse('', quiet=True), [])
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user