Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dosbox-staging/dosbox-staging.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFeralChild64 <unknown>2022-11-04 01:38:07 +0300
committerkcgen <1557255+kcgen@users.noreply.github.com>2022-11-05 22:11:05 +0300
commit00a39f76cd781d066345272b85da86da1ddd7db5 (patch)
tree992754477dd56fe908882d5fa627c02fa00c62ee /src
parentd4249413b95c610b1535a6c40ddd46eb51fdf890 (diff)
Cleanup string IDs of DOS programs
Diffstat (limited to 'src')
-rw-r--r--src/dos/program_autotype.cpp4
-rw-r--r--src/dos/program_boot.cpp4
-rw-r--r--src/dos/program_imgmount.cpp4
-rw-r--r--src/dos/program_intro.cpp22
-rw-r--r--src/dos/program_keyb.cpp4
-rw-r--r--src/dos/program_loadfix.cpp4
-rw-r--r--src/dos/program_loadrom.cpp4
-rw-r--r--src/dos/program_mem.cpp4
-rw-r--r--src/dos/program_more.cpp44
-rw-r--r--src/dos/program_mount.cpp8
-rw-r--r--src/dos/program_mousectl.cpp110
-rw-r--r--src/dos/program_placeholder.cpp8
-rw-r--r--src/dos/program_rescan.cpp4
-rw-r--r--src/dos/program_serial.cpp4
-rw-r--r--src/misc/help_util.cpp25
-rw-r--r--src/shell/shell.cpp18
16 files changed, 142 insertions, 129 deletions
diff --git a/src/dos/program_autotype.cpp b/src/dos/program_autotype.cpp
index a14af3cfb..f1725a0b0 100644
--- a/src/dos/program_autotype.cpp
+++ b/src/dos/program_autotype.cpp
@@ -121,7 +121,7 @@ void AUTOTYPE::Run()
// Usage
if (!cmd->GetCount() || HelpRequested()) {
- WriteOut(MSG_Get("SHELL_CMD_AUTOTYPE_HELP_LONG"));
+ WriteOut(MSG_Get("PROGRAM_AUTOTYPE_HELP_LONG"));
return;
}
@@ -160,7 +160,7 @@ void AUTOTYPE::Run()
}
void AUTOTYPE::AddMessages() {
- MSG_Add("SHELL_CMD_AUTOTYPE_HELP_LONG",
+ MSG_Add("PROGRAM_AUTOTYPE_HELP_LONG",
"Performs scripted keyboard entry into a running DOS game.\n"
"\n"
"Usage:\n"
diff --git a/src/dos/program_boot.cpp b/src/dos/program_boot.cpp
index 608349396..04b16236d 100644
--- a/src/dos/program_boot.cpp
+++ b/src/dos/program_boot.cpp
@@ -166,7 +166,7 @@ void BOOT::Run(void)
}
if (HelpRequested()) {
- WriteOut(MSG_Get("SHELL_CMD_BOOT_HELP_LONG"));
+ WriteOut(MSG_Get("PROGRAM_BOOT_HELP_LONG"));
return;
}
if (cmd->GetCount() == 1) {
@@ -502,7 +502,7 @@ void BOOT::Run(void)
}
void BOOT::AddMessages() {
- MSG_Add("SHELL_CMD_BOOT_HELP_LONG",
+ MSG_Add("PROGRAM_BOOT_HELP_LONG",
"Boots DOSBox Staging from a DOS drive or disk image.\n"
"\n"
"Usage:\n"
diff --git a/src/dos/program_imgmount.cpp b/src/dos/program_imgmount.cpp
index 77e9b58f2..feb78a944 100644
--- a/src/dos/program_imgmount.cpp
+++ b/src/dos/program_imgmount.cpp
@@ -96,7 +96,7 @@ void IMGMOUNT::Run(void) {
}
// Usage
if (HelpRequested()) {
- WriteOut(MSG_Get("SHELL_CMD_IMGMOUNT_HELP_LONG"), PRIMARY_MOD_NAME);
+ WriteOut(MSG_Get("PROGRAM_IMGMOUNT_HELP_LONG"), PRIMARY_MOD_NAME);
return;
}
@@ -492,7 +492,7 @@ void IMGMOUNT::Run(void) {
void IMGMOUNT::AddMessages() {
AddCommonMountMessages();
- MSG_Add("SHELL_CMD_IMGMOUNT_HELP_LONG",
+ MSG_Add("PROGRAM_IMGMOUNT_HELP_LONG",
"Mount a CD-ROM, floppy, or disk image to a drive letter.\n"
"\n"
"Usage:\n"
diff --git a/src/dos/program_intro.cpp b/src/dos/program_intro.cpp
index 7a492e8cc..b20f22f0d 100644
--- a/src/dos/program_intro.cpp
+++ b/src/dos/program_intro.cpp
@@ -66,9 +66,9 @@ void INTRO::DisplayMount(void) {
void INTRO::Run(void) {
// Usage
if (HelpRequested()) {
- WriteOut(MSG_Get("SHELL_CMD_INTRO_HELP"));
+ WriteOut(MSG_Get("PROGRAM_INTRO_HELP"));
WriteOut("\n");
- WriteOut(MSG_Get("SHELL_CMD_INTRO_HELP_LONG"));
+ WriteOut(MSG_Get("PROGRAM_INTRO_HELP_LONG"));
return;
}
/* Only run if called from the first shell (Xcom TFTD runs any intro file in the path) */
@@ -106,6 +106,24 @@ void INTRO::Run(void) {
}
void INTRO::AddMessages() {
+ MSG_Add("PROGRAM_INTRO_HELP",
+ "Displays a full-screen introduction to DOSBox Staging.\n");
+ MSG_Add("PROGRAM_INTRO_HELP_LONG",
+ "Usage:\n"
+ " [color=green]intro[reset]\n"
+ " [color=green]intro[reset] [color=white]PAGE[reset]\n"
+ "\n"
+ "Where:\n"
+ " [color=white]PAGE[reset] is the page name to display, including [color=white]cdrom[reset], [color=white]mount[reset], and [color=white]special[reset].\n"
+ "\n"
+ "Notes:\n"
+ " Running [color=green]intro[reset] without an argument displays one information page at a time;\n"
+ " press any key to move to the next page. If a page name is provided, then the\n"
+ " specified page will be displayed directly.\n"
+ "\n"
+ "Examples:\n"
+ " [color=green]intro[reset]\n"
+ " [color=green]intro[reset] [color=white]cdrom[reset]\n");
MSG_Add("PROGRAM_INTRO",
"[erases=entire][color=green]Welcome to DOSBox Staging[reset], an x86 emulator with sound and graphics.\n"
"DOSBox creates a shell for you which looks like old plain DOS.\n"
diff --git a/src/dos/program_keyb.cpp b/src/dos/program_keyb.cpp
index f43808ea9..1d72ef088 100644
--- a/src/dos/program_keyb.cpp
+++ b/src/dos/program_keyb.cpp
@@ -59,7 +59,7 @@ void KEYB::Run(void) {
// One argument: asked for help
if (HelpRequested()) {
- WriteOut(MSG_Get("SHELL_CMD_KEYB_HELP_LONG"));
+ WriteOut(MSG_Get("PROGRAM_KEYB_HELP_LONG"));
return;
}
@@ -95,7 +95,7 @@ void KEYB::Run(void) {
void KEYB::AddMessages() {
MSG_Add("PROGRAM_KEYB_INFO","Codepage %i has been loaded\n");
MSG_Add("PROGRAM_KEYB_INFO_LAYOUT","Codepage %i has been loaded for layout %s\n");
- MSG_Add("SHELL_CMD_KEYB_HELP_LONG",
+ MSG_Add("PROGRAM_KEYB_HELP_LONG",
"Configures a keyboard for a specific language.\n"
"\n"
"Usage:\n"
diff --git a/src/dos/program_loadfix.cpp b/src/dos/program_loadfix.cpp
index aa8d6b874..88889ef38 100644
--- a/src/dos/program_loadfix.cpp
+++ b/src/dos/program_loadfix.cpp
@@ -27,7 +27,7 @@
void LOADFIX::Run(void)
{
if (HelpRequested()) {
- WriteOut(MSG_Get("SHELL_CMD_LOADFIX_HELP_LONG"));
+ WriteOut(MSG_Get("PROGRAM_LOADFIX_HELP_LONG"));
return;
}
uint16_t commandNr = 1;
@@ -83,7 +83,7 @@ void LOADFIX::Run(void)
}
void LOADFIX::AddMessages() {
- MSG_Add("SHELL_CMD_LOADFIX_HELP_LONG",
+ MSG_Add("PROGRAM_LOADFIX_HELP_LONG",
"Loads a program in the specific memory region and then runs it.\n"
"\n"
"Usage:\n"
diff --git a/src/dos/program_loadrom.cpp b/src/dos/program_loadrom.cpp
index ab3f55080..f11c8d4b7 100644
--- a/src/dos/program_loadrom.cpp
+++ b/src/dos/program_loadrom.cpp
@@ -34,7 +34,7 @@ void LOADROM::Run(void) {
return;
}
if (HelpRequested()) {
- WriteOut(MSG_Get("SHELL_CMD_LOADROM_HELP_LONG"));
+ WriteOut(MSG_Get("PROGRAM_LOADROM_HELP_LONG"));
return;
}
uint8_t drive;
@@ -101,7 +101,7 @@ void LOADROM::Run(void) {
}
void LOADROM::AddMessages() {
- MSG_Add("SHELL_CMD_LOADROM_HELP_LONG",
+ MSG_Add("PROGRAM_LOADROM_HELP_LONG",
"Loads a ROM image of the video BIOS or IBM BASIC.\n"
"\n"
"Usage:\n"
diff --git a/src/dos/program_mem.cpp b/src/dos/program_mem.cpp
index 33164b919..c0c1cd1e7 100644
--- a/src/dos/program_mem.cpp
+++ b/src/dos/program_mem.cpp
@@ -25,7 +25,7 @@
void MEM::Run(void) {
if (HelpRequested()) {
- WriteOut(MSG_Get("SHELL_CMD_MEM_HELP_LONG"));
+ WriteOut(MSG_Get("PROGRAM_MEM_HELP_LONG"));
return;
}
/* Show conventional Memory */
@@ -87,7 +87,7 @@ void MEM::Run(void) {
}
void MEM::AddMessages() {
- MSG_Add("SHELL_CMD_MEM_HELP_LONG",
+ MSG_Add("PROGRAM_MEM_HELP_LONG",
"Displays the DOS memory information.\n"
"\n"
"Usage:\n"
diff --git a/src/dos/program_more.cpp b/src/dos/program_more.cpp
index ba1849702..84864d6e1 100644
--- a/src/dos/program_more.cpp
+++ b/src/dos/program_more.cpp
@@ -42,7 +42,7 @@ void MORE::Run()
{
// Handle command line
if (HelpRequested()) {
- WriteOut(MSG_Get("SHELL_CMD_MORE_HELP_LONG"));
+ WriteOut(MSG_Get("PROGRAM_MORE_HELP_LONG"));
return;
}
if (!ParseCommandLine() || shutdown_requested)
@@ -71,7 +71,7 @@ void MORE::Run()
if (max_lines - line_counter < free_rows_threshold)
PromptUser();
- WriteOut(MSG_Get("SHELL_CMD_MORE_END"));
+ WriteOut(MSG_Get("PROGRAM_MORE_END"));
WriteOut("\n");
}
@@ -169,7 +169,7 @@ bool MORE::FindInputFiles(const std::vector<std::string> &params)
dos.dta(save_dta);
if (!shutdown_requested && input_files.empty()) {
- WriteOut(MSG_Get("SHELL_CMD_MORE_NO_FILE"));
+ WriteOut(MSG_Get("PROGRAM_MORE_NO_FILE"));
WriteOut("\n");
return false;
}
@@ -228,8 +228,8 @@ void MORE::DisplayInputFiles()
LOG_WARNING("DOS: MORE.COM - could not open '%s'",
input_file.name.c_str());
const auto short_name = GetShortName(input_file.name,
- "SHELL_CMD_MORE_OPEN_ERROR");
- WriteOut(MSG_Get("SHELL_CMD_MORE_OPEN_ERROR"), short_name.c_str());
+ "PROGRAM_MORE_OPEN_ERROR");
+ WriteOut(MSG_Get("PROGRAM_MORE_OPEN_ERROR"), short_name.c_str());
WriteOut("\n");
++line_counter;
continue;
@@ -237,12 +237,12 @@ void MORE::DisplayInputFiles()
if (input_file.is_device) {
const auto short_name = GetShortName(input_file.name,
- "SHELL_CMD_MORE_NEW_DEVICE");
- WriteOut(MSG_Get("SHELL_CMD_MORE_NEW_DEVICE"), short_name.c_str());
+ "PROGRAM_MORE_NEW_DEVICE");
+ WriteOut(MSG_Get("PROGRAM_MORE_NEW_DEVICE"), short_name.c_str());
} else {
const auto short_name = GetShortName(input_file.name,
- "SHELL_CMD_MORE_NEW_FILE");
- WriteOut(MSG_Get("SHELL_CMD_MORE_NEW_FILE"), short_name.c_str());
+ "PROGRAM_MORE_NEW_FILE");
+ WriteOut(MSG_Get("PROGRAM_MORE_NEW_FILE"), short_name.c_str());
}
WriteOut("\n");
++line_counter;
@@ -362,9 +362,9 @@ MORE::Decision MORE::PromptUser()
WriteOut("\n");
if (multiple_files)
- WriteOut(MSG_Get("SHELL_CMD_MORE_PROMPT_MULTI"));
+ WriteOut(MSG_Get("PROGRAM_MORE_PROMPT_MULTI"));
else
- WriteOut(MSG_Get("SHELL_CMD_MORE_PROMPT_SINGLE"));
+ WriteOut(MSG_Get("PROGRAM_MORE_PROMPT_SINGLE"));
auto decision = Decision::Terminate;
while (!shutdown_requested) {
@@ -396,7 +396,7 @@ MORE::Decision MORE::PromptUser()
if (decision == Decision::Terminate || decision == Decision::NextFile) {
WriteOut(" ");
- WriteOut(MSG_Get("SHELL_CMD_MORE_TERMINATE"));
+ WriteOut(MSG_Get("PROGRAM_MORE_TERMINATE"));
WriteOut("\n");
++line_counter;
} else {
@@ -469,9 +469,7 @@ uint8_t MORE::GetCurrentRow()
void MORE::AddMessages()
{
- MSG_Add("SHELL_CMD_MORE_HELP",
- "Display command output or text file one screen at a time.\n");
- MSG_Add("SHELL_CMD_MORE_HELP_LONG",
+ MSG_Add("PROGRAM_MORE_HELP_LONG",
"Display command output or text file one screen at a time.\n"
"\n"
"Usage:\n"
@@ -493,12 +491,12 @@ void MORE::AddMessages()
" [color=cyan]dir /on[reset] | [color=green]more[reset] ; displays sorted directory one screen at a time\n"
" [color=green]more[reset] /t[color=white]4[reset] < [color=cyan]A:\\MANUAL.TXT[reset] ; shows the file's content with tab size 4\n");
- MSG_Add("SHELL_CMD_MORE_NO_FILE", "No input file found.");
- MSG_Add("SHELL_CMD_MORE_END", "[reset][color=light-yellow]--- end of input ---[reset]");
- MSG_Add("SHELL_CMD_MORE_NEW_FILE", "[reset][color=light-yellow]--- file %s ---[reset]");
- MSG_Add("SHELL_CMD_MORE_NEW_DEVICE", "[reset][color=light-yellow]--- device %s ---[reset]");
- MSG_Add("SHELL_CMD_MORE_PROMPT_SINGLE", "[reset][color=light-yellow]--- press SPACE for more ---[reset]");
- MSG_Add("SHELL_CMD_MORE_PROMPT_MULTI", "[reset][color=light-yellow]--- press SPACE for more, N for next file ---[reset]");
- MSG_Add("SHELL_CMD_MORE_OPEN_ERROR", "[reset][color=red]--- could not open %s ---[reset]");
- MSG_Add("SHELL_CMD_MORE_TERMINATE", "[reset][color=light-yellow](terminated)[reset]");
+ MSG_Add("PROGRAM_MORE_NO_FILE", "No input file found.");
+ MSG_Add("PROGRAM_MORE_END", "[reset][color=light-yellow]--- end of input ---[reset]");
+ MSG_Add("PROGRAM_MORE_NEW_FILE", "[reset][color=light-yellow]--- file %s ---[reset]");
+ MSG_Add("PROGRAM_MORE_NEW_DEVICE", "[reset][color=light-yellow]--- device %s ---[reset]");
+ MSG_Add("PROGRAM_MORE_PROMPT_SINGLE", "[reset][color=light-yellow]--- press SPACE for more ---[reset]");
+ MSG_Add("PROGRAM_MORE_PROMPT_MULTI", "[reset][color=light-yellow]--- press SPACE for more, N for next file ---[reset]");
+ MSG_Add("PROGRAM_MORE_OPEN_ERROR", "[reset][color=red]--- could not open %s ---[reset]");
+ MSG_Add("PROGRAM_MORE_TERMINATE", "[reset][color=light-yellow](terminated)[reset]");
}
diff --git a/src/dos/program_mount.cpp b/src/dos/program_mount.cpp
index a8f7ca12e..131c4d590 100644
--- a/src/dos/program_mount.cpp
+++ b/src/dos/program_mount.cpp
@@ -137,7 +137,7 @@ void MOUNT::Run(void) {
// a side effect of not being able to parse the correct
// command line options.
if (HelpRequested()) {
- WriteOut(MSG_Get("SHELL_CMD_MOUNT_HELP_LONG"));
+ WriteOut(MSG_Get("PROGRAM_MOUNT_HELP_LONG"));
return;
}
@@ -405,16 +405,16 @@ void MOUNT::Run(void) {
if (type == "floppy") incrementFDD();
return;
showusage:
- WriteOut(MSG_Get("SHELL_CMD_MOUNT_HELP_LONG"));
+ WriteOut(MSG_Get("PROGRAM_MOUNT_HELP_LONG"));
return;
}
void MOUNT::AddMessages() {
AddCommonMountMessages();
- MSG_Add("SHELL_CMD_MOUNT_HELP",
+ MSG_Add("PROGRAM_MOUNT_HELP",
"maps physical folders or drives to a virtual drive letter.\n");
- MSG_Add("SHELL_CMD_MOUNT_HELP_LONG",
+ MSG_Add("PROGRAM_MOUNT_HELP_LONG",
"Mount a directory from the host OS to a drive letter.\n"
"\n"
"Usage:\n"
diff --git a/src/dos/program_mousectl.cpp b/src/dos/program_mousectl.cpp
index ad0159c1e..efe47c87e 100644
--- a/src/dos/program_mousectl.cpp
+++ b/src/dos/program_mousectl.cpp
@@ -31,7 +31,7 @@ CHECK_NARROWING();
void MOUSECTL::Run()
{
if (HelpRequested()) {
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_HELP_LONG"));
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_HELP_LONG"));
return;
}
@@ -110,7 +110,7 @@ bool MOUSECTL::ParseAndRun()
return CmdSensitivity(params[1], params[2]);
}
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_SYNTAX"));
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_SYNTAX"));
return false;
}
@@ -120,14 +120,14 @@ bool MOUSECTL::ParseSensitivity(const std::string &param, int16_t &value)
int tmp = 0;
if (!ParseIntParam(param, tmp)) {
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_SYNTAX_SENSITIVITY"));
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_SYNTAX_SENSITIVITY"));
return false;
}
// Maximum allowed user sensitivity value
constexpr int16_t sensitivity_user_max = 999;
if (tmp < -sensitivity_user_max || tmp > sensitivity_user_max) {
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_SYNTAX_SENSITIVITY"));
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_SYNTAX_SENSITIVITY"));
return false;
}
@@ -176,7 +176,7 @@ bool MOUSECTL::ParseInterfaces(std::vector<std::string> &params)
// Check that all interfaces are unique
const std::set<MouseInterfaceId> tmp(list_ids.begin(), list_ids.end());
if (list_ids.size() != tmp.size()) {
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_SYNTAX_DUPLICATED"));
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_SYNTAX_DUPLICATED"));
return false;
}
@@ -189,9 +189,9 @@ bool MOUSECTL::CheckInterfaces()
return true;
if (list_ids.empty())
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_NO_INTERFACES"));
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_NO_INTERFACES"));
else
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_MISSING_INTERFACES"));
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_MISSING_INTERFACES"));
return false;
}
@@ -200,13 +200,13 @@ const char *MOUSECTL::GetMapStatusStr(const MouseMapStatus map_status)
{
switch (map_status) {
case MouseMapStatus::HostPointer:
- return MSG_Get("SHELL_CMD_MOUSECTL_TABLE_STATUS_HOST");
+ return MSG_Get("PROGRAM_MOUSECTL_TABLE_STATUS_HOST");
case MouseMapStatus::Mapped:
- return MSG_Get("SHELL_CMD_MOUSECTL_TABLE_STATUS_MAPPED");
+ return MSG_Get("PROGRAM_MOUSECTL_TABLE_STATUS_MAPPED");
case MouseMapStatus::Disconnected:
- return MSG_Get("SHELL_CMD_MOUSECTL_TABLE_STATUS_DISCONNECTED");
+ return MSG_Get("PROGRAM_MOUSECTL_TABLE_STATUS_DISCONNECTED");
case MouseMapStatus::Disabled:
- return MSG_Get("SHELL_CMD_MOUSECTL_TABLE_STATUS_DISABLED");
+ return MSG_Get("PROGRAM_MOUSECTL_TABLE_STATUS_DISABLED");
default:
assert(false); // missing implementation
return nullptr;
@@ -224,7 +224,7 @@ bool MOUSECTL::CmdShow(const bool show_all)
// Display emulated interface list
WriteOut("\n");
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_TABLE_HEADER1"));
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_TABLE_HEADER1"));
WriteOut("\n");
for (const auto &entry : info_interfaces) {
if (!entry.IsEmulated())
@@ -242,7 +242,7 @@ bool MOUSECTL::CmdShow(const bool show_all)
interface_id == MouseInterfaceId::COM4)
hint_rate_com = true;
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_TABLE_LAYOUT1"),
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_TABLE_LAYOUT1"),
MouseControlAPI::GetInterfaceNameStr(interface_id).c_str(),
entry.GetSensitivityX(),
entry.GetSensitivityY(),
@@ -260,11 +260,11 @@ bool MOUSECTL::CmdShow(const bool show_all)
const bool hint = hint_rate_com || hint_rate_min;
if (hint) {
if (hint_rate_com) {
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_TABLE_HINT_RATE_COM"));
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_TABLE_HINT_RATE_COM"));
WriteOut("\n");
}
if (hint_rate_min) {
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_TABLE_HINT_RATE_MIN"));
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_TABLE_HINT_RATE_MIN"));
WriteOut("\n");
}
WriteOut("\n");
@@ -275,14 +275,14 @@ bool MOUSECTL::CmdShow(const bool show_all)
const auto info_physical = mouse_config_api.GetInfoPhysical();
if (info_physical.empty()) {
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_NO_PHYSICAL_MICE"));
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_NO_PHYSICAL_MICE"));
WriteOut("\n\n");
return true;
}
if (hint)
WriteOut("\n");
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_TABLE_HEADER2"));
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_TABLE_HEADER2"));
WriteOut("\n");
// Display physical mice mapped to some interface
@@ -290,7 +290,7 @@ bool MOUSECTL::CmdShow(const bool show_all)
for (const auto &entry : info_interfaces) {
if (!entry.IsMapped() || entry.IsMappedDeviceDisconnected())
continue;
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_TABLE_LAYOUT2"),
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_TABLE_LAYOUT2"),
MouseControlAPI::GetInterfaceNameStr(entry.GetInterfaceId())
.c_str(),
entry.GetMappedDeviceName().c_str());
@@ -308,7 +308,7 @@ bool MOUSECTL::CmdShow(const bool show_all)
for (const auto &entry : info_physical) {
if (entry.IsMapped() || entry.IsDeviceDisconnected())
continue;
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_TABLE_LAYOUT2_UNMAPPED"),
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_TABLE_LAYOUT2_UNMAPPED"),
entry.GetDeviceName().c_str());
WriteOut("\n");
}
@@ -320,7 +320,7 @@ bool MOUSECTL::CmdShow(const bool show_all)
void MOUSECTL::FinalizeMapping()
{
WriteOut("\n");
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_MAP_HINT"));
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_MAP_HINT"));
WriteOut("\n\n");
}
@@ -328,18 +328,18 @@ bool MOUSECTL::CmdMap(const MouseInterfaceId interface_id, const std::string &pa
{
std::regex regex;
if (!MouseControlAPI::PatternToRegex(pattern, regex)) {
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_SYNTAX_PATTERN"));
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_SYNTAX_PATTERN"));
return false;
}
if (MouseControlAPI::IsNoMouseMode()) {
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_MAPPING_NO_MOUSE"));
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_MAPPING_NO_MOUSE"));
return false;
}
MouseControlAPI mouse_config_api;
if (!mouse_config_api.Map(interface_id, regex)) {
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_NO_MATCH"));
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_NO_MATCH"));
return false;
}
@@ -352,7 +352,7 @@ bool MOUSECTL::CmdMap()
assert(!list_ids.empty());
if (MouseControlAPI::IsNoMouseMode()) {
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_MAPPING_NO_MOUSE"));
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_MAPPING_NO_MOUSE"));
return false;
}
@@ -360,7 +360,7 @@ bool MOUSECTL::CmdMap()
const auto info_physical = mouse_config_api.GetInfoPhysical();
if (info_physical.empty()) {
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_NO_PHYSICAL_MICE"));
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_NO_PHYSICAL_MICE"));
WriteOut("\n\n");
return false;
}
@@ -370,7 +370,7 @@ bool MOUSECTL::CmdMap()
mouse_config_api.UnMap(empty);
WriteOut("\n");
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_MAP_ADVICE"));
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_MAP_ADVICE"));
WriteOut("\n\n");
for (const auto &interface_id : list_ids) {
@@ -381,7 +381,7 @@ bool MOUSECTL::CmdMap()
if (!mouse_config_api.ProbeForMapping(device_id)) {
mouse_config_api.UnMap(empty);
WriteOut("\b");
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_MAP_CANCEL"));
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_MAP_CANCEL"));
WriteOut("\n\n");
return false;
}
@@ -479,14 +479,14 @@ bool MOUSECTL::CmdMinRate(const std::string &param)
int tmp = 0;
if (!ParseIntParam(param, tmp)) {
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_SYNTAX_MIN_RATE"),
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_SYNTAX_MIN_RATE"),
valid_str.c_str());
return false;
}
if (tmp < 0 || tmp > UINT16_MAX) {
// Parameter way out of range
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_SYNTAX_MIN_RATE"),
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_SYNTAX_MIN_RATE"),
valid_str.c_str());
return false;
}
@@ -494,7 +494,7 @@ bool MOUSECTL::CmdMinRate(const std::string &param)
const auto value_hz = static_cast<uint16_t>(tmp);
if (!contains(valid_list, value_hz)) {
// Parameter not in the list of allowed values
- WriteOut(MSG_Get("SHELL_CMD_MOUSECTL_SYNTAX_MIN_RATE"),
+ WriteOut(MSG_Get("PROGRAM_MOUSECTL_SYNTAX_MIN_RATE"),
valid_str.c_str());
return false;
}
@@ -513,7 +513,7 @@ bool MOUSECTL::CmdMinRate()
void MOUSECTL::AddMessages()
{
- MSG_Add("SHELL_CMD_MOUSECTL_HELP_LONG",
+ MSG_Add("PROGRAM_MOUSECTL_HELP_LONG",
"Manages physical and logical mice.\n"
"\n"
"Usage:\n"
@@ -539,53 +539,53 @@ void MOUSECTL::AddMessages()
"Examples:\n"
" [color=green]mousectl[reset] [color=white]DOS[reset] [color=white]COM1[reset] -map ; asks user to select mice for a two player game");
- MSG_Add("SHELL_CMD_MOUSECTL_SYNTAX", "Wrong command syntax.");
- MSG_Add("SHELL_CMD_MOUSECTL_SYNTAX_PATTERN",
+ MSG_Add("PROGRAM_MOUSECTL_SYNTAX", "Wrong command syntax.");
+ MSG_Add("PROGRAM_MOUSECTL_SYNTAX_PATTERN",
"Wrong syntax, only ASCII characters allowed in pattern.");
- MSG_Add("SHELL_CMD_MOUSECTL_SYNTAX_SENSITIVITY",
+ MSG_Add("PROGRAM_MOUSECTL_SYNTAX_SENSITIVITY",
"Wrong syntax, sensitivity needs to be in -999 to +999 range.");
- MSG_Add("SHELL_CMD_MOUSECTL_SYNTAX_DUPLICATED",
+ MSG_Add("PROGRAM_MOUSECTL_SYNTAX_DUPLICATED",
"Wrong syntax, duplicated mouse interfaces.");
- MSG_Add("SHELL_CMD_MOUSECTL_SYNTAX_MIN_RATE",
+ MSG_Add("PROGRAM_MOUSECTL_SYNTAX_MIN_RATE",
"Wrong syntax, sampling rate has to be one of:\n%s");
- MSG_Add("SHELL_CMD_MOUSECTL_MAPPING_NO_MOUSE",
+ MSG_Add("PROGRAM_MOUSECTL_MAPPING_NO_MOUSE",
"Mapping not available in no-mouse mode.");
- MSG_Add("SHELL_CMD_MOUSECTL_NO_INTERFACES", "No mouse interfaces available.");
- MSG_Add("SHELL_CMD_MOUSECTL_MISSING_INTERFACES",
+ MSG_Add("PROGRAM_MOUSECTL_NO_INTERFACES", "No mouse interfaces available.");
+ MSG_Add("PROGRAM_MOUSECTL_MISSING_INTERFACES",
"Mouse interface not available.");
- MSG_Add("SHELL_CMD_MOUSECTL_NO_PHYSICAL_MICE", "No physical mice detected.");
- MSG_Add("SHELL_CMD_MOUSECTL_NO_MATCH",
+ MSG_Add("PROGRAM_MOUSECTL_NO_PHYSICAL_MICE", "No physical mice detected.");
+ MSG_Add("PROGRAM_MOUSECTL_NO_MATCH",
"No available mouse matching the pattern found.");
- MSG_Add("SHELL_CMD_MOUSECTL_TABLE_HEADER1",
+ MSG_Add("PROGRAM_MOUSECTL_TABLE_HEADER1",
"[color=white]Interface Sensitivity Rate (Hz) Status[reset]");
- MSG_Add("SHELL_CMD_MOUSECTL_TABLE_LAYOUT1",
+ MSG_Add("PROGRAM_MOUSECTL_TABLE_LAYOUT1",
"[color=cyan]%-4s[reset] X:%+.3d Y:%+.3d %1s %3s %s");
- MSG_Add("SHELL_CMD_MOUSECTL_TABLE_HEADER2",
+ MSG_Add("PROGRAM_MOUSECTL_TABLE_HEADER2",
"[color=white]Interface Mouse Name[reset]");
- MSG_Add("SHELL_CMD_MOUSECTL_TABLE_LAYOUT2",
+ MSG_Add("PROGRAM_MOUSECTL_TABLE_LAYOUT2",
"[color=cyan]%-4s[reset] %s");
- MSG_Add("SHELL_CMD_MOUSECTL_TABLE_LAYOUT2_UNMAPPED", "not mapped %s");
+ MSG_Add("PROGRAM_MOUSECTL_TABLE_LAYOUT2_UNMAPPED", "not mapped %s");
- MSG_Add("SHELL_CMD_MOUSECTL_TABLE_STATUS_HOST", "uses system pointer");
- MSG_Add("SHELL_CMD_MOUSECTL_TABLE_STATUS_MAPPED", "mapped physical mouse");
- MSG_Add("SHELL_CMD_MOUSECTL_TABLE_STATUS_DISCONNECTED",
+ MSG_Add("PROGRAM_MOUSECTL_TABLE_STATUS_HOST", "uses system pointer");
+ MSG_Add("PROGRAM_MOUSECTL_TABLE_STATUS_MAPPED", "mapped physical mouse");
+ MSG_Add("PROGRAM_MOUSECTL_TABLE_STATUS_DISCONNECTED",
"[color=red]mapped mouse disconnected[reset]");
- MSG_Add("SHELL_CMD_MOUSECTL_TABLE_STATUS_DISABLED", "disabled");
+ MSG_Add("PROGRAM_MOUSECTL_TABLE_STATUS_DISABLED", "disabled");
- MSG_Add("SHELL_CMD_MOUSECTL_TABLE_HINT_RATE_COM",
+ MSG_Add("PROGRAM_MOUSECTL_TABLE_HINT_RATE_COM",
"Sampling rates for mice on [color=cyan]COM[reset] interfaces are estimations only.");
- MSG_Add("SHELL_CMD_MOUSECTL_TABLE_HINT_RATE_MIN",
+ MSG_Add("PROGRAM_MOUSECTL_TABLE_HINT_RATE_MIN",
"Sampling rates with minimum value set are marked with '*'.");
- MSG_Add("SHELL_CMD_MOUSECTL_MAP_ADVICE",
+ MSG_Add("PROGRAM_MOUSECTL_MAP_ADVICE",
"Click [color=white]left[reset] mouse button to map the physical mouse to the interface. Clicking\n"
"any other button cancels the mapping and assigns system pointer to all the\n"
"mouse interfaces.");
- MSG_Add("SHELL_CMD_MOUSECTL_MAP_CANCEL", "(mapping cancelled)");
- MSG_Add("SHELL_CMD_MOUSECTL_MAP_HINT",
+ MSG_Add("PROGRAM_MOUSECTL_MAP_CANCEL", "(mapping cancelled)");
+ MSG_Add("PROGRAM_MOUSECTL_MAP_HINT",
"Mouse captured. Seamless mouse integration is always disabled while mapping is\n"
"in effect and mapped mice always receive raw input events.");
}
diff --git a/src/dos/program_placeholder.cpp b/src/dos/program_placeholder.cpp
index cf6da1223..f6859a041 100644
--- a/src/dos/program_placeholder.cpp
+++ b/src/dos/program_placeholder.cpp
@@ -26,19 +26,19 @@ void PLACEHOLDER::Run()
{
const auto command = cmd->GetFileName();
- LOG_WARNING("%s: %s", command, MSG_Get("SHELL_CMD_PLACEHOLDER_HELP"));
+ LOG_WARNING("%s: %s", command, MSG_Get("PROGRAM_PLACEHOLDER_HELP"));
LOG_WARNING("%s: %s", command, MSG_Get("VISIT_FOR_MORE_HELP"));
LOG_WARNING("%s: %s/%s", command, MSG_Get("WIKI_URL"), "Add-Utilities");
- WriteOut(MSG_Get("SHELL_CMD_PLACEHOLDER_HELP_LONG"), command);
+ WriteOut(MSG_Get("PROGRAM_PLACEHOLDER_HELP_LONG"), command);
WriteOut_NoParsing(MSG_Get("UTILITY_DRIVE_EXAMPLE_NO_TRANSLATE"));
result_errorcode = dos.return_code;
}
void PLACEHOLDER::AddMessages() {
- MSG_Add("SHELL_CMD_PLACEHOLDER_HELP", "This program is a placeholder");
- MSG_Add("SHELL_CMD_PLACEHOLDER_HELP_LONG",
+ MSG_Add("PROGRAM_PLACEHOLDER_HELP", "This program is a placeholder");
+ MSG_Add("PROGRAM_PLACEHOLDER_HELP_LONG",
"%s is only a placeholder.\n"
"\nInstall a 3rd-party and give its PATH precedence.\n"
"\nFor example:");
diff --git a/src/dos/program_rescan.cpp b/src/dos/program_rescan.cpp
index ca0f533f8..a3ea36007 100644
--- a/src/dos/program_rescan.cpp
+++ b/src/dos/program_rescan.cpp
@@ -29,7 +29,7 @@ void RESCAN::Run(void)
uint8_t drive = DOS_GetDefaultDrive();
if (HelpRequested()) {
- WriteOut(MSG_Get("SHELL_CMD_RESCAN_HELP_LONG"));
+ WriteOut(MSG_Get("PROGRAM_RESCAN_HELP_LONG"));
return;
}
@@ -59,7 +59,7 @@ void RESCAN::Run(void)
}
void RESCAN::AddMessages() {
- MSG_Add("SHELL_CMD_RESCAN_HELP_LONG",
+ MSG_Add("PROGRAM_RESCAN_HELP_LONG",
"Scans for changes on mounted DOS drives.\n"
"\n"
"Usage:\n"
diff --git a/src/dos/program_serial.cpp b/src/dos/program_serial.cpp
index 029ab3a27..98ef983be 100644
--- a/src/dos/program_serial.cpp
+++ b/src/dos/program_serial.cpp
@@ -164,11 +164,11 @@ void SERIAL::Run()
}
// Show help.
- WriteOut(MSG_Get("SHELL_CMD_SERIAL_HELP_LONG"), SERIAL_MAX_PORTS);
+ WriteOut(MSG_Get("PROGRAM_SERIAL_HELP_LONG"), SERIAL_MAX_PORTS);
}
void SERIAL::AddMessages() {
- MSG_Add("SHELL_CMD_SERIAL_HELP_LONG",
+ MSG_Add("PROGRAM_SERIAL_HELP_LONG",
"Manages the serial ports.\n"
"\n"
"Usage:\n"
diff --git a/src/misc/help_util.cpp b/src/misc/help_util.cpp
index 7d4365b06..759a21dc9 100644
--- a/src/misc/help_util.cpp
+++ b/src/misc/help_util.cpp
@@ -24,16 +24,31 @@ const std::map<const std::string, HELP_Detail> &HELP_GetHelpList()
std::string HELP_GetShortHelp(const std::string &cmd_name)
{
- const std::string short_key = "SHELL_CMD_" + cmd_name + "_HELP";
- if (MSG_Exists(short_key.c_str())) {
- return MSG_Get(short_key.c_str());
+ // Try to find short help first
+ const std::string short_key_command = "SHELL_CMD_" + cmd_name + "_HELP";
+ if (MSG_Exists(short_key_command.c_str())) {
+ return MSG_Get(short_key_command.c_str());
}
- const std::string long_key = "SHELL_CMD_" + cmd_name + "_HELP_LONG";
- if (MSG_Exists(long_key.c_str())) {
+ const std::string short_key_program = "PROGRAM_" + cmd_name + "_HELP";
+ if (MSG_Exists(short_key_program.c_str())) {
+ return MSG_Get(short_key_program.c_str());
+ }
+
+ // If it does not exist, extract first line of long help
+ auto extract = [](const std::string &long_key) {
const std::string str(MSG_Get(long_key.c_str()));
const auto pos = str.find('\n');
return str.substr(0, pos != std::string::npos ? pos + 1 : pos);
+ };
+ const std::string long_key_command = "SHELL_CMD_" + cmd_name + "_HELP_LONG";
+ if (MSG_Exists(long_key_command.c_str())) {
+ return extract(long_key_command);
}
+ const std::string long_key_program = "PROGRAM_" + cmd_name + "_HELP_LONG";
+ if (MSG_Exists(long_key_program.c_str())) {
+ return extract(long_key_program);
+ }
+
return "No help available\n";
}
diff --git a/src/shell/shell.cpp b/src/shell/shell.cpp
index 05563040b..d039f5531 100644
--- a/src/shell/shell.cpp
+++ b/src/shell/shell.cpp
@@ -1192,24 +1192,6 @@ void SHELL_Init() {
"Examples:\n"
" [color=green]help[reset] [color=cyan]dir[reset]\n"
" [color=green]help[reset] /all\n");
- MSG_Add("SHELL_CMD_INTRO_HELP",
- "Displays a full-screen introduction to DOSBox Staging.\n");
- MSG_Add("SHELL_CMD_INTRO_HELP_LONG",
- "Usage:\n"
- " [color=green]intro[reset]\n"
- " [color=green]intro[reset] [color=white]PAGE[reset]\n"
- "\n"
- "Where:\n"
- " [color=white]PAGE[reset] is the page name to display, including [color=white]cdrom[reset], [color=white]mount[reset], and [color=white]special[reset].\n"
- "\n"
- "Notes:\n"
- " Running [color=green]intro[reset] without an argument displays one information page at a time;\n"
- " press any key to move to the next page. If a page name is provided, then the\n"
- " specified page will be displayed directly.\n"
- "\n"
- "Examples:\n"
- " [color=green]intro[reset]\n"
- " [color=green]intro[reset] [color=white]cdrom[reset]\n");
MSG_Add("SHELL_CMD_MKDIR_HELP", "Creates a directory.\n");
MSG_Add("SHELL_CMD_MKDIR_HELP_LONG",
"Usage:\n"