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-2022 Mateusz Viste |
* Copyright (C) 2021 Mateusz Viste |
* |
* Permission is hereby granted, free of charge, to any person obtaining a |
* copy of this software and associated documentation files (the "Software"), |
168,19 → 168,20 |
struct DTA *dta = (void *)0x80; /* use DTA at default location in PSP */ |
|
if (cmd_ishlp(p)) { |
nls_outputnl(38,0); /* "Copies one or more files to another location." */ |
outputnl("Copies one or more files to another location."); |
outputnl(""); |
nls_outputnl(38,1); /* "COPY [/A|/B] source [/A|/B] [+source [/A|/B] [+...]] [destination [/A|/B]] [/V]" */ |
outputnl("COPY [/A|/B] source [/A|/B] [+source [/A|/B] [+...]] [destination [/A|/B]] [/V]"); |
outputnl(""); |
nls_outputnl(38,2); /* "source Specifies the file or files to be copied" */ |
nls_outputnl(38,3); /* "/A Indicates an ASCII text file" */ |
nls_outputnl(38,4); /* "/B Indicates a binary file" */ |
nls_outputnl(38,5); /* "destination Specifies the directory and/or filename for the new file(s)" */ |
nls_outputnl(38,6); /* "/V Verifies that new files are written correctly" */ |
outputnl("source Specifies the file or files to be copied"); |
outputnl("/A Indicates an ASCII text file"); |
outputnl("/B Indicates a binary file"); |
outputnl("destination Specifies the directory and/or filename for the new file(s)"); |
outputnl("/V Verifies that new files are written correctly"); |
outputnl(""); |
nls_outputnl(38,7); /* "To append files, specify a single file for destination, but multiple (...)" */ |
outputnl("To append files, specify a single file for destination, but multiple files"); |
outputnl("for source (using wildcards or file1+file2+file3 format)."); |
outputnl(""); |
nls_outputnl(38,8); /* "NOTE: /A and /B are no-ops, provided only for compatibility reasons" */ |
outputnl("NOTE: /A and /B are no-ops (ignored), provided only for compatibility reasons."); |
return(CMD_OK); |
} |
|
205,7 → 206,7 |
} else if (imatch(p->argv[i], "/v")) { |
setup->verifyflag = 1; |
} else { |
nls_outputnl(0,2); /* "Invalid switch" */ |
outputnl("Invalid switch"); |
return(CMD_FAIL); |
} |
continue; |
215,7 → 216,7 |
if (p->argv[i][0] == '+') { |
/* a plus cannot appear after destination or before first source */ |
if ((setup->dst[0] != 0) || (setup->src_count == 0)) { |
nls_outputnl(0,1); /* "Invalid syntax" */ |
outputnl("Invalid syntax"); |
return(CMD_FAIL); |
} |
setup->lastitemwasplus = 1; |
239,11 → 240,11 |
|
/* must be a dst then */ |
if (setup->dst[0] != 0) { |
nls_outputnl(0,1); /* "Invalid syntax" */ |
outputnl("Invalid syntax"); |
return(CMD_FAIL); |
} |
if (file_truename(p->argv[i], setup->dst) != 0) { |
nls_outputnl(0,8); /* "Invalid destination" */ |
outputnl("Invalid destination"); |
return(CMD_FAIL); |
} |
setup->dst_asciimode = setup->last_asciimode; |
265,7 → 266,7 |
|
/* must have at least one source */ |
if (setup->src_count == 0) { |
nls_outputnl(0,7); /* "Required parameter missing" */ |
outputnl("Required parameter missing"); |
return(CMD_FAIL); |
} |
|
355,7 → 356,7 |
|
} |
|
sprintf(setup->databuf, svarlang_str(38,9)/*"%u file(s) copied"*/, copiedcount_out); |
sprintf(setup->databuf, "%u file(s) copied", copiedcount_out); |
outputnl(setup->databuf); |
|
return(CMD_OK); |