diff options
author | Arvin Schnell <aschnell@suse.com> | 2021-08-17 11:05:38 +0000 |
---|---|---|
committer | Brian C. Lane <bcl@redhat.com> | 2021-08-25 15:29:38 -0700 |
commit | 36d16c57d4ff6cf9903bfe65671c7f90879e004f (patch) | |
tree | 477d19d2c463c6011ed357758a86064d59d4c2c5 /doc | |
parent | 72faef8673b5b1d00059608f0729e93cb21a7664 (diff) | |
download | parted-36d16c57d4ff6cf9903bfe65671c7f90879e004f.tar.gz |
parted: Add --json cmdline switch to output JSON
This outputs the disk's details as a JSON object. eg. a disk image with
a single partition from 1M to 100M:
{
"disk": {
"path": "/root/disk1.img",
"size": "2097152s",
"model": "",
"transport": "file",
"logical-sector-size": 512,
"physical-sector-size": 512,
"label": "gpt",
"max-partitions": 128,
"partitions": [
{
"number": 0,
"start": "34s",
"end": "2047s",
"size": "2014s",
"type": "free"
},{
"number": 1,
"start": "2048s",
"end": "200703s",
"size": "198656s",
"type": "primary",
"name": "root"
},{
"number": 0,
"start": "200704s",
"end": "2097118s",
"size": "1896415s",
"type": "free"
}
]
}
}
Signed-off-by: Brian C. Lane <bcl@redhat.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/C/parted.8 | 3 | ||||
-rw-r--r-- | doc/parted.texi | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/doc/C/parted.8 b/doc/C/parted.8 index d8e556e..46b30ad 100644 --- a/doc/C/parted.8 +++ b/doc/C/parted.8 @@ -24,6 +24,9 @@ lists partition layout on all block devices .B -m, --machine displays machine parseable output .TP +.B -m, --json +displays JSON output +.TP .B -s, --script never prompts for user intervention .TP diff --git a/doc/parted.texi b/doc/parted.texi index 0da68e9..57ceb55 100644 --- a/doc/parted.texi +++ b/doc/parted.texi @@ -402,6 +402,14 @@ Options: @itemx --help display a help message +@item -m +@itemx --machine +display output in machine parseable format + +@item -j +@itemx --json +display output in JSON format + @item -s @itemx --script never prompt the user |