[Lost] [PATCH] shell: +clear
Antoine Kaufmann ·
On Tue, Dec 30 18:28, Alexander Siol wrote:
> clear als Builtin-Kommando in shell. Nichts weltbewegendes ;)
> diff --git a/trunk/src/modules/c/shell/commmands.c b/trunk/src/modules/c/shell/commmands.c
> index f1438eb..1ce37a6 100644
> --- a/trunk/src/modules/c/shell/commmands.c
> +++ b/trunk/src/modules/c/shell/commmands.c
> @@ -243,3 +243,10 @@ int shell_command_source(int argc, char* argv[], const char* args)
> }
> }
>
> +int shell_command_clear(int argc, char* argv[], const char* args)
> +{
> + printf("\033[1;1H\033[2J");
Die beiden 1en wären vermutlich nicht notwendig, aber das ist ja
eigentlich auch egal. ;-)
> +
> + return 0;
> +}
> +
> diff --git a/trunk/src/modules/c/shell/shell.c b/trunk/src/modules/c/shell/shell.c
> index 25ec1ba..9470fe5 100644
> --- a/trunk/src/modules/c/shell/shell.c
> +++ b/trunk/src/modules/c/shell/shell.c
> @@ -75,6 +75,7 @@ shell_command_t shell_commands[] = {
> {"cd", &shell_command_cd},
> {"set", &shell_command_set},
> {"source", &shell_command_source},
> + {"clear", &shell_command_clear},
> #ifdef CONFIG_SHELL_BUILTIN_ONLY
> {"bincat", &shell_command_bincat},
> {"cat", &shell_command_cat},
> diff --git a/trunk/src/modules/c/shell/shell.h b/trunk/src/modules/c/shell/shell.h
> index 5564ee8..53a757d 100644
> --- a/trunk/src/modules/c/shell/shell.h
> +++ b/trunk/src/modules/c/shell/shell.h
> @@ -57,6 +57,7 @@ int shell_command_start(int argc, char* argv[], const char* args);
> int shell_command_cd(int argc, char* argv[], const char* args);
> int shell_command_set(int argc, char* argv[], const char* args);
> int shell_command_source(int argc, char* argv[], const char* args);
> +int shell_command_clear(int argc, char* argv[], const char* args);
>
>
> #include <lost/config.h>
Von daher: Immer schön rein damit.
--
Antoine Kaufmann
<toni at famkaufmann.info>
-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname : nicht verfügbar
Dateityp : application/pgp-signature
Dateigröße : 197 bytes
Beschreibung: nicht verfügbar
URL : <http://list.tyndur.org/pipermail/tyndur-devel/attachments/20081231/439887b3/attachment.pgp>