From f115e0da5ac76999ea7f17e11f93b9700ea7760e Mon Sep 17 00:00:00 2001 From: Albom Date: Sun, 13 Oct 2013 10:47:59 +0000 Subject: [PATCH] Shell 0.7.0. Command line editing implemented. + Some small fixes. git-svn-id: svn://kolibrios.org@4015 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/system/shell/History.txt | 9 + programs/system/shell/bin/rus/shell | Bin 19704 -> 0 bytes programs/system/shell/cmd/cmd_cd.c | 2 +- programs/system/shell/cmd/cmd_ls.c | 6 +- programs/system/shell/cmd/cmd_sleep.c | 2 +- programs/system/shell/cmd/cmd_touch.c | 1 - programs/system/shell/globals.h | 4 +- .../system/shell/modules/module_command.c | 167 +++++++++++++----- 8 files changed, 137 insertions(+), 54 deletions(-) delete mode 100644 programs/system/shell/bin/rus/shell diff --git a/programs/system/shell/History.txt b/programs/system/shell/History.txt index a46ba885be..7c87f1de80 100644 --- a/programs/system/shell/History.txt +++ b/programs/system/shell/History.txt @@ -1,3 +1,12 @@ +Shell 0.7.0 // 13.10.2013 // Albom +* Переработан модуль ввода команды (добавлена обработка клавиш "влево", "вправо", Del) +* Мелкие исправления + + +Shell 0.6.4 // 09.10.2013 // Leency +* Поддержка относительных путей в скриптах + + Shell 0.6.3 // 20.09.2013 // Albom * msvc-style атрибуты для отключения выравнивания в структурах (спасибо CleverMouse и Kirakishou!) diff --git a/programs/system/shell/bin/rus/shell b/programs/system/shell/bin/rus/shell deleted file mode 100644 index 22e81b29d54b15981104c62c96874bffc23f5328..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 19704 zcmeHOe|%Kcm46`#3^ACXL8*v7H4(9rV2es2+EjToZHd)}*sek?LJ+oru*n3mOF$T= z&15=CKW*&~ch?~#WrSqncI|c=Dkdz`cS!3vvdV> z9f#7F=Q_1)Dt4up<@taK)alN8)me8f(7*mDH+ZPrcOTU(w>ZnPJBZN%!R?W+OCGl* z^YCQ>a->97Up=l`$S$k1QQblPHDxUKF>pc>kdTBJ&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0VJh<9P_z{2LVIw|Jhwb>>DzIg95At_TjzYc(&tu_6FqWcm{ASL3!J4)}X`j^Vmts-hItK3Q9Y zSWvXGdVOtmRb^rIV}Gxp{OH>Cn2D*dp=RxR>uN6Y>`bu7E3LH*L1E>ZPZ`BWS68pM zKDwrI?c-}i+uBO&qbuubYO8DFp=k8z>Z%ow3lfB5zOBUUG`H~1!cQq#Q#gH63u?2b zz{KQ0R79bXlOne|tDtt4+D0kH3(YNUZW=LMyU%l`rGKEwi=o#)FxYNRrwi1ARX`Fx zNVu^usBSD+RT%qM%OARb4qUR3qM2K^f(t5A03p~$`BqR{u#)8}s8xy}Hs}`IwaO4S zHX~EC#{>+MtLhF+n(8CX&4sP4g}Zkz2Zv1sn+jt$;E?NYr`$??Cq<)uf1qC3a7R-T&c$sqt zJ#L>nml%Fe=1JV>FEk-dA|W-hseyh-dTA!CdsUS)aBTYLtW;HNk|zLFO%Hx-h0$y%#efoA_MLL zqEWC?WnrEUd3Nn}-vG#*@=|Td5;P_H0*t9)ueYrq$vT1`5;f00@6V9yddPu)U8E>` zah=AMJ{MyY*L++@@Lp82s_6D2kYUH)<8B`ex3m?il^WTfPGDZLZ diff --git a/programs/system/shell/cmd/cmd_cd.c b/programs/system/shell/cmd/cmd_cd.c index 48039cac25..2d6f5a05da 100644 --- a/programs/system/shell/cmd/cmd_cd.c +++ b/programs/system/shell/cmd/cmd_cd.c @@ -10,7 +10,7 @@ if (NULL == dir) #if LANG_ENG printf(" cd \n\r"); #elif LANG_RUS - printf(" cd <фшЁхъЄюЁш >\n\r"); + printf(" cd <директория>\n\r"); #endif return TRUE; } diff --git a/programs/system/shell/cmd/cmd_ls.c b/programs/system/shell/cmd/cmd_ls.c index f412a13762..599a0dbff5 100644 --- a/programs/system/shell/cmd/cmd_ls.c +++ b/programs/system/shell/cmd/cmd_ls.c @@ -18,21 +18,21 @@ k70.p16 = (unsigned) malloc(32+k70.p12*560); k70.p20 = 0; /// !!! -// ┼ёыш ls чряєёърхЄё  схч ярЁрьхЄЁют, яЁюёьрЄЁштрхь Єхъє∙шщ ърЄрыюу +// Если ls запускается без параметров, просматриваем текущий каталог if ( !strlen(dir) ) k70.p21 = cur_dir; else k70.p21 = dir; result = kol_file_70(&k70); -if ( !((result==0) || (result==6)) ) // яЁютхЁ хь ёє∙хёЄтютрэшх ърЄрыюур +if ( !((result==0) || (result==6)) ) // проверяем существование каталога { free( (void*) k70.p16); return FALSE; } n = (unsigned*) (k70.p16+8); -num_of_file = *n; // ўшёыю Їрщыют т ърЄрыюух +num_of_file = *n; // число файлов в каталоге for (i = 0; i < num_of_file; i++) { diff --git a/programs/system/shell/cmd/cmd_sleep.c b/programs/system/shell/cmd/cmd_sleep.c index c3f2918d78..75f2d48480 100644 --- a/programs/system/shell/cmd/cmd_sleep.c +++ b/programs/system/shell/cmd/cmd_sleep.c @@ -8,7 +8,7 @@ if (!strlen(param)) #if LANG_ENG printf(" sleep