Subversion Repositories SvarDOS

Compare Revisions

Ignore whitespace Rev 988 → Rev 989

/svarcom/trunk/cmd/break.c
1,7 → 1,7
/* This file is part of the SvarCOM project and is published under the terms
* of the MIT license.
*
* Copyright (C) 2021 Mateusz Viste
* Copyright (C) 2021-2022 Mateusz Viste
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
30,11 → 30,11
unsigned char brkflag = 0;
 
if (cmd_ishlp(p)) {
outputnl("Sets or clears extended CTRL+C checking");
nls_outputnl(14,0); /* "Sets or clears extended CTRL+C checking" */
outputnl("");
outputnl("BREAK [ON | OFF]");
outputnl("");
outputnl("Type BREAK without a parameter to display the current BREAK setting.");
nls_outputnl(14,1); /* "Type BREAK without a parameter to display the current BREAK setting." */
return(CMD_OK);
}
 
52,9 → 52,9
pop ax
}
if (brkflag == 0) {
outputnl("BREAK is off");
nls_outputnl(14,2); /* "BREAK is off" */
} else {
outputnl("BREAK is on");
nls_outputnl(14,3); /* "BREAK is on" */
}
return(CMD_OK);
}
61,7 → 61,7
 
/* too many params? */
if (p->argc > 1) {
outputnl("Too many parameters");
nls_outputnl(0,4);
return(CMD_FAIL);
}
 
69,7 → 69,7
if (imatch(p->argv[0], "on")) {
brkflag = 1;
} else if (!imatch(p->argv[0], "off")) {
outputnl("Invalid parameter");
nls_outputnl(0,6); /* "Invalid parameter" */
return(CMD_FAIL);
}
 
/svarcom/trunk/cmd/call.c
33,9 → 33,9
 
static enum cmd_result cmd_call(struct cmd_funcparam *p) {
if (cmd_ishlp(p)) {
outputnl("Calls one batch program from another");
nls_outputnl(13,0); /* "Calls one batch program from another" */
outputnl("");
outputnl("CALL [drive:][path]filename [batch-parameters]");
nls_outputnl(13,1); /* "CALL [drive:][path]filename [batch-parameters]" */
return(CMD_OK);
}
 
/svarcom/trunk/cmd/cd.c
1,7 → 1,7
/* This file is part of the SvarCOM project and is published under the terms
* of the MIT license.
*
* Copyright (C) 2021 Mateusz Viste
* Copyright (C) 2021-2022 Mateusz Viste
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
40,23 → 40,23
 
/* CD /? */
if (cmd_ishlp(p)) {
outputnl("Displays the name of or changes the current directory.");
nls_outputnl(12,0); /* "Displays the name of or changes the current directory." */
outputnl("");
outputnl("CHDIR [drive:][path]");
outputnl("CHDIR[..]");
outputnl("CD [drive:][path]");
outputnl("CD[..]");
nls_outputnl(12,1); /* "CHDIR [drive:][path]" */
nls_outputnl(12,2); /* "CHDIR[..]" */
nls_outputnl(12,3); /* "CD [drive:][path]" */
nls_outputnl(12,4); /* "CD[..]" */
outputnl("");
outputnl(".. Specifies that you want to change to the parent directory.");
nls_outputnl(12,5); /* ".. Specifies that you want to change to the parent directory." */
outputnl("");
outputnl("Type CD drive: to display the current directory in the specified drive.");
outputnl("Type CD without parameters to display the current drive and directory.");
nls_outputnl(12,6); /* "Type CD drive: to display the current directory in the specified drive." */
nls_outputnl(12,7); /* "Type CD without parameters to display the current drive and directory." */
return(CMD_OK);
}
 
/* one argument max */
if (p->argc > 1) {
outputnl("Too many parameters");
nls_outputnl(0,4); /* "Too many parameters" */
return(CMD_FAIL);
}
 
/svarcom/trunk/cmd/chcp.c
1,7 → 1,7
/* This file is part of the SvarCOM project and is published under the terms
* of the MIT license.
*
* Copyright (C) 2021 Mateusz Viste
* Copyright (C) 2021-2022 Mateusz Viste
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
31,19 → 31,19
unsigned short errcode = 0;
 
if (cmd_ishlp(p)) {
outputnl("Displays or sets the active code page number");
nls_outputnl(11,0); /* "Displays or sets the active code page number" */
outputnl("");
outputnl("CHCP [nnn]");
nls_outputnl(11,1); /* "CHCP [nnn]" */
outputnl("");
outputnl("nnn Specifies a code page number");
nls_outputnl(11,2); /* "nnn Specifies a code page number" */
outputnl("");
outputnl("Type CHCP without a parameter to display the active code page number.");
nls_outputnl(11,3); /* "Type CHCP without a parameter to display the active code page number." */
return(CMD_OK);
}
 
/* too many parameters */
if (p->argc > 1) {
outputnl("Too many parameters");
nls_outputnl(0,4); /* "Too many parameters" */
return(CMD_FAIL);
}
 
51,7 → 51,7
if (p->argc == 1) {
unsigned char nlsfuncflag = 0;
if (atous(&nnn, p->argv[0]) != 0) {
outputnl("Invalid code page number");
nls_outputnl(11,4); /* "Invalid code page number" */
return(CMD_FAIL);
}
_asm {
78,9 → 78,9
pop ax
}
if (nlsfuncflag == 0) {
outputnl("NLSFUNC not installed");
nls_outputnl(11,5); /* "NLSFUNC not installed" */
} else if (errcode != 0) {
outputnl("Failed to change code page");
nls_outputnl(11,6); /* "Failed to change code page" */
return(CMD_FAIL);
}
 
103,7 → 103,9
pop ax
}
if (errcode == 0) {
sprintf(p->BUFFER, "Active code page: %d", nnn);
nls_output(11,7); /* Active code page: */
output(" ");
sprintf(p->BUFFER, "%u", nnn);
outputnl(p->BUFFER);
} else {
nls_outputnl_doserr(errcode);
/svarcom/trunk/cmd/cls.c
1,7 → 1,7
/* This file is part of the SvarCOM project and is published under the terms
* of the MIT license.
*
* Copyright (C) 2021 Mateusz Viste
* Copyright (C) 2021-2022 Mateusz Viste
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
31,7 → 31,7
const char *ansiesc = "\x1B[2J$";
 
if (cmd_ishlp(p)) {
outputnl("Clears the screen");
nls_outputnl(10,0); /* "Clears the screen" */
outputnl("");
outputnl("CLS");
return(CMD_OK);
/svarcom/trunk/cmd/date.c
1,7 → 1,7
/* This file is part of the SvarCOM project and is published under the terms
* of the MIT license.
*
* Copyright (C) 2021 Mateusz Viste
* Copyright (C) 2021-2022 Mateusz Viste
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
138,12 → 138,11
unsigned char mo, dy;
 
if (cmd_ishlp(p)) {
outputnl("Displays or sets the system date.");
nls_outputnl(32,0); /* "Displays or sets the system date."); */
outputnl("");
outputnl("DATE [date]");
nls_outputnl(32,1); /* "DATE [date]" */
outputnl("");
outputnl("Type DATE with no parameters to display the current date and a prompt for a");
outputnl("new one. Press ENTER to keep the same date.");
nls_outputnl(32,2); /* "Type DATE with no parameters to display the (...)" */
return(CMD_OK);
}
 
173,12 → 172,12
}
buff[0] = ' ';
nls_format_date(buff + 1, year, mo, dy, nls);
output("Current date is");
nls_output(32,4); /* "Current date is" */
outputnl(buff);
year = 0;
} else { /* parse date if provided */
if ((cmd_date_parse(p->argv[0], &year, &mo, &dy, nls) != 0) || (cmd_date_set(year, mo, dy) != 0)) {
outputnl("Invalid date");
nls_outputnl(32,3); /* "Invalid date" */
year = 0;
}
}
185,7 → 184,7
 
/* ask for date if not provided or if input was malformed */
while (year == 0) {
output("Enter new date:");
nls_output(32,5); /* "Enter new date:" */
output(" ");
/* collect user input into buff */
_asm {
219,7 → 218,7
}
if (buff[1] == 0) break; /* empty string = no date change */
if ((cmd_date_parse(buff + 2, &year, &mo, &dy, nls) == 0) && (cmd_date_set(year, mo, dy) == 0)) break;
outputnl("Invalid date");
nls_outputnl(32,3); /* "Invalid date" */
}
 
return(CMD_OK);
/svarcom/trunk/cmd/echo.c
1,7 → 1,7
/* This file is part of the SvarCOM project and is published under the terms
* of the MIT license.
*
* Copyright (C) 2021 Mateusz Viste
* Copyright (C) 2021-2022 Mateusz Viste
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
31,12 → 31,12
 
/* display help only if /? is the only argument */
if ((p->argc == 1) && (imatch(p->argv[0], "/?"))) {
outputnl("Displays messages, or turns command-echoing on or off");
nls_outputnl(31,0); /* "Displays messages, or turns command-echoing on or off" */
outputnl("");
outputnl("ECHO [ON | OFF]");
outputnl("ECHO [message]");
nls_outputnl(31,1); /* "ECHO [message]" */
outputnl("");
outputnl("Type ECHO without parameters to display the current echo setting.");
nls_outputnl(31,2); /* "Type ECHO without parameters to display the current setting." */
return(CMD_OK);
}
 
43,9 → 43,9
/* ECHO without any parameter: display current state */
if (p->argc == 0) {
if (p->rmod->flags & FLAG_ECHOFLAG) {
outputnl("ECHO is on");
nls_outputnl(31,3); /* "ECHO is on" */
} else {
outputnl("ECHO is off");
nls_outputnl(31,4); /* "ECHO is off" */
}
return(CMD_OK);
}
/svarcom/trunk/cmd/exit.c
1,7 → 1,7
/* This file is part of the SvarCOM project and is published under the terms
* of the MIT license.
*
* Copyright (C) 2021 Mateusz Viste
* Copyright (C) 2021-2022 Mateusz Viste
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
32,7 → 32,7
static enum cmd_result cmd_exit(struct cmd_funcparam *p) {
if (cmd_ishlp(p)) {
outputnl("EXIT\r\n");
outputnl("Quits the COMMAND.COM program (command interpreter)");
nls_outputnl(30,0); /* "Quits the COMMAND.COM program (command interpreter)" */
} else {
sayonara(p->rmod);
}
/svarcom/trunk/cmd/ln.c
44,7 → 44,7
 
/* does EXENAME in DIRECTORY exist? */
if (lookup_cmd(buff, linkname, realdirname, &ext) != 0) {
outputnl("No matching executable found in given path.");
nls_outputnl(29,4); /* "No matching executable found in given path." */
return(CMD_FAIL);
}
 
103,7 → 103,7
/* is the argument valid? (must not contain any dot nor backslash) */
for (i = 0; linkname[i] != 0; i++) {
if ((linkname[i] == '.') || (linkname[i] == '/') || (linkname[i] == '\\')) {
outputnl("Bad link name");
nls_outputnl(0,3); /* "Invalid parameter format" */
return(CMD_OK);
}
}
151,7 → 151,7
case '.':
case '/':
case '\\':
outputnl("Invalid link pattern");
nls_outputnl(0,3); /* "Invalid parameter format" */
return(CMD_FAIL);
}
}
162,7 → 162,7
/* fetch %DOSDIR% */
pathlen = env_lookup_valcopy(buff, 128, env_seg, "DOSDIR");
if (pathlen == 0) {
outputnl("%DOSDIR% not defined");
nls_outputnl(29,5); /* "%DOSDIR% not defined" */
return(CMD_FAIL);
}
 
231,16 → 231,16
 
static enum cmd_result cmd_ln(struct cmd_funcparam *p) {
if (cmd_ishlp(p)) {
outputnl("Adds, deletes or displays executable links.");
nls_outputnl(29,0); /* "Adds, deletes or displays executable links." */
outputnl("");
outputnl("LN ADD linkname targetdir");
outputnl("LN DEL linkname");
outputnl("LN LIST [pattern]");
nls_outputnl(29,1); /* "LN ADD linkname targetdir" */
nls_outputnl(29,2); /* "LN DEL linkname" */
nls_outputnl(29,3); /* "LN LIST [pattern]" */
return(CMD_OK);
}
 
if (p->argc == 0) {
outputnl("Not enough parameters");
nls_outputnl(0,7); /* "Required parameter missing */
return(CMD_OK);
}
 
252,6 → 252,6
if (p->argc == 2) return(cmd_lnlist(p->BUFFER, p->argv[1], p->env_seg));
}
 
outputnl("Invalid argument");
nls_outputnl(0,6); /* "Invalid parameter" */
return(CMD_FAIL);
}
/svarcom/trunk/cmd/mkdir.c
1,7 → 1,7
/* This file is part of the SvarCOM project and is published under the terms
* of the MIT license.
*
* Copyright (C) 2021 Mateusz Viste
* Copyright (C) 2021-2022 Mateusz Viste
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
31,25 → 31,25
unsigned short err = 0;
 
if (cmd_ishlp(p)) {
outputnl("Creates a directory");
nls_outputnl(28,0); /* "Creates a directory" */
outputnl("");
outputnl("MKDIR [drive:]path");
outputnl("MD [drive:]path");
nls_outputnl(28,1); /* "MKDIR [drive:]path" */
nls_outputnl(28,2); /* "MD [drive:]path" */
return(CMD_OK);
}
 
if (p->argc == 0) {
outputnl("Required parameter missing");
nls_outputnl(0,7); /* "Required parameter missing" */
return(CMD_FAIL);
}
 
if (p->argc > 1) {
outputnl("Too many parameters");
nls_outputnl(0,4); /* "Too many parameters" */
return(CMD_FAIL);
}
 
if (p->argv[0][0] == '/') {
outputnl("Invalid parameter");
nls_outputnl(0,6); /* "Invalid parameter" */
return(CMD_FAIL);
}
 
/svarcom/trunk/cmd/path.c
1,7 → 1,7
/* This file is part of the SvarCOM project and is published under the terms
* of the MIT license.
*
* Copyright (C) 2021 Mateusz Viste
* Copyright (C) 2021-2022 Mateusz Viste
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
33,15 → 33,14
 
/* help screen (/?) */
if (cmd_ishlp(p)) {
output("Displays or sets a search path for executable files.\r\n"
"\r\n"
"PATH [[drive:]path[;...]]\r\n"
"PATH ;\r\n"
"\r\n"
"Type PATH ; to clear all search-path settings and direct DOS to search\r\n"
"only in the current directory.\r\n"
"\r\n"
"Type PATH without parameters to display the current path.\r\n");
nls_outputnl(27,0); /* "Displays or sets a search path for executable files." */
outputnl("");
nls_outputnl(27,1); /* "PATH [[drive:]path[;...]]" */
outputnl("PATH ;");
outputnl("");
nls_outputnl(27,2); /* "Type PATH ; to clear all search-path settings and (...)" */
outputnl("");
nls_outputnl(27,3); /* "Type PATH without parameters to display the current path." */
return(CMD_OK);
}
 
49,7 → 48,7
if (p->argc == 0) {
char far *curpath = env_lookup(p->env_seg, "PATH");
if (curpath == NULL) {
outputnl("No Path");
nls_outputnl(27,4); /* "No Path" */
} else {
unsigned short i;
for (i = 0;; i++) {
63,7 → 62,7
 
/* more than 1 parameter */
if (p->argc > 1) {
outputnl("Too many parameters");
nls_outputnl(0,4); /* "Too many parameters" */
return(CMD_FAIL);
}
 
/svarcom/trunk/cmd/prompt.c
1,7 → 1,7
/* This file is part of the SvarCOM project and is published under the terms
* of the MIT license.
*
* Copyright (C) 2021 Mateusz Viste
* Copyright (C) 2021-2022 Mateusz Viste
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
32,9 → 32,9
static enum cmd_result cmd_prompt(struct cmd_funcparam *p) {
 
if (cmd_ishlp(p)) {
outputnl("Changes the DOS command prompt.");
nls_outputnl(33,0); /* "Changes the DOS command prompt." */
outputnl("");
outputnl("PROMPT [new command prompt specification]");
nls_outputnl(33,1); /* "PROMPT [new command prompt specification]" */
return(CMD_OK);
}
 
/svarcom/trunk/cmd/rem.c
1,7 → 1,7
/* This file is part of the SvarCOM project and is published under the terms
* of the MIT license.
*
* Copyright (C) 2021 Mateusz Viste
* Copyright (C) 2021-2022 Mateusz Viste
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
30,9 → 30,9
/* help screen ONLY if /? is the only argument - I do not want to output
* help for ex. for "REM mouse.com /?" */
if ((p->argc == 1) && (imatch(p->argv[0], "/?"))) {
outputnl("Records comments (remarks) in a batch file or CONFIG.SYS");
nls_outputnl(26,0); /* "Records comments (remarks) in a batch file or CONFIG.SYS" */
outputnl("");
outputnl("REM [comment]");
nls_outputnl(26,1); /* "REM [comment]" */
}
return(CMD_OK);
}
/svarcom/trunk/cmd/rename.c
1,7 → 1,7
/* This file is part of the SvarCOM project and is published under the terms
* of the MIT license.
*
* Copyright (C) 2021 Mateusz Viste
* Copyright (C) 2021-2022 Mateusz Viste
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
35,19 → 35,18
struct DTA *dta = (void *)0x80; /* use default DTA in PSP */
 
if (cmd_ishlp(p)) {
outputnl("Renames a file or files");
nls_outputnl(25,0); /* "Renames a file" */
outputnl("");
outputnl("RENAME [drive:][path]filename1 filename2");
outputnl("REN [drive:][path]filename1 filename2");
nls_outputnl(25,1); /* "RENAME [drive:][path]filename1 filename2" */
nls_outputnl(25,2); /* "REN [drive:][path]filename1 filename2" */
outputnl("");
outputnl("Note that you cannot specify a new drive or path for your destination file.");
outputnl("Use MOVE to rename a directory, or to move files from one directory to another.");
nls_outputnl(25,3); /* "Note that you cannot specify a new drive or (...)" */
return(CMD_OK);
}
 
/* I expect exactly two arguments */
if (p->argc != 2) {
outputnl("Invalid syntax");
nls_outputnl(0,1); /* "Invalid syntax" */
return(CMD_FAIL);
}
 
73,7 → 72,7
case ':':
case '\\':
case '/':
outputnl("Invalid destination");
nls_outputnl(25,4); /* "Invalid destination" */
return(CMD_FAIL);
}
buff1[fnameoffset + i] = p->argv[1][i];
/svarcom/trunk/cmd/rmdir.c
1,7 → 1,7
/* This file is part of the SvarCOM project and is published under the terms
* of the MIT license.
*
* Copyright (C) 2021 Mateusz Viste
* Copyright (C) 2021-2022 Mateusz Viste
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
31,25 → 31,25
unsigned short err = 0;
 
if (cmd_ishlp(p)) {
outputnl("Removes (deletes) a directory");
nls_outputnl(24,0); /* "Removes (deletes) a directory" */
outputnl("");
outputnl("RMDIR [drive:]path");
outputnl("RD [drive:]path");
nls_outputnl(24,1);/* "RMDIR [drive:]path" */
nls_outputnl(24,2);/* "RD [drive:]path" */
return(CMD_OK);
}
 
if (p->argc == 0) {
outputnl("Required parameter missing");
nls_outputnl(0,7); /* "Required parameter missing" */
return(CMD_FAIL);
}
 
if (p->argc > 1) {
outputnl("Too many parameters");
nls_outputnl(0,4); /* "Too many parameters" */
return(CMD_FAIL);
}
 
if (p->argv[0][0] == '/') {
outputnl("Invalid parameter");
nls_outputnl(0,6); /* "Invalid parameter"); */
return(CMD_FAIL);
}
 
/svarcom/trunk/cmd/set.c
1,7 → 1,7
/* This file is part of the SvarCOM project and is published under the terms
* of the MIT license.
*
* Copyright (C) 2021 Mateusz Viste
* Copyright (C) 2021-2022 Mateusz Viste
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
35,14 → 35,14
char *buff = p->BUFFER;
 
if (cmd_ishlp(p)) {
outputnl("Displays, sets, or removes DOS environment variables");
nls_outputnl(23,0); /* "Displays, sets, or removes DOS environment variables"); */
outputnl("");
outputnl("SET [variable=[string]]");
nls_outputnl(23,1); /* "SET [variable=[string]]" */
outputnl("");
outputnl("variable Specifies the environment-variable name");
outputnl("string Specifies a series of characters to assign to the variable");
nls_outputnl(23,2); /* "variable Specifies the environment-variable name" */
nls_outputnl(23,3); /* "string Specifies a series of characters to assign to the variable" */
outputnl("");
outputnl("Type SET without parameters to display the current environment variables.");
nls_outputnl(23,4); /* "Type SET without parameters to display the current environment variables." */
return(CMD_OK);
}
 
87,7 → 87,7
i = env_setvar(p->env_seg, buff);
if (i == ENV_INVSYNT) goto syntax_err;
if (i == ENV_NOTENOM) {
outputnl("Not enough available space within the environment block");
nls_outputnl(23,5); /* "Not enough available space within the environment block" */
return(CMD_FAIL);
}
}
95,6 → 95,6
 
syntax_err:
 
outputnl("Syntax error");
nls_outputnl(0,1); /* "Invalid syntax" */
return(CMD_FAIL);
}
/svarcom/trunk/cmd/time.c
1,7 → 1,7
/* This file is part of the SvarCOM project and is published under the terms
* of the MIT license.
*
* Copyright (C) 2021 Mateusz Viste
* Copyright (C) 2021-2022 Mateusz Viste
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
141,12 → 141,11
signed char ho = -1, mi = -1, se = -1;
 
if (cmd_ishlp(p)) {
outputnl("Displays or sets the system time.");
nls_outputnl(22,0); /* "Displays or sets the system time." */
outputnl("");
outputnl("TIME [time]");
nls_outputnl(22,1); /* "TIME [time]" */
outputnl("");
outputnl("Type TIME with no parameters to display the current time and a prompt for a");
outputnl("new one. Press ENTER to keep the same time.");
nls_outputnl(22,2); /* "Type TIME with no parameters to display the current time and (...)" */
return(CMD_OK);
}
 
178,12 → 177,12
}
buff[0] = ' ';
nls_format_time(buff + 1, ho, mi, se, nls);
output("Current time is");
nls_output(22,3); /* "Current time is" */
outputnl(buff);
ho = -1;
} else { /* parse time if provided */
if (cmd_time_parse(p->argv[0], &ho, &mi, &se, nls) != 0) {
outputnl("Invalid time");
nls_outputnl(22,4); /* "Invalid time" */
ho = -1;
}
}
190,7 → 189,7
 
/* ask for time if not provided or if input was malformed */
while (ho < 0) {
output("Enter new time:");
nls_output(22,5); /* "Enter new time:" */
output(" ");
/* collect user input into buff */
_asm {
224,7 → 223,7
}
if (buff[1] == 0) break; /* empty string = do not change time */
if (cmd_time_parse(buff + 2, &ho, &mi, &se, nls) == 0) break;
outputnl("Invalid time");
nls_outputnl(22,4); /* "Invalid time" */
return(CMD_FAIL);
}
 
/svarcom/trunk/cmd/type.c
1,7 → 1,7
/* This file is part of the SvarCOM project and is published under the terms
* of the MIT license.
*
* Copyright (C) 2021 Mateusz Viste
* Copyright (C) 2021-2022 Mateusz Viste
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
32,19 → 32,19
unsigned short err = 0;
 
if (cmd_ishlp(p)) {
outputnl("Displays the contents of a text file.");
nls_outputnl(21,0); /* "Displays the contents of a text file." */
outputnl("");
outputnl("TYPE [drive:][path]filename");
nls_outputnl(21,1); /* "TYPE [drive:][path]filename" */
return(CMD_OK);
}
 
if (p->argc == 0) {
outputnl("Required parameter missing");
nls_outputnl(0,7); /* "Required parameter missing" */
return(CMD_FAIL);
}
 
if (p->argc > 1) {
outputnl("Too many parameters");
nls_outputnl(0,4); /* "Too many parameters" */
return(CMD_FAIL);
}
 
/svarcom/trunk/cmd/ver.c
35,7 → 35,7
 
/* help screen */
if (cmd_ishlp(p)) {
outputnl("Displays the DOS version.");
nls_outputnl(20,0); /* "Displays the DOS version." */
outputnl("");
outputnl("ver [/about]");
#ifdef VERDBG
89,9 → 89,9
#endif
 
if ((p->argc == 1) && (imatch(p->argv[0], "/about"))) {
outputnl("SvarCOM is a shell interpreter for DOS kernels compatible with MS-DOS 5+.");
nls_outputnl(20,3); /* "SvarCOM is a shell interpreter for DOS kernels compatible with MS-DOS 5+." */
outputnl("");
outputnl("This software is distributed under the terms of the MIT license.");
nls_outputnl(20,4); /* "This software is distributed under the terms of the MIT license." */
outputnl("Copyright (C) " COPYRDATE " Mateusz Viste");
outputnl("");
outputnl("Program ten dedykuje Milenie i Mojmirowi. Zycze wam, byscie w swoim zyciu");
101,7 → 101,7
}
 
if (p->argc != 0) {
outputnl("Invalid parameter");
nls_outputnl(0,6); /* "Invalid parameter" */
return(CMD_FAIL);
}
 
118,9 → 118,10
pop ax
}
 
sprintf(buff, "DOS kernel version %u.%u", maj, min);
sprintf(buff, svarlang_str(20,1), maj, min); /* "DOS kernel version %u.%u" */
 
outputnl(buff);
outputnl("SvarCOM shell ver " PVER);
nls_output(20,2); /* "SvarCOM shell ver" */
outputnl(" " PVER);
return(CMD_OK);
}
/svarcom/trunk/cmd/verify.c
1,7 → 1,7
/* This file is part of the SvarCOM project and is published under the terms
* of the MIT license.
*
* Copyright (C) 2021 Mateusz Viste
* Copyright (C) 2021-2022 Mateusz Viste
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
29,14 → 29,16
static enum cmd_result cmd_verify(struct cmd_funcparam *p) {
 
if (cmd_ishlp(p)) {
outputnl("Tells DOS whether to verify that files are written correctly to disk.");
outputnl("\r\nVERIFY [ON | OFF]\r\n");
outputnl("Type VERIFY without a parameter to display its current setting.");
nls_outputnl(19,0); /* "Tells DOS whether to verify that files are written correctly to disk." */
outputnl("");
outputnl("VERIFY [ON | OFF]");
outputnl("");
nls_outputnl(19,1); /* "Type VERIFY without a parameter to display its current setting." */
return(CMD_OK);
}
 
if (p->argc > 1) {
outputnl("Too many parameters");
nls_outputnl(0,4); /* "Too many parameters" */
return(CMD_FAIL);
}
 
50,9 → 52,9
pop ax
}
if (verstate == 0) {
outputnl("VERIFY is off");
nls_outputnl(19,2); /* "VERIFY is off" */
} else {
outputnl("VERIFY is on");
nls_outputnl(19,3); /* "VERIFY is on" */
}
return(CMD_OK);
}
79,7 → 81,7
pop ax
}
} else {
outputnl("Must specify ON or OFF");
nls_outputnl(19,4); /* "Must specify ON or OFF" */
return(CMD_FAIL);
}