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
diff options
context:
space:
mode:
authorWengier <wengierwu@yahoo.com>2022-05-03 06:46:39 +0300
committerWengier <wengierwu@yahoo.com>2022-05-03 06:46:39 +0300
commitc21f0bdc20c132713b13b2e0c1b11c5ecb43836d (patch)
tree1cdb6d11563666ed471afa6b2621c9587807dcdc
parenteb4f81c3f742fb5ff5183f1dfbacdaebd69eb0f7 (diff)
Replace FindExist with FindOption for existing command optionsww/dbopt
-rw-r--r--src/debug/debug.cpp4
-rw-r--r--src/dos/program_autotype.cpp6
-rw-r--r--src/dos/program_boot.cpp4
-rw-r--r--src/dos/program_imgmount.cpp14
-rw-r--r--src/dos/program_intro.cpp2
-rw-r--r--src/dos/program_keyb.cpp2
-rw-r--r--src/dos/program_loadfix.cpp4
-rw-r--r--src/dos/program_loadrom.cpp2
-rw-r--r--src/dos/program_mem.cpp4
-rw-r--r--src/dos/program_mount.cpp9
-rw-r--r--src/dos/program_rescan.cpp4
-rw-r--r--src/dos/program_serial.cpp2
-rw-r--r--src/hardware/mixer.cpp8
-rw-r--r--src/misc/setup.cpp4
-rw-r--r--src/shell/shell.cpp2
15 files changed, 36 insertions, 35 deletions
diff --git a/src/debug/debug.cpp b/src/debug/debug.cpp
index 940822968..6b2aa0147 100644
--- a/src/debug/debug.cpp
+++ b/src/debug/debug.cpp
@@ -2159,8 +2159,8 @@ public:
void Run()
{
- if(cmd->FindExist("/NOMOUSE",false)) {
- real_writed(0,0x33<<2,0);
+ if (cmd->FindSlashOption("NOMOUSE", false)) {
+ real_writed(0, 0x33 << 2, 0);
return;
}
diff --git a/src/dos/program_autotype.cpp b/src/dos/program_autotype.cpp
index 78f521044..0783b053f 100644
--- a/src/dos/program_autotype.cpp
+++ b/src/dos/program_autotype.cpp
@@ -120,14 +120,14 @@ void AUTOTYPE::Run()
ChangeToLongCmd();
// Usage
- if (!cmd->GetCount() || cmd->FindExist("/?", false) ||
- cmd->FindExist("-?", false) || cmd->FindExist("-help", false)) {
+ if (!cmd->GetCount() || cmd->FindOption("?", false) ||
+ cmd->FindDashOption("h", false) || cmd->FindDashOption("help", false)) {
WriteOut(MSG_Get("SHELL_CMD_AUTOTYPE_HELP_LONG"));
return;
}
// Print available keys
- if (cmd->FindExist("-list", false)) {
+ if (cmd->FindDashOption("list", false)) {
PrintKeys();
return;
}
diff --git a/src/dos/program_boot.cpp b/src/dos/program_boot.cpp
index 210539ea4..d075ed37e 100644
--- a/src/dos/program_boot.cpp
+++ b/src/dos/program_boot.cpp
@@ -164,8 +164,8 @@ void BOOT::Run(void)
return;
}
- if (cmd->FindExist("/?", false) || cmd->FindExist("-?", false) ||
- cmd->FindExist("-h", false) || cmd->FindExist("--help", false)) {
+ if (cmd->FindOption("?", false) || cmd->FindDashOption("h", false) ||
+ cmd->FindDashOption("help", false)) {
WriteOut(MSG_Get("SHELL_CMD_BOOT_HELP_LONG"));
return;
}
diff --git a/src/dos/program_imgmount.cpp b/src/dos/program_imgmount.cpp
index 45db51751..b87851c7a 100644
--- a/src/dos/program_imgmount.cpp
+++ b/src/dos/program_imgmount.cpp
@@ -93,10 +93,10 @@ void IMGMOUNT::Run(void) {
return;
}
// Usage
- if (cmd->FindExist("/?", false) ||
- cmd->FindExist("-h", false) || cmd->FindExist("--help", false)) {
- WriteOut(MSG_Get("SHELL_CMD_IMGMOUNT_HELP_LONG"), PRIMARY_MOD_NAME);
- return;
+ if (cmd->FindOption("?", false) || cmd->FindDashOption("h", false) ||
+ cmd->FindDashOption("help", false)) {
+ WriteOut(MSG_Get("SHELL_CMD_IMGMOUNT_HELP_LONG"), PRIMARY_MOD_NAME);
+ return;
}
/* In secure mode don't allow people to change imgmount points.
@@ -121,7 +121,7 @@ void IMGMOUNT::Run(void) {
cmd->FindString("-fs",fstype,true);
bool roflag = false;
- if (cmd->FindExist("-ro", true))
+ if (cmd->FindDashOption("ro", true))
roflag = true;
// Types 'cdrom' and 'iso' are synonyms. Name 'cdrom' is easier
@@ -147,8 +147,8 @@ void IMGMOUNT::Run(void) {
std::string ide_value = {};
int8_t ide_index = -1;
bool is_second_cable_slot = false;
- const bool wants_ide = cmd->FindString("-ide", ide_value, true) || cmd->FindExist("-ide", true);
-
+ const bool wants_ide = cmd->FindStringOption("ide", ide_value, true) ||
+ cmd->FindDashOption("ide", true);
if (type == "floppy") {
mediaid = 0xF0;
diff --git a/src/dos/program_intro.cpp b/src/dos/program_intro.cpp
index 870a95db8..a5e97d6e8 100644
--- a/src/dos/program_intro.cpp
+++ b/src/dos/program_intro.cpp
@@ -48,7 +48,7 @@ void INTRO::DisplayMount(void) {
void INTRO::Run(void) {
// Usage
- if (cmd->FindExist("/?", false) || cmd->FindExist("-?", false)) {
+ if (cmd->FindOption("?", false)) {
WriteOut(MSG_Get("SHELL_CMD_INTRO_HELP_LONG"));
return;
}
diff --git a/src/dos/program_keyb.cpp b/src/dos/program_keyb.cpp
index e543b6f65..51a191edf 100644
--- a/src/dos/program_keyb.cpp
+++ b/src/dos/program_keyb.cpp
@@ -25,7 +25,7 @@
void KEYB::Run(void) {
if (cmd->FindCommand(1,temp_line)) {
- if (cmd->FindExist("/?", false) || cmd->FindExist("-?", false) ||
+ if (cmd->FindOption("?", false) ||
cmd->FindString("?", temp_line, false)) {
WriteOut(MSG_Get("PROGRAM_KEYB_HELP_LONG"));
} else {
diff --git a/src/dos/program_loadfix.cpp b/src/dos/program_loadfix.cpp
index 48e9d6214..998656a94 100644
--- a/src/dos/program_loadfix.cpp
+++ b/src/dos/program_loadfix.cpp
@@ -26,8 +26,8 @@
void LOADFIX::Run(void)
{
- if (cmd->FindExist("/?", false) || cmd->FindExist("-?", false) ||
- cmd->FindExist("-h", false) || cmd->FindExist("--help", false)) {
+ if (cmd->FindOption("?", false) || cmd->FindDashOption("h", false) ||
+ cmd->FindDashOption("help", false)) {
WriteOut(MSG_Get("SHELL_CMD_LOADFIX_HELP_LONG"));
return;
}
diff --git a/src/dos/program_loadrom.cpp b/src/dos/program_loadrom.cpp
index cdfca34d2..2f6e13a95 100644
--- a/src/dos/program_loadrom.cpp
+++ b/src/dos/program_loadrom.cpp
@@ -33,7 +33,7 @@ void LOADROM::Run(void) {
WriteOut(MSG_Get("PROGRAM_LOADROM_SPECIFY_FILE"));
return;
}
- if (cmd->FindExist("/?", false) || cmd->FindExist("-?", false)) {
+ if (cmd->FindOption("?", false)) {
WriteOut(MSG_Get("SHELL_CMD_LOADROM_HELP_LONG"));
return;
}
diff --git a/src/dos/program_mem.cpp b/src/dos/program_mem.cpp
index 707a0cc7a..98106cd09 100644
--- a/src/dos/program_mem.cpp
+++ b/src/dos/program_mem.cpp
@@ -24,8 +24,8 @@
#include "regs.h"
void MEM::Run(void) {
- if (cmd->FindExist("/?", false) || cmd->FindExist("-?", false) ||
- cmd->FindExist("-h", false) || cmd->FindExist("--help", false)) {
+ if (cmd->FindOption("?", false) || cmd->FindDashOption("h", false) ||
+ cmd->FindDashOption("help", false)) {
WriteOut(MSG_Get("SHELL_CMD_MEM_HELP_LONG"));
return;
}
diff --git a/src/dos/program_mount.cpp b/src/dos/program_mount.cpp
index 91d2ccc16..ffa76e40b 100644
--- a/src/dos/program_mount.cpp
+++ b/src/dos/program_mount.cpp
@@ -141,22 +141,23 @@ void MOUNT::Run(void) {
return;
}
bool path_relative_to_last_config = false;
- if (cmd->FindExist("-pr",true)) path_relative_to_last_config = true;
+ if (cmd->FindDashOption("pr", true))
+ path_relative_to_last_config = true;
/* Check for unmounting */
- if (cmd->FindString("-u",umount,false)) {
+ if (cmd->FindStringOption("u", umount, false)) {
WriteOut(UnmountHelper(umount[0]), toupper(umount[0]));
return;
}
/* Check for moving Z: */
/* Only allowing moving it once. It is merely a convenience added for the wine team */
- if (ZDRIVE_NUM == 25 && cmd->FindString("-z", newz,false)) {
+ if (ZDRIVE_NUM == 25 && cmd->FindStringOption("z", newz, false)) {
Move_Z(newz[0]);
return;
}
- if (cmd->FindExist("-cd", false) || cmd->FindExist("-listcd", false)) {
+ if (cmd->FindDashOption("cd", false) || cmd->FindDashOption("listcd", false)) {
int num = SDL_CDNumDrives();
WriteOut(MSG_Get("PROGRAM_MOUNT_CDROMS_FOUND"), num);
for (int i = 0; i < num; i++)
diff --git a/src/dos/program_rescan.cpp b/src/dos/program_rescan.cpp
index 7c1b28c8b..508220508 100644
--- a/src/dos/program_rescan.cpp
+++ b/src/dos/program_rescan.cpp
@@ -26,8 +26,8 @@ void RESCAN::Run(void)
uint8_t drive = DOS_GetDefaultDrive();
- if (cmd->FindExist("/?", false) || cmd->FindExist("-?", false) ||
- cmd->FindExist("-h", false) || cmd->FindExist("--help", false)) {
+ if (cmd->FindOption("?", false) || cmd->FindDashOption("h", false) ||
+ cmd->FindDashOption("help", false)) {
WriteOut(MSG_Get("SHELL_CMD_RESCAN_HELP_LONG"));
return;
}
diff --git a/src/dos/program_serial.cpp b/src/dos/program_serial.cpp
index f6a10b330..1f6204895 100644
--- a/src/dos/program_serial.cpp
+++ b/src/dos/program_serial.cpp
@@ -63,7 +63,7 @@ void SERIAL::Run()
}
// Select COM port type.
- if (cmd->GetCount() >= 1 && !cmd->FindExist("/?", false)) {
+ if (cmd->GetCount() >= 1 && !cmd->FindSlashOption("?", false)) {
// Which COM did they want to change?
int port = -1;
cmd->FindCommand(1, temp_line);
diff --git a/src/hardware/mixer.cpp b/src/hardware/mixer.cpp
index ae90d7a9c..20231b888 100644
--- a/src/hardware/mixer.cpp
+++ b/src/hardware/mixer.cpp
@@ -952,12 +952,12 @@ public:
void Run()
{
- if (cmd->FindExist("/?", false) || cmd->FindExist("-?", false) ||
- cmd->FindExist("-h", false) || cmd->FindExist("--help", false)) {
+ if (cmd->FindOption("?", false) || cmd->FindDashOption("h", false) ||
+ cmd->FindDashOption("help", false)) {
WriteOut(MSG_Get("SHELL_CMD_MIXER_HELP_LONG"));
return;
}
- if(cmd->FindExist("/LISTMIDI")) {
+ if (cmd->FindSlashOption("LISTMIDI")) {
ListMidi();
return;
}
@@ -980,7 +980,7 @@ public:
}
lock.unlock();
- if (cmd->FindExist("/NOSHOW"))
+ if (cmd->FindSlashOption("NOSHOW"))
return;
WriteOut("Channel Main Main(dB) Rate(Hz) Lineout mode\n");
ShowSettings("MASTER", mixer.mastervol[0], mixer.mastervol[1],
diff --git a/src/misc/setup.cpp b/src/misc/setup.cpp
index b1513b046..ed848ead9 100644
--- a/src/misc/setup.cpp
+++ b/src/misc/setup.cpp
@@ -1550,8 +1550,8 @@ void SETUP_ParseConfigFiles(const std::string &config_path)
}
// Second: parse the local 'dosbox.conf', if present
- const bool wants_local_conf =
- !control->cmdline->FindDashOption("nolocalconf", true);
+ const bool wants_local_conf = !control->cmdline->FindDashOption("nolocalconf",
+ true);
if (wants_local_conf) {
control->ParseConfigFile("local", "dosbox.conf");
}
diff --git a/src/shell/shell.cpp b/src/shell/shell.cpp
index c253d7d1e..f93eff537 100644
--- a/src/shell/shell.cpp
+++ b/src/shell/shell.cpp
@@ -483,7 +483,7 @@ void DOS_Shell::Run()
char input_line[CMD_MAXLINE] = {0};
std::string line;
- if (cmd->FindExist("/?", false) || cmd->FindExist("-?", false)) {
+ if (cmd->FindOption("?", false)) {
WriteOut(MSG_Get("SHELL_CMD_COMMAND_HELP_LONG"));
return;
}