Author: hbelusca
Date: Thu Jul 4 01:05:14 2013
New Revision: 59422
URL:
http://svn.reactos.org/svn/reactos?rev=59422&view=rev
Log:
[CMD]
Features-only commit:
- Fix version presentation at startup and when using the "ver" command (in
French)
- Add to the prompt's command help, the fact that the $S specifier can be used to add
a space.
- Implement the $I prompt specifier (see
http://www.robvanderwoude.com/prompt.php), which
sets
an information line on top of the screen (à la OS/2).
Use this new setting by default (I'm doing a poll on who loves it / hates it, and
how we can improve it).
To disable it, use the command: "prompt $p$g" (the default windows'
prompt).
To enable it, add the $s specifier to the prompt string (e.g. "prompt
$i$p$g").
For your information, OS/2 uses "prompt $i[$p]" :)
Modified:
trunk/reactos/base/shell/cmd/cmd.c
trunk/reactos/base/shell/cmd/cmd.h
trunk/reactos/base/shell/cmd/lang/de-DE.rc
trunk/reactos/base/shell/cmd/lang/el-GR.rc
trunk/reactos/base/shell/cmd/lang/en-US.rc
trunk/reactos/base/shell/cmd/lang/es-ES.rc
trunk/reactos/base/shell/cmd/lang/fr-FR.rc
trunk/reactos/base/shell/cmd/lang/hu-HU.rc
trunk/reactos/base/shell/cmd/lang/id-ID.rc
trunk/reactos/base/shell/cmd/lang/it-IT.rc
trunk/reactos/base/shell/cmd/lang/ja-JP.rc
trunk/reactos/base/shell/cmd/lang/no-NO.rc
trunk/reactos/base/shell/cmd/lang/pl-PL.rc
trunk/reactos/base/shell/cmd/lang/ro-RO.rc
trunk/reactos/base/shell/cmd/lang/ru-RU.rc
trunk/reactos/base/shell/cmd/lang/sk-SK.rc
trunk/reactos/base/shell/cmd/lang/sv-SE.rc
trunk/reactos/base/shell/cmd/lang/uk-UA.rc
trunk/reactos/base/shell/cmd/lang/zh-CN.rc
trunk/reactos/base/shell/cmd/prompt.c
trunk/reactos/base/shell/cmd/ver.c
Modified: trunk/reactos/base/shell/cmd/cmd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.c?rev=5…
==============================================================================
--- trunk/reactos/base/shell/cmd/cmd.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmd.c [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -1615,7 +1615,6 @@
HMODULE NtDllModule;
TCHAR commandline[CMDLINE_LENGTH];
TCHAR ModuleName[_MAX_PATH + 1];
- TCHAR lpBuffer[2];
INT nExitCode;
//INT len;
@@ -1643,16 +1642,12 @@
hOut = GetStdHandle(STD_OUTPUT_HANDLE);
hIn = GetStdHandle(STD_INPUT_HANDLE);
- /* Set EnvironmentVariable PROMPT if it does not exists any env value.
- for you can change the EnvirommentVariable for prompt before cmd start
- this patch are not 100% right, if it does not exists a PROMPT value cmd should
use
- $P$G as defualt not set EnvirommentVariable PROMPT to $P$G if it does not exists
*/
- if (GetEnvironmentVariable(_T("PROMPT"),lpBuffer, sizeof(lpBuffer) /
sizeof(lpBuffer[0])) == 0)
- SetEnvironmentVariable(_T("PROMPT"), _T("$P$G"));
+ /* Initialize prompt support */
+ InitPrompt();
#ifdef FEATURE_DIR_STACK
/* initialize directory stack */
- InitDirectoryStack ();
+ InitDirectoryStack();
#endif
#ifdef FEATURE_HISTORY
@@ -1750,6 +1745,7 @@
if (!*ptr)
{
/* If neither /C or /K was given, display a simple version string */
+ ConOutChar(_T('\n'));
ConOutResPrintf(STRING_REACTOS_VERSION,
_T(KERNEL_RELEASE_STR),
_T(KERNEL_VERSION_BUILD_STR));
Modified: trunk/reactos/base/shell/cmd/cmd.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.h?rev=5…
==============================================================================
--- trunk/reactos/base/shell/cmd/cmd.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmd.h [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -405,6 +405,7 @@
/* Prototypes from PROMPT.C */
+VOID InitPrompt (VOID);
VOID PrintPrompt (VOID);
INT cmd_prompt (LPTSTR);
Modified: trunk/reactos/base/shell/cmd/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/de-DE.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/de-DE.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/de-DE.rc [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -361,10 +361,12 @@
$F ) (Klammer zu)\n\
$G > (GröÃer-als-Zeichen)\n\
$H Rückschritt (löscht vorangehendes Zeichen)\n\
+ $I Information line\n\
$L < (Kleiner-als-Zeichen)\n\
$N Aktuelles Laufwerk\n\
$P Aktuelles Laufwerk und Pfad\n\
$Q = (Gleichheitszeichen)\n\
+ $S (space)\n\
$T Aktuelle Zeit\n\
$V Betriebssystem-Versionsnummer\n\
$_ Wagenrücklauf und Zeilenvorschub\n\
Modified: trunk/reactos/base/shell/cmd/lang/el-GR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/el-GR.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/el-GR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/el-GR.rc [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -364,10 +364,12 @@
$F ) (Right parenthesis)\n\
$G > (greater-than sign)\n\
$H Backspace (erases previous character)\n\
+ $I Information line\n\
$L < (less-than sign)\n\
$N Current drive\n\
$P Current drive and path\n\
$Q = (equal sign)\n\
+ $S (space)\n\
$T Current time\n\
$V OS version number\n\
$_ Carriage return and linefeed\n\
Modified: trunk/reactos/base/shell/cmd/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/en-US.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/en-US.rc [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -364,10 +364,12 @@
$F ) (Right parenthesis)\n\
$G > (greater-than sign)\n\
$H Backspace (erases previous character)\n\
+ $I Information line\n\
$L < (less-than sign)\n\
$N Current drive\n\
$P Current drive and path\n\
$Q = (equal sign)\n\
+ $S (space)\n\
$T Current time\n\
$V OS version number\n\
$_ Carriage return and linefeed\n\
Modified: trunk/reactos/base/shell/cmd/lang/es-ES.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/es-ES.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/es-ES.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/es-ES.rc [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -364,10 +364,12 @@
$F ) (Paréntesis derecho)\n\
$G > (Signo mayor que)\n\
$H Borra el caracter anterior\n\
+ $I Information line\n\
$L < (Signo menor que)\n\
$N Unidad actual\n\
$P Unidad y ruta actuales\n\
$Q = (signo igual)\n\
+ $S (space)\n\
$T Hora actual\n\
$V Número de versión del SO\n\
$_ Salto de linea\n\
Modified: trunk/reactos/base/shell/cmd/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/fr-FR.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/fr-FR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/fr-FR.rc [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -378,10 +378,12 @@
$F ) (parenthèse fermante)\n\
$G > (signe supérieur à )\n\
$H Backspace (efface le caractère précédent)\n\
+ $I Ligne d'information\n\
$L < (signe inférieur à )\n\
$N Lecteur courant\n\
$P Lecteur et chemin courants\n\
$Q = (signe égale)\n\
+ $S (espace)\n\
$T Heure courante\n\
$V Numéro de version de ReactOS\n\
$_ Retour chariot/saut de ligne\n\
@@ -718,7 +720,7 @@
STRING_REPLACE_ERROR7, "Erreur étendue 32\n"
STRING_REACTOS_VERSION, "ReactOS Operating System [Version
%s-%s]\n"
-STRING_CMD_SHELLINFO, "\n Interpréteur de ligne de commandes
ReactOS\nVersion %s %s"
+STRING_CMD_SHELLINFO, "\nInterpréteur de ligne de commandes
ReactOS\nVersion %s %s"
STRING_VERSION_RUNVER, " tournant sur %s"
STRING_COPY_FILE, " %d fichier(s) copié(s)\n"
STRING_DELETE_WIPE, "effacé(s)"
Modified: trunk/reactos/base/shell/cmd/lang/hu-HU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/hu-HU.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/hu-HU.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/hu-HU.rc [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -350,10 +350,12 @@
$F ) (záró zárójel)\n\
$G > ('nagyobb' jel)\n\
$H Törlés (elötte lévõ karaktert törli)\n\
+ $I Information line\n\
$L < ('kissebb' jel)\n\
$N Aktuális meghajtó\n\
$P Aktuális meghajtó és mappa\n\
$Q = (egyenlõség jel)\n\
+ $S (space)\n\
$T Aktuális idõ\n\
$V OS verziószám\n\
$_ Ãjsor\n\
Modified: trunk/reactos/base/shell/cmd/lang/id-ID.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/id-ID.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/id-ID.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/id-ID.rc [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -364,10 +364,12 @@
$F ) (Tanda kurung Kanan)\n\
$G > (Tanda lebih-dari)\n\
$H Backspace (menghapus karakter sebelumnya)\n\
+ $I Information line\n\
$L < (tanda kurang-dari)\n\
$N Drive saat ini\n\
$P Drive dan path saat ini\n\
$Q = (tanda sama dengan)\n\
+ $S (space)\n\
$T Jam saat ini\n\
$V Nomor versi OS\n\
$_ Carriage return dan linefeed\n\
Modified: trunk/reactos/base/shell/cmd/lang/it-IT.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/it-IT.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/it-IT.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/it-IT.rc [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -368,10 +368,12 @@
$F ) (parentesi destra)\n\
$G > (simbolo di maggiore di)\n\
$H Backspace (cancella il carattere precedente)\n\
+ $I Information line\n\
$L < (simbolo di minore di)\n\
$N Disco corrente\n\
$P Disco e percorso corrente\n\
$Q = (simbolo di uguale)\n\
+ $S (space)\n\
$T Ora attuale\n\
$V Versione del sistema operativo\n\
$_ CR LF (a capo)\n\
Modified: trunk/reactos/base/shell/cmd/lang/ja-JP.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/ja-JP.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/ja-JP.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/ja-JP.rc [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -373,10 +373,12 @@
$F ) (å³ãã£ã)\n\
$G > (ä¸çå· (大ãªã))\n\
$H ããã¯ã¹ãã¼ã¹ (ç´åã®æåãåé¤ãã¾ã)\n\
+ $I Information line\n\
$L < (ä¸çå· (å°ãªã))\n\
$N ç¾å¨ã®ãã©ã¤ã\n\
$P ç¾å¨ã®ãã©ã¤ãã¨ãã¹\n\
$Q = (çå·)\n\
+ $S (space)\n\
$T ç¾å¨ã®æå»\n\
$V OS ã®ãã¼ã¸ã§ã³çªå·\n\
$_ ãã£ãªã㸠ãªã¿ã¼ã³ã¨ã©ã¤ã³ãã£ã¼ã\n\
Modified: trunk/reactos/base/shell/cmd/lang/no-NO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/no-NO.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/no-NO.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/no-NO.rc [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -359,10 +359,12 @@
$F ) (Høyreparentes)\n\
$G > (større-enn symbol)\n\
$H Tilbake (sletter forrige tegn)\n\
+ $I Information line\n\
$L < (mindre-enn symbol)\n\
$N Gjeldende stasjon\n\
$P Gjeldende stasjon og mappe\n\
$Q = (likhetstegn)\n\
+ $S (space)\n\
$T Gjeldende klokkeslett\n\
$V Versjonsnummer for ReactOS\n\
$_ Retur og linjeskift\n\
Modified: trunk/reactos/base/shell/cmd/lang/pl-PL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/pl-PL.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/pl-PL.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/pl-PL.rc [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -366,10 +366,12 @@
$F ) (prawy nawias)\n\
$G > (znak wiÄkszoÅci)\n\
$H (usuwa ostatni znak)\n\
+ $I Information line\n\
$L < (znak mniejszoÅci)\n\
$N BieżÄ
cy napÄd\n\
$P BieżÄ
cy napÄd i Åcieżka\n\
$Q = (znak równoÅci)\n\
+ $S (space)\n\
$T BieżÄ
cy czas\n\
$V Wersja systemu\n\
$_ Znak CR/LF\n\
Modified: trunk/reactos/base/shell/cmd/lang/ro-RO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/ro-RO.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/ro-RO.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/ro-RO.rc [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -401,10 +401,12 @@
$F ) (parantezÄ dreapta)\n\
$G > (semnul mai mare decât)\n\
$H Backspace (Ètergerea caracterului precedent)\n\
+ $I Information line\n\
$L < (semnul mai mic decât)\n\
$N Unitatea de stocare curentÄ\n\
$P Unitatea de stocare Èi calea curentÄ\n\
$Q = (semnul egal)\n\
+ $S (space)\n\
$T Ora curentÄ\n\
$V NumÄrul versiunii SO\n\
$_ SfârÈit de linie Èi rând nou\n\
Modified: trunk/reactos/base/shell/cmd/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/ru-RU.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/ru-RU.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/ru-RU.rc [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -369,10 +369,12 @@
$F ) (пÑÐ°Ð²Ð°Ñ ÐºÑÑÐ³Ð»Ð°Ñ Ñкобка)\n\
$G > (знак ""болÑÑе"")\n\
$H BACKSPACE (Ñдаление пÑедÑдÑÑего Ñимвола)\n\
+ $I Information line\n\
$L < (знак ""менÑÑе"")\n\
$N ТекÑÑий диÑк\n\
$P ТекÑÑие диÑк и каÑалог\n\
$Q = (знак ÑавенÑÑва)\n\
+ $S (space)\n\
$T ТекÑÑее вÑемÑ\n\
$V ÐÐ¾Ð¼ÐµÑ Ð²ÐµÑÑии опеÑаÑионной ÑиÑÑемÑ\n\
$_ ÐеÑевод ÑÑÑоки\n\
Modified: trunk/reactos/base/shell/cmd/lang/sk-SK.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/sk-SK.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/sk-SK.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/sk-SK.rc [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -368,10 +368,12 @@
$F ) (Pravá okrúhla zátvorka)\n\
$G > (greater-than sign)\n\
$H Backspace (erases previous character)\n\
+ $I Information line\n\
$L < (less-than sign)\n\
$N Current drive\n\
$P Current drive and path\n\
$Q = (equal sign)\n\
+ $S (space)\n\
$T Aktuálny Äas\n\
$V ÄÃslo verzie OS\n\
$_ Carriage return and linefeed\n\
Modified: trunk/reactos/base/shell/cmd/lang/sv-SE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/sv-SE.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/sv-SE.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/sv-SE.rc [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -359,10 +359,12 @@
$F ) (Høyreparentes)\n\
$G > (større-enn symbol)\n\
$H Tilbake (sletter forrige tegn)\n\
+ $I Information line\n\
$L < (mindre-enn symbol)\n\
$N aktuell enhet\n\
$P aktuell enhet och mapp\n\
$Q = (likhetstegn)\n\
+ $S (space)\n\
$T aktuell klokkeslett\n\
$V Versjonsnummer for ReactOS\n\
$_ Retur och linjeskift\n\
Modified: trunk/reactos/base/shell/cmd/lang/uk-UA.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/uk-UA.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/uk-UA.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/uk-UA.rc [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -371,10 +371,12 @@
$F ) (ÐÑава кÑÑгла дÑжка)\n\
$G > (знак бÑлÑÑе)\n\
$H Backspace (Ð²Ð¸Ð´Ð°Ð»ÐµÐ½Ð½Ñ Ð¿Ð¾Ð¿ÐµÑедÑного ÑимволÑ)\n\
+ $I Information line\n\
$L < (знак менÑÑе)\n\
$N ÐоÑоÑний диÑк\n\
$P ÐоÑоÑний диÑк Ñа каÑалог\n\
$Q = (знак ÑiвноÑÑi)\n\
+ $S (space)\n\
$T ÐоÑоÑний ÑаÑ\n\
$V ÐÐ¾Ð¼ÐµÑ Ð²ÐµÑÑiÑ Ð¾Ð¿ÐµÑаÑiÐ¹Ð½Ð¾Ñ ÑиÑÑеми\n\
$_ ÐовеÑÐ½ÐµÐ½Ð½Ñ ÐºÐ°ÑеÑки Ñа пеÑÐµÐ²ÐµÐ´ÐµÐ½Ð½Ñ ÑÑдка\n\
Modified: trunk/reactos/base/shell/cmd/lang/zh-CN.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/zh-CN.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/zh-CN.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/zh-CN.rc [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -346,10 +346,12 @@
$F ) (å³æ¬å·)\n\
$G > (大äºå·)\n\
$H éæ ¼ (æ¦é¤åä¸ä¸ªå符)\n\
+ $I Information line\n\
$L < (å°äºå·)\n\
$N å½å驱å¨å¨\n\
$P å½å驱å¨å¨åè·¯å¾\n\
$Q = (çäºå·)\n\
+ $S (space)\n\
$T å½åæ¶é´\n\
$V æä½ç³»ç»çæ¬å·\n\
$_ å车åæ¢è¡ç¬¦\n\
Modified: trunk/reactos/base/shell/cmd/prompt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/prompt.c?re…
==============================================================================
--- trunk/reactos/base/shell/cmd/prompt.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/prompt.c [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -48,19 +48,72 @@
*/
#include "precomp.h"
-/*
- * print the command-line prompt
+// FIXME: Localize the information line.
+static TCHAR InfoLine[] = _T(" ReactOS Command Prompt
Type HELP = Help ");
+
+/* The default prompt */
+static TCHAR DefaultPrompt[] = _T("$I$P$G");
+
+
+/*
+ * Initialize prompt support
+ */
+VOID InitPrompt(VOID)
+{
+ TCHAR Buffer[2];
+
+ /*
+ * Set the PROMPT environment variable if it doesn't exist already.
+ * You can change the PROMPT environment variable before cmd start.
+ */
+ if (GetEnvironmentVariable(_T("PROMPT"), Buffer, sizeof(Buffer) /
sizeof(Buffer[0])) == 0)
+ SetEnvironmentVariable(_T("PROMPT"), DefaultPrompt);
+}
+
+/*
+ * Print an information line on top of the screen
+ */
+VOID PrintInfoLine(VOID)
+{
+#define FOREGROUND_WHITE (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED |
FOREGROUND_INTENSITY)
+
+ HANDLE hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
+ CONSOLE_SCREEN_BUFFER_INFO csbi;
+ COORD coPos;
+ DWORD dwWritten;
+
+ if (!GetConsoleScreenBufferInfo(hOutput, &csbi))
+ {
+ /* No console */
+ return;
+ }
+
+ coPos.X = 0;
+ coPos.Y = 0;
+ FillConsoleOutputAttribute(hOutput, BACKGROUND_BLUE | FOREGROUND_WHITE,
+ csbi.dwSize.X,
+ coPos, &dwWritten);
+ FillConsoleOutputCharacter(hOutput, _T(' '),
+ csbi.dwSize.X,
+ coPos, &dwWritten);
+
+ WriteConsoleOutputCharacter(hOutput, InfoLine,
+ sizeof(InfoLine)/sizeof(TCHAR) - 1,
+ coPos, &dwWritten);
+}
+
+/*
+ * Print the command-line prompt
*/
VOID PrintPrompt(VOID)
{
- static TCHAR default_pr[] = _T("$P$G");
TCHAR szPrompt[256];
LPTSTR pr;
if (GetEnvironmentVariable(_T("PROMPT"), szPrompt, 256))
pr = szPrompt;
else
- pr = default_pr;
+ pr = DefaultPrompt;
while (*pr)
{
@@ -108,6 +161,10 @@
ConOutChar(_T('\x08'));
break;
+ case _T('I'):
+ PrintInfoLine();
+ break;
+
case _T('L'):
ConOutChar(_T('<'));
break;
@@ -185,42 +242,35 @@
#ifdef INCLUDE_CMD_PROMPT
-INT cmd_prompt (LPTSTR param)
-{
- if (!_tcsncmp (param, _T("/?"), 2))
- {
- ConOutResPaging(TRUE,STRING_PROMPT_HELP1);
+INT cmd_prompt(LPTSTR param)
+{
+ if (!_tcsncmp(param, _T("/?"), 2))
+ {
+ ConOutResPaging(TRUE, STRING_PROMPT_HELP1);
#ifdef FEATURE_DIRECTORY_STACK
- ConOutResPaging(FALSE,STRING_PROMPT_HELP2);
+ ConOutResPaging(FALSE, STRING_PROMPT_HELP2);
#endif
- ConOutResPaging(FALSE,STRING_PROMPT_HELP3);
+ ConOutResPaging(FALSE, STRING_PROMPT_HELP3);
return 0;
}
/*
- * if it is null, then it needs to set to default,
+ * If 'param' is NULL, then we need to set it to default,
* because that means the user entered "prompt" only.
- * so even if param is null you _must_ still set prompt
- * to the default. There seems to be some kinda difference
+ * So even if 'param' is null you _must_ still set prompt
+ * to the default. There seems to be some kind of difference
* between winxp and 2k in this matter and this way will
* cover both. Do not use fixed size of szParam for param the buffer
- * are 8192 bytes and will later change to dymatic buffer.
+ * are 8192 bytes and will later change to dynamic buffer.
*/
- /* set PROMPT environment variable */
- if (param[0] != _T('\0'))
- {
- if (!SetEnvironmentVariable (_T("PROMPT"), param))
+ /* Set the PROMPT environment variable */
+ if (!SetEnvironmentVariable(_T("PROMPT"),
+ (param[0] != _T('\0') ? param : DefaultPrompt)))
+ {
return 1;
}
- else
- {
- TCHAR szParam[5];
- _tcscpy(szParam,_T("$P$G"));
- if (!SetEnvironmentVariable (_T("PROMPT"),szParam))
- return 1;
- }
return 0;
}
Modified: trunk/reactos/base/shell/cmd/ver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/ver.c?rev=5…
==============================================================================
--- trunk/reactos/base/shell/cmd/ver.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/ver.c [iso-8859-1] Thu Jul 4 01:05:14 2013
@@ -72,8 +72,8 @@
/* Basic copyright notice */
if (param[0] != _T('\0'))
{
- ConOutPuts (_T("Copyright (C) 1994-1998 Tim Norman and others."));
- ConOutPuts (_T("Copyright (C) 1998-") _T(COPYRIGHT_YEAR) _T("
ReactOS Team"));
+ ConOutPuts(_T("Copyright (C) 1994-1998 Tim Norman and others.\n"));
+ ConOutPuts(_T("Copyright (C) 1998-") _T(COPYRIGHT_YEAR) _T("
ReactOS Team\n"));
for (i = 0; param[i]; i++)
{