-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
76 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,7 @@ typedef struct { | |
ulong s; | ||
} t_chs; | ||
|
||
static char *VERSION = "1.6"; | ||
static char *VERSION = "1.7"; | ||
static char *units[] = {"b", "kib", "mib", "gib", "tib", "kb", "mb", "gb", "tb"}; | ||
|
||
static char uint_buf[UINT_BUF_LEN]; | ||
|
@@ -769,41 +769,41 @@ static bool lba2chs(char *lba, t_chs *p_chs) | |
static void usage(void) | ||
{ | ||
printf("usage: bcal [-c N] [-f FORMAT] [-s bytes] [-d] [-h]\n\ | ||
[expression] [N unit] \n\n\ | ||
[expression] [N unit] \n\n\ | ||
Perform storage conversions and calculations.\n\n\ | ||
positional arguments:\n\ | ||
expression evaluate storage arithmetic expression\n\ | ||
+, -, *, / with decimal inputs supported\n\ | ||
unit can be multiplied or divided by +ve integers\n\ | ||
units can be added or subtracted from each other\n\ | ||
Examples:\n\ | ||
bcal \"(5kb+2mb)/3\"\n\ | ||
bcal \"5 tb / 12\"\n\ | ||
bcal \"2.5mb*3\"\n\ | ||
N [unit] capacity in B/KiB/MiB/GiB/TiB/kB/MB/GB/TB\n\ | ||
see https://wiki.ubuntu.com/UnitsPolicy\n\ | ||
default unit is B (byte), case is ignored\n\ | ||
N can be decimal or '0x' prefixed hex value\n\n\ | ||
expression evaluate storage arithmetic expression\n\ | ||
+, -, *, / with decimal inputs supported\n\ | ||
unit can be multiplied or divided by +ve integers\n\ | ||
units can be added or subtracted from each other\n\ | ||
Examples:\n\ | ||
bcal \"(5kb+2mb)/3\"\n\ | ||
bcal \"5 tb / 12\"\n\ | ||
bcal \"2.5mb*3\"\n\ | ||
N [unit] capacity in B/KiB/MiB/GiB/TiB/kB/MB/GB/TB\n\ | ||
see https://wiki.ubuntu.com/UnitsPolicy\n\ | ||
default unit is B (byte), case is ignored\n\ | ||
N can be decimal or '0x' prefixed hex value\n\n\ | ||
optional arguments:\n\ | ||
-c N show +ve integer N in binary, decimal and hex\n\ | ||
-f FORMAT convert CHS to LBA or LBA to CHS\n\ | ||
formats are hyphen-separated\n\ | ||
LBA format:\n\ | ||
starts with 'l':\n\ | ||
lLBA-MAX_HEAD-MAX_SECTOR\n\ | ||
CHS format:\n\ | ||
starts with 'c':\n\ | ||
cC-H-S-MAX_HEAD-MAX_SECTOR\n\ | ||
omitted values are considered 0\n\ | ||
FORMAT 'c-50--0x12-' denotes:\n\ | ||
C = 0, H = 50, S = 0, MH = 0x12, MS = 0\n\ | ||
FORMAT 'l50-0x12' denotes:\n\ | ||
LBA = 50, MH = 0x12, MS = 0\n\ | ||
default MAX_HEAD: 16, default MAX_SECTOR: 63\n\ | ||
-s bytes sector size [default 512]\n\ | ||
-m show minimal output (e.g. decimal bytes)\n\ | ||
-d enable debug information and logs\n\ | ||
-h show this help and exit\n\n\ | ||
-c N show +ve integer N in binary, decimal and hex\n\ | ||
-f FORMAT convert CHS to LBA or LBA to CHS\n\ | ||
formats are hyphen-separated\n\ | ||
LBA format:\n\ | ||
starts with 'l':\n\ | ||
lLBA-MAX_HEAD-MAX_SECTOR\n\ | ||
CHS format:\n\ | ||
starts with 'c':\n\ | ||
cC-H-S-MAX_HEAD-MAX_SECTOR\n\ | ||
omitted values are considered 0\n\ | ||
FORMAT 'c-50--0x12-' denotes:\n\ | ||
C = 0, H = 50, S = 0, MH = 0x12, MS = 0\n\ | ||
FORMAT 'l50-0x12' denotes:\n\ | ||
LBA = 50, MH = 0x12, MS = 0\n\ | ||
default MAX_HEAD: 16, default MAX_SECTOR: 63\n\ | ||
-s bytes sector size [default 512]\n\ | ||
-m show minimal output (e.g. decimal bytes)\n\ | ||
-d enable debug information and logs\n\ | ||
-h show this help and exit\n\n\ | ||
Version %s\n\ | ||
Copyright © 2016-2017 Arun Prakash Jana <[email protected]>\n\ | ||
License: GPLv3\n\ | ||
|
9dbdee0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shaggytwodope @szlin bcal v1.7 is released! This is a minor release.
9dbdee0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jarun AUR updated PPA builds in progress. Should be published within the hour.
9dbdee0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
9dbdee0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new version of bcal has been updated, thanks @jarun !
9dbdee0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Lin!