1
0
Fork 0

Fix output formatting of 'dir' command

Adapt to 'pause' command working correctly (assuming the terminal height
is 25, this will need further adjustments for supporting 80x50 and
different modes).

Adjust "intro" by 1 space to make formatting the same as MS-DOS 'dir'
command - this makes intro not "merge" visually with the files listed.

Adjust placing of files and directories counters, to make it resemble
most 'dir' implementations.

Count intro lines for purpose of correct pagination with 'dir /p'.

Skip counting not printed lines with 'dir /b /p'.

Output of 'dir /w /p' is still broken, but fixing it will require more
invasive changes.

Fixes: #75
This commit is contained in:
Patryk Obara 2019-12-12 01:46:03 +01:00 committed by Patryk Obara
parent e68a64aade
commit 3eaabb41c1
2 changed files with 19 additions and 9 deletions

View file

@ -581,9 +581,9 @@ void SHELL_Init() {
MSG_Add("SHELL_CMD_GOTO_LABEL_NOT_FOUND","GOTO: Label %s not found.\n");
MSG_Add("SHELL_CMD_FILE_NOT_FOUND","File %s not found.\n");
MSG_Add("SHELL_CMD_FILE_EXISTS","File %s already exists.\n");
MSG_Add("SHELL_CMD_DIR_INTRO","Directory of %s.\n");
MSG_Add("SHELL_CMD_DIR_BYTES_USED","%5d File(s) %17s Bytes.\n");
MSG_Add("SHELL_CMD_DIR_BYTES_FREE","%5d Dir(s) %17s Bytes free.\n");
MSG_Add("SHELL_CMD_DIR_INTRO"," Directory of %s\n");
MSG_Add("SHELL_CMD_DIR_BYTES_USED","%16d file(s) %17s bytes\n");
MSG_Add("SHELL_CMD_DIR_BYTES_FREE","%16d dir(s) %17s bytes free\n");
MSG_Add("SHELL_EXECUTE_DRIVE_NOT_FOUND","Drive %c does not exist!\nYou must \033[31mmount\033[0m it first. Type \033[1;33mintro\033[0m or \033[1;33mintro mount\033[0m for more information.\n");
MSG_Add("SHELL_EXECUTE_ILLEGAL_COMMAND","Illegal command: %s.\n");
MSG_Add("SHELL_CMD_PAUSE","Press any key to continue...");