Add (set)ver.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2674
This commit is contained in:
parent
a2c6e8305a
commit
39bcdda8c2
3 changed files with 18 additions and 4 deletions
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: shell.h,v 1.16 2006-05-25 15:08:40 qbix79 Exp $ */
|
||||
/* $Id: shell.h,v 1.17 2006-07-21 09:40:10 qbix79 Exp $ */
|
||||
|
||||
#ifndef DOSBOX_SHELL_H
|
||||
#define DOSBOX_SHELL_H
|
||||
|
@ -106,6 +106,7 @@ public:
|
|||
void CMD_ATTRIB(char * args);
|
||||
void CMD_PATH(char * args);
|
||||
void CMD_SHIFT(char * /*args*/);
|
||||
void CMD_VER(char * args);
|
||||
/* The shell's variables */
|
||||
Bit16u input_handle;
|
||||
BatchFile * bf;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: shell.cpp,v 1.75 2006-06-30 20:04:21 qbix79 Exp $ */
|
||||
/* $Id: shell.cpp,v 1.76 2006-07-21 09:40:10 qbix79 Exp $ */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
@ -509,6 +509,8 @@ void SHELL_Init() {
|
|||
MSG_Add("SHELL_CMD_CHOICE_HELP","Waits for a keypress and sets ERRORLEVEL.\n");
|
||||
MSG_Add("SHELL_CMD_ATTRIB_HELP","Does nothing. Provided for compatibility.\n");
|
||||
MSG_Add("SHELL_CMD_PATH_HELP","Provided for compatibility.\n");
|
||||
MSG_Add("SHELL_CMD_VER_HELP","View and set the reported DOS version.\n");
|
||||
MSG_Add("SHELL_CMD_VER_VER","DOSBox version %s. Reported DOS version %d.%d.\n");
|
||||
|
||||
/* Regular startup */
|
||||
call_shellstop=CALLBACK_Allocate();
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: shell_cmds.cpp,v 1.67 2006-05-25 15:08:40 qbix79 Exp $ */
|
||||
/* $Id: shell_cmds.cpp,v 1.68 2006-07-21 09:40:10 qbix79 Exp $ */
|
||||
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
@ -59,6 +59,7 @@ static SHELL_Cmd cmd_list[]={
|
|||
{ "CHOICE", 0, &DOS_Shell::CMD_CHOICE, "SHELL_CMD_CHOICE_HELP"},
|
||||
{ "ATTRIB", 0, &DOS_Shell::CMD_ATTRIB, "SHELL_CMD_ATTRIB_HELP"},
|
||||
{ "PATH", 1, &DOS_Shell::CMD_PATH, "SHELL_CMD_PATH_HELP"},
|
||||
{ "VER", 0, &DOS_Shell::CMD_VER, "SHELL_CMD_VER_HELP"},
|
||||
{0,0,0,0}
|
||||
};
|
||||
bool DOS_Shell::CheckConfig(char* cmd,char*line) {
|
||||
|
@ -500,7 +501,7 @@ void DOS_Shell::CMD_COPY(char * args) {
|
|||
|
||||
bool ret=DOS_FindFirst(source,0xffff & ~DOS_ATTR_VOLUME);
|
||||
if (!ret) {
|
||||
WriteOut(MSG_Get("SHELL_CMD_FILE_NOT_FOUND"),args);
|
||||
WriteOut(MSG_Get("SHELL_CMD_FILE_NOT_FOUND"),source);
|
||||
dos.dta(save_dta);
|
||||
return;
|
||||
}
|
||||
|
@ -857,3 +858,13 @@ void DOS_Shell::CMD_PATH(char *args){
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DOS_Shell::CMD_VER(char *args) {
|
||||
if(args && *args) {
|
||||
char* word = StripWord(args);
|
||||
if(strcasecmp(word,"set")) return;
|
||||
word = StripWord(args);
|
||||
dos.version.major = atoi(word);
|
||||
dos.version.minor = atoi(args);
|
||||
} else WriteOut(MSG_Get("SHELL_CMD_VER_VER"),VERSION,dos.version.major,dos.version.minor);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue