[MORE] Use positional elements to build the MORE prompt, whose state is controlled by flags.

This commit is contained in:
Hermès Bélusca-Maïto 2021-06-10 04:10:55 +02:00
parent 558908e709
commit 2dbbfe86ab
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
24 changed files with 217 additions and 189 deletions

View file

@ -42,11 +42,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- Продължаване --"
IDS_CONTINUE_PROGRESS "-- Продължаване (%d%%) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Няма достъп до файл %s.\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- Продължаване%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d%%)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -42,11 +42,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- Continua --"
IDS_CONTINUE_PROGRESS "-- Continua (%d%%) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "No puc accedir al fitxer %s.\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- Continua%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d%%)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -48,11 +48,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- Pokračovat --"
IDS_CONTINUE_PROGRESS "-- Pokračovat (%d%%) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Nelze získat přístup k souboru %s.\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- Pokračovat%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d%%)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -42,11 +42,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- Fortsetzung --"
IDS_CONTINUE_PROGRESS "-- Fortsetzung (%d%%) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Auf die Datei %s kann nicht zugegriffen werden.\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- Fortsetzung%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d%%)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -42,11 +42,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- Συνέχεια --"
IDS_CONTINUE_PROGRESS "-- Συνέχεια (%d%%) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Δεν ήταν δυνατή η προσπέλαση του αρχείου %s.\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- Συνέχεια%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d%%)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -42,11 +42,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- Continue --"
IDS_CONTINUE_PROGRESS "-- Continue (%d%%) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Cannot access the file %s.\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- Continue%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d%%)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -42,11 +42,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- Continuar --"
IDS_CONTINUE_PROGRESS "-- Continuar (%d%%) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "No se puede acceder al fichero %s.\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- Continuar%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d%%)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -42,11 +42,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- Jätka --"
IDS_CONTINUE_PROGRESS "-- Jätka (%d%%) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Ei saa ligi failile %s.\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- Jätka%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d%%)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -44,11 +44,11 @@ disponibles à l'invite ""-- Continuer --"" :\n\
<Espace> Affiche la page suivante.\n\
<Entrée> Affiche la ligne suivante.\n"
IDS_CONTINUE "-- Continuer --"
IDS_CONTINUE_PROGRESS "-- Continuer (%d %%) --"
IDS_BAD_FLAG "Paramètre invalide - '%s'\n"
IDS_FILE_ACCESS "Impossible d'accéder au fichier %s.\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- Continuer%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d %%)"
IDS_CONTINUE_LINE_AT " [Ligne : %d]"
IDS_CONTINUE_OPTIONS " [Options : psfq=<Espace><Entrée>]"
IDS_CONTINUE_LINES " Lignes : "
END

View file

@ -42,11 +42,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- Continua --"
IDS_CONTINUE_PROGRESS "-- Continua (%d%%) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Impossibile accedere al file %s.\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- Continua%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d%%)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -51,11 +51,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- Toliau --"
IDS_CONTINUE_PROGRESS "-- Toliau (%d%%) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Nepavyko atverti bylos %s.\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- Toliau%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d%%)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -42,11 +42,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- Fortsett --"
IDS_CONTINUE_PROGRESS "-- Fortsett (%d%%) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Får ikke tilgang til filen %s.\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- Fortsett%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d%%)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -50,11 +50,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- Kontynuuj --"
IDS_CONTINUE_PROGRESS "-- Kontynuuj (%d%%) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Brak dostępu do pliku: %s.\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- Kontynuuj%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d%%)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -50,11 +50,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- Continuă --"
IDS_CONTINUE_PROGRESS "-- Continuă (%d%%) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Fișierul «%s» nu poate fi accesat!\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- Continuă%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d%%)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -50,11 +50,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- Продолжить --"
IDS_CONTINUE_PROGRESS "-- Продолжить (%d%%) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Нет доступа к файлу %s.\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- Продолжить%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d%%)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -46,11 +46,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- Pokračujte --"
IDS_CONTINUE_PROGRESS "-- Pokračujte (%d%%) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Neviem získať prístup k súboru %s.\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- Pokračujte%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d%%)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -46,11 +46,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- Vazhdo --"
IDS_CONTINUE_PROGRESS "-- Vazhdo (%d%%) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Nuk mund të aksesoj dokumentin %s.\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- Vazhdo%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d%%)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -49,11 +49,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- Fortsätt --"
IDS_CONTINUE_PROGRESS "-- Fortsätt (%d%%) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Får inte tillgång till filen %s.\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- Fortsätt%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d%%)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -44,11 +44,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- Sürdür --"
IDS_CONTINUE_PROGRESS "-- Sürdür (%%%d) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "%s kütüğüne erişilemiyor.\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- Sürdür%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%%%d)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -49,11 +49,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- Далi --"
IDS_CONTINUE_PROGRESS "-- Далi (%d%%) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "Не можу отримати доступ до файла %s.\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- Далi%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d%%)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -44,11 +44,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- 继续 --"
IDS_CONTINUE_PROGRESS "-- 继续 (%d%%) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "无法访问文件 %s。\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- 继续%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d%%)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -44,11 +44,11 @@ at the ""-- Continue --"" prompt:\n\
<Space> Display the next page.\n\
<Enter> Display the next line.\n"
IDS_CONTINUE "-- 繼續 --"
IDS_CONTINUE_PROGRESS "-- 繼續 (%d%%) --"
IDS_BAD_FLAG "Invalid argument - '%s'\n"
IDS_FILE_ACCESS "無法訪問檔案 %s。\n"
IDS_BAD_FLAG "Invalid argument - '%ls'\n"
IDS_CONTINUE_OPTIONS "-- Continue (%d%%) [Options: psfq=<Space><Enter>] --"
IDS_CONTINUE_LINES "-- Continue (%d%%) -- Lines: "
IDS_CONTINUE_LINE_AT "-- Continue (%d%%) [Line:%d] --"
IDS_CONTINUE_PROMPT "-- 繼續%1%2%3 --%4"
IDS_CONTINUE_PERCENT " (%d%%)"
IDS_CONTINUE_LINE_AT " [Line: %d]"
IDS_CONTINUE_OPTIONS " [Options: psfq=<Space><Enter>]"
IDS_CONTINUE_LINES " Lines: "
END

View file

@ -32,6 +32,7 @@
#include <winuser.h>
#include <conutils.h>
#include <strsafe.h>
#include "resource.h"
@ -51,19 +52,26 @@ HANDLE hKeyboard;
/* Enable/Disable extensions */
BOOL bEnableExtensions = TRUE; // FIXME: By default, it should be FALSE.
#define FLAG_HELP (1 << 0)
#define FLAG_E (1 << 1)
#define FLAG_C (1 << 2)
#define FLAG_P (1 << 3)
#define FLAG_S (1 << 4)
#define FLAG_Tn (1 << 5)
#define FLAG_PLUSn (1 << 6)
/* Parser flags */
#define FLAG_HELP (1 << 0)
#define FLAG_E (1 << 1)
#define FLAG_C (1 << 2)
#define FLAG_P (1 << 3)
#define FLAG_S (1 << 4)
#define FLAG_Tn (1 << 5)
#define FLAG_PLUSn (1 << 6)
/* Prompt flags */
#define PROMPT_PERCENT (1 << 0)
#define PROMPT_LINE_AT (1 << 1)
#define PROMPT_OPTIONS (1 << 2)
#define PROMPT_LINES (1 << 3)
static DWORD s_dwFlags = 0;
static LONG s_nTabWidth = 8;
static DWORD s_nNextLineNo = 0;
static BOOL s_bPrevLineIsBlank = FALSE;
static UINT s_nPromptID = IDS_CONTINUE_PROGRESS;
static WORD s_fPrompt = 0;
static BOOL s_bDoNextFile = FALSE;
static BOOL IsBlankLine(IN PCWCH line, IN DWORD cch)
@ -143,49 +151,69 @@ PagePrompt(PCON_PAGER Pager, DWORD Done, DWORD Total)
DWORD nLines;
WCHAR chSubCommand = 0;
/* Prompt strings (small size since the prompt should
* hold ideally on one <= 80-character line) */
static WCHAR StrPercent[80] = L"";
static WCHAR StrLineAt[80] = L"";
static WCHAR StrOptions[80] = L"";
static WCHAR StrLines[80] = L"";
WCHAR szPercent[80] = L"";
WCHAR szLineAt[80] = L"";
/* Load the prompt strings */
if (!*StrPercent)
K32LoadStringW(NULL, IDS_CONTINUE_PERCENT, StrPercent, ARRAYSIZE(StrPercent));
if (!*StrLineAt)
K32LoadStringW(NULL, IDS_CONTINUE_LINE_AT, StrLineAt, ARRAYSIZE(StrLineAt));
if (!*StrOptions)
K32LoadStringW(NULL, IDS_CONTINUE_OPTIONS, StrOptions, ARRAYSIZE(StrOptions));
if (!*StrLines)
K32LoadStringW(NULL, IDS_CONTINUE_LINES, StrLines, ARRAYSIZE(StrLines));
Restart:
nLines = 0;
/*
* Just use the simple prompt if the file being displayed is the STDIN,
* otherwise use the prompt with progress percentage.
*
* The progress percentage is evaluated as follows.
* So far we have read a total of 'dwSumReadBytes' bytes from the file.
* Amongst those is the latest read chunk of 'dwReadBytes' bytes, to which
* correspond a number of 'dwReadChars' characters with which we have called
* ConWritePaging who called PagePrompt. We then have: Total == dwReadChars.
* During this ConWritePaging call the PagePrompt was called after 'Done'
* number of characters over 'Total'.
* It should be noted that for 'dwSumReadBytes' number of bytes read it
* *roughly* corresponds 'dwSumReadChars' number of characters. This is
* because there may be some failures happening during the conversion of
* the bytes read to the character string for a given encoding.
* Therefore the number of characters displayed on screen is equal to:
* dwSumReadChars - Total + Done ,
* but the best corresponding approximed number of bytes would be:
* dwSumReadBytes - (Total - Done) * (dwSumReadBytes / dwSumReadChars) ,
* where the ratio is the average number of bytes per character.
* The percentage is then computed relative to the total file size.
*/
if (hFile == hStdIn)
{
ConResPuts(Pager->Screen->Stream, IDS_CONTINUE);
}
else
/* Do not show the progress percentage when STDIN is being displayed */
if (s_fPrompt & PROMPT_PERCENT) // && (hFile != hStdIn)
{
/*
* The progress percentage is evaluated as follows.
* So far we have read a total of 'dwSumReadBytes' bytes from the file.
* Amongst those is the latest read chunk of 'dwReadBytes' bytes, to which
* correspond a number of 'dwReadChars' characters with which we have called
* ConWritePaging who called PagePrompt. We then have: Total == dwReadChars.
* During this ConWritePaging call the PagePrompt was called after 'Done'
* number of characters over 'Total'.
* It should be noted that for 'dwSumReadBytes' number of bytes read it
* *roughly* corresponds 'dwSumReadChars' number of characters. This is
* because there may be some failures happening during the conversion of
* the bytes read to the character string for a given encoding.
* Therefore the number of characters displayed on screen is equal to:
* dwSumReadChars - Total + Done ,
* but the best corresponding approximed number of bytes would be:
* dwSumReadBytes - (Total - Done) * (dwSumReadBytes / dwSumReadChars) ,
* where the ratio is the average number of bytes per character.
* The percentage is then computed relative to the total file size.
*/
DWORD dwPercent = (dwSumReadBytes - (Total - Done) *
(dwSumReadBytes / dwSumReadChars)) * 100 / dwFileSize;
if (s_nPromptID == IDS_CONTINUE_LINE_AT)
{
ConResPrintf(Pager->Screen->Stream, s_nPromptID, dwPercent, Pager->lineno);
}
else
{
ConResPrintf(Pager->Screen->Stream, s_nPromptID, dwPercent);
}
StringCchPrintfW(szPercent, ARRAYSIZE(szPercent), StrPercent, dwPercent);
}
s_nPromptID = IDS_CONTINUE_PROGRESS;
if (s_fPrompt & PROMPT_LINE_AT)
{
StringCchPrintfW(szLineAt, ARRAYSIZE(szLineAt), StrLineAt, Pager->lineno);
}
/* Suitably format and display the prompt */
ConResMsgPrintf(Pager->Screen->Stream, 0, IDS_CONTINUE_PROMPT,
(s_fPrompt & PROMPT_PERCENT ? szPercent : L""),
(s_fPrompt & PROMPT_LINE_AT ? szLineAt : L""),
(s_fPrompt & PROMPT_OPTIONS ? StrOptions : L""),
(s_fPrompt & PROMPT_LINES ? StrLines : L""));
/* Reset the prompt to a default state */
s_fPrompt &= ~(PROMPT_LINE_AT | PROMPT_OPTIONS | PROMPT_LINES);
/* RemoveBreakHandler */
SetConsoleCtrlHandler(NULL, TRUE);
@ -364,7 +392,7 @@ Restart:
/* '?': Show Options */
if (KeyEvent.uChar.UnicodeChar == L'?')
{
s_nPromptID = IDS_CONTINUE_OPTIONS;
s_fPrompt |= PROMPT_OPTIONS;
goto Restart;
}
@ -389,7 +417,7 @@ Restart:
/* 'P': Display n lines */
if (KeyEvent.wVirtualKeyCode == L'P')
{
s_nPromptID = IDS_CONTINUE_LINES;
s_fPrompt |= PROMPT_LINES;
chSubCommand = L'P';
goto Restart;
}
@ -397,7 +425,7 @@ Restart:
/* 'S': Skip n lines */
if (KeyEvent.wVirtualKeyCode == L'S')
{
s_nPromptID = IDS_CONTINUE_LINES;
s_fPrompt |= PROMPT_LINES;
chSubCommand = L'S';
goto Restart;
}
@ -405,11 +433,10 @@ Restart:
/* '=': Show current line number */
if (KeyEvent.uChar.UnicodeChar == L'=')
{
s_nPromptID = IDS_CONTINUE_LINE_AT;
s_fPrompt |= PROMPT_LINE_AT;
goto Restart;
}
s_nPromptID = IDS_CONTINUE_PROGRESS;
chSubCommand = 0;
goto Restart;
}
@ -1048,7 +1075,7 @@ int wmain(int argc, WCHAR* argv[])
/* Reset state for paging */
s_bPrevLineIsBlank = FALSE;
s_nPromptID = IDS_CONTINUE_PROGRESS;
s_fPrompt = PROMPT_PERCENT;
s_bDoNextFile = FALSE;
/* Update the statistics for PagePrompt */

View file

@ -1,10 +1,11 @@
#pragma once
#define IDS_USAGE 100
#define IDS_CONTINUE 101
#define IDS_CONTINUE_PROGRESS 102
#define IDS_FILE_ACCESS 103
#define IDS_BAD_FLAG 104
#define IDS_CONTINUE_OPTIONS 105
#define IDS_CONTINUE_LINES 106
#define IDS_CONTINUE_LINE_AT 107
#define IDS_BAD_FLAG 101
#define IDS_FILE_ACCESS 102
#define IDS_CONTINUE_PROMPT 110
#define IDS_CONTINUE_PERCENT 111
#define IDS_CONTINUE_LINE_AT 112
#define IDS_CONTINUE_OPTIONS 113
#define IDS_CONTINUE_LINES 114