From 486895474c9b25dea65eb4d03e3dd1f9e1dccf06 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Mon, 2 Oct 2017 08:25:12 +0530 Subject: [PATCH] Fix alignment in examples --- README.md | 122 +++++++++++++++++++++++++++--------------------------- 1 file changed, 62 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index 1c3fc40..d728389 100644 --- a/README.md +++ b/README.md @@ -86,45 +86,47 @@ To uninstall, run: #### cmdline options - usage: bcal [-c N] [-f FORMAT] [-s bytes] [-d] [-h] - [expression] [N unit] - - Perform storage conversions and calculations. - - positional arguments: - expression evaluate storage arithmetic expression - +, -, *, / with decimal inputs supported - unit can be multiplied or divided by +ve integers - units can be added or subtracted from each other - Examples: - bcal "(5kb+2mb)/3" - bcal "5 tb / 12" - bcal "2.5mb*3" - N [unit] capacity in B/KiB/MiB/GiB/TiB/kB/MB/GB/TB - see https://wiki.ubuntu.com/UnitsPolicy - default unit is B (byte), case is ignored - N can be decimal or '0x' prefixed hex value - - optional arguments: - -c N show +ve integer N in binary, decimal and hex - -f FORMAT convert CHS to LBA or LBA to CHS - formats are hyphen-separated - LBA format: - starts with 'l': - lLBA-MAX_HEAD-MAX_SECTOR - CHS format: - starts with 'c': - cC-H-S-MAX_HEAD-MAX_SECTOR - omitted values are considered 0 - FORMAT 'c-50--0x12-' denotes: - C = 0, H = 50, S = 0, MH = 0x12, MS = 0 - FORMAT 'l50-0x12' denotes: - LBA = 50, MH = 0x12, MS = 0 - default MAX_HEAD: 16, default MAX_SECTOR: 63 - -s bytes sector size [default 512] - -m show minimal output (e.g. decimal bytes) - -d enable debug information and logs - -h show this help and exit +``` +usage: bcal [-c N] [-f FORMAT] [-s bytes] [-d] [-h] + [expression] [N unit] + +Perform storage conversions and calculations. + +positional arguments: + expression evaluate storage arithmetic expression + +, -, *, / with decimal inputs supported + unit can be multiplied or divided by +ve integers + units can be added or subtracted from each other + Examples: + bcal "(5kb+2mb)/3" + bcal "5 tb / 12" + bcal "2.5mb*3" + N [unit] capacity in B/KiB/MiB/GiB/TiB/kB/MB/GB/TB + see https://wiki.ubuntu.com/UnitsPolicy + default unit is B (byte), case is ignored + N can be decimal or '0x' prefixed hex value + +optional arguments: + -c N show +ve integer N in binary, decimal and hex + -f FORMAT convert CHS to LBA or LBA to CHS + formats are hyphen-separated + LBA format: + starts with 'l': + lLBA-MAX_HEAD-MAX_SECTOR + CHS format: + starts with 'c': + cC-H-S-MAX_HEAD-MAX_SECTOR + omitted values are considered 0 + FORMAT 'c-50--0x12-' denotes: + C = 0, H = 50, S = 0, MH = 0x12, MS = 0 + FORMAT 'l50-0x12' denotes: + LBA = 50, MH = 0x12, MS = 0 + default MAX_HEAD: 16, default MAX_SECTOR: 63 + -s bytes sector size [default 512] + -m show minimal output (e.g. decimal bytes) + -d enable debug information and logs + -h show this help and exit +``` #### Operational notes @@ -148,40 +150,40 @@ To uninstall, run: 1. Evaluate arithmetic expression of storage units. - $ bcal "(5kb+2mb)/3" - $ bcal "5 tb / 12" - $ bcal "2.5mb*3" + $ bcal "(5kb+2mb)/3" + $ bcal "5 tb / 12" + $ bcal "2.5mb*3" 2. Convert storage capacity to other units and get address, LBA. - $ bcal 20140115 b - $ bcal 0x1335053 B - $ bcal 0xaabbcc kb - $ bcal 0xdef Gib + $ bcal 20140115 b + $ bcal 0x1335053 B + $ bcal 0xaabbcc kb + $ bcal 0xdef Gib Note that the units are case-insensitive. 3. Convert storage capacity, set sector size to 4096 to calculate LBA. - $ bcal 0xaabbcc kb -s 4096 + $ bcal 0xaabbcc kb -s 4096 4. Convert LBA to CHS. - $ bcal -f l500 - $ bcal -f l0x600-18-0x7e - $ bcal -f l0x300-0x12-0x7e + $ bcal -f l500 + $ bcal -f l0x600-18-0x7e + $ bcal -f l0x300-0x12-0x7e 5. Convert CHS to LBA. - $ bcal -f c10-10-10 - $ bcal -f c0x10-0x10-0x10 - $ bcal -f c0x10-10-2-0x12 - $ bcal -f c-10-2-0x12 - $ bcal -f c0x10-10--0x12 + $ bcal -f c10-10-10 + $ bcal -f c0x10-0x10-0x10 + $ bcal -f c0x10-10-2-0x12 + $ bcal -f c-10-2-0x12 + $ bcal -f c0x10-10--0x12 6. Show binary, decimal and hex representations of a number. - $ bcal -c 20140115 - $ bcal -c 0b1001100110101000001010011 - $ bcal -c 0x1335053 + $ bcal -c 20140115 + $ bcal -c 0b1001100110101000001010011 + $ bcal -c 0x1335053 7. Help and additional information. - $ man bcal - $ bcal -h + $ man bcal + $ bcal -h ### Testing