Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

Commit

Permalink
add -b in help screen
Browse files Browse the repository at this point in the history
  • Loading branch information
dd86k committed Jul 12, 2018
1 parent f0248b8 commit 5a57192
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions ggf.d
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ import core.stdc.stdio : printf, puts, fputs, stdout;
extern (C)
int putchar(int c);

/*
* MSDN
* GetVolumeInformation
* https://msdn.microsoft.com/en-us/library/windows/desktop/aa364993(v=vs.85).aspx
*/

/* SWITCHES
-b : Use base 10 sizes
-f : Features page (flags)
-s : Serial, max component length
*/

enum
PROJECT_VER = "0.1.0",
PCNULL = cast(char*)0, /// Character Pointer NULL constant
Expand All @@ -26,14 +14,15 @@ void help() {
puts(
`Get disk(s) information.
Usage: ggf [OPTIONS]
ggf {-h|-v|/?}
ggf {-h|-v|-?}
By default, view disk usage by size.
OPTIONS
-P View usage by progress-bar style.
-F View features.
-M View misc. features (serial and maximum size of path)`
-M View misc. features (serial and maximum size of path)
-b Use base10 size formatting`
);
}

Expand Down Expand Up @@ -66,9 +55,11 @@ enum
extern (C)
private int main(int argc, char** argv) {
ubyte feature; // FEATURE_DEFAULT
char drive = 0;

while (--argc >= 1) {
if (argv[argc][0] == '-') {
char c = argv[argc][0];
if (c == '-') {
char* a = argv[argc];
while (*++a != '\0') {
switch (*a) {
Expand All @@ -83,6 +74,10 @@ private int main(int argc, char** argv) {
return 1;
}
}
} else if (c >= 'A' && c <= 'Z') {
drive = c;
} else if (c >= 'a' && c <= 'z') {
drive = cast(char)(c - 32);
}
}

Expand Down

0 comments on commit 5a57192

Please sign in to comment.