mirror of
https://github.com/BoredDevNL/BoredOS.git
synced 2026-05-13 01:48:42 +00:00
fix(cli): correct du usage format and replace -h with -H
This commit is contained in:
parent
a6118e8d21
commit
e75952e510
2 changed files with 4 additions and 4 deletions
|
|
@ -21,7 +21,7 @@ By default, `du` prints human-readable sizes for each file and directory it enco
|
|||
| `-d, --max-depth=N` | Stop at depth N; show only entries at or above depth N. |
|
||||
| `-c, --total` | Print a grand total after all arguments have been processed. |
|
||||
| `-b, --bytes` | Print sizes in exact bytes instead of human-readable units. |
|
||||
| `-h, --human-readable` | Accepted for compatibility; human-readable is the default. |
|
||||
| `-H, --human-readable` | Accepted for compatibility; human-readable is the default. |
|
||||
| `--help` | Display usage information and exit. |
|
||||
|
||||
## Output Format
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ static int opt_bytes = 0;
|
|||
static uint64_t grand_total = 0;
|
||||
|
||||
static void usage(void) {
|
||||
printf("Usage: du [OPTIONS]... [FILE]...\n");
|
||||
printf("Usage: du [options]..[file]\n");
|
||||
printf("Summarize disk usage of the set of FILEs, recursively for directories.\n\n");
|
||||
printf("Options:\n");
|
||||
printf(" -s, --summarize display only a total for each argument\n");
|
||||
|
|
@ -31,7 +31,7 @@ static void usage(void) {
|
|||
printf(" fewer levels below the command line argument\n");
|
||||
printf(" -c, --total produce a grand total\n");
|
||||
printf(" -b, --bytes print sizes in bytes\n");
|
||||
printf(" -h, --human-readable print sizes in human readable format (default)\n");
|
||||
printf(" -H, --human-readable print sizes in human readable format (default)\n");
|
||||
printf(" --help display this help and exit\n");
|
||||
}
|
||||
|
||||
|
|
@ -161,7 +161,7 @@ int main(int argc, char **argv) {
|
|||
opt_total = 1;
|
||||
} else if (strcmp(argv[i], "-b") == 0 || strcmp(argv[i], "--bytes") == 0) {
|
||||
opt_bytes = 1;
|
||||
} else if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--human-readable") == 0) {
|
||||
} else if (strcmp(argv[i], "-H") == 0 || strcmp(argv[i], "--human-readable") == 0) {
|
||||
// No-op: human-readable is the default
|
||||
} else if (strcmp(argv[i], "-d") == 0) {
|
||||
if (i + 1 < argc) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue