From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Lrd4b-0000h1-SQ for mharc-grub-devel@gnu.org; Wed, 08 Apr 2009 15:04:33 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lrd4a-0000fS-0K for grub-devel@gnu.org; Wed, 08 Apr 2009 15:04:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lrd4V-0000cD-4M for grub-devel@gnu.org; Wed, 08 Apr 2009 15:04:31 -0400 Received: from [199.232.76.173] (port=53299 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lrd4U-0000by-V5 for grub-devel@gnu.org; Wed, 08 Apr 2009 15:04:26 -0400 Received: from e24smtp03.br.ibm.com ([32.104.18.24]:58074) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lrd4U-0000TK-2C for grub-devel@gnu.org; Wed, 08 Apr 2009 15:04:26 -0400 Received: from mailhub1.br.ibm.com (mailhub1.br.ibm.com [9.18.232.109]) by e24smtp03.br.ibm.com (8.13.1/8.13.1) with ESMTP id n38IxgE3011446 for ; Wed, 8 Apr 2009 15:59:42 -0300 Received: from d24av02.br.ibm.com (d24av02.br.ibm.com [9.18.232.47]) by mailhub1.br.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n38J4ep4856390 for ; Wed, 8 Apr 2009 16:04:40 -0300 Received: from d24av02.br.ibm.com (loopback [127.0.0.1]) by d24av02.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n38J4Kgq002126 for ; Wed, 8 Apr 2009 16:04:20 -0300 Received: from [9.8.15.136] ([9.8.15.136]) by d24av02.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n38J4KxW002089; Wed, 8 Apr 2009 16:04:20 -0300 Message-ID: <49DCF533.6050809@linux.vnet.ibm.com> Date: Wed, 08 Apr 2009 16:04:19 -0300 From: Carlos Roberto do Nascimento Costa User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: grub-devel@gnu.org Content-Type: multipart/mixed; boundary="------------010108070408000609070804" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: Manoel Rebelo Abranches Subject: [PATCH] add clear screen command X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 19:04:32 -0000 This is a multi-part message in MIME format. --------------010108070408000609070804 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, This simple patch will add a new command to clear the terminal screen. Very useful on the command-line. Best Regards, -- Carlos Roberto do Nascimento Costa e-mail: crncosta@linux.vnet.ibm.com IBM - Linux Technology Center Brasil --------------010108070408000609070804 Content-Type: text/x-patch; name="clear.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="clear.patch" Index: conf/common.rmk =================================================================== --- conf/common.rmk (revision 2070) +++ conf/common.rmk (working copy) @@ -332,7 +332,7 @@ # Commands. pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ - ls.mod cmp.mod cat.mod help.mod search.mod \ + ls.mod cmp.mod cat.mod help.mod search.mod clear.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ read.mod sleep.mod loadenv.mod crc.mod parttool.mod pcpart.mod @@ -382,6 +382,11 @@ cat_mod_CFLAGS = $(COMMON_CFLAGS) cat_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For clear.mod +clear_mod_SOURCES = commands/clear.c +clear_mod_CFLAGS = $(COMMON_CFLAGS) +clear_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For echo.mod echo_mod_SOURCES = commands/echo.c echo_mod_CFLAGS = $(COMMON_CFLAGS) Index: commands/clear.c =================================================================== --- commands/clear.c (revision 0) +++ commands/clear.c (revision 0) @@ -0,0 +1,50 @@ +/* clear.c - command to clear the terminal screen. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2003,2007 Free Software Foundation, Inc. + * Copyright (C) 2003 NIIBE Yutaka + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + + +static grub_err_t +grub_cmd_clear (struct grub_extcmd *cmd __attribute__ ((unused)), + int argc __attribute__ ((unused)), + char **args __attribute__ ((unused))) +{ + grub_cls (); + return 0; +} + +static grub_command_t cmd; + +GRUB_MOD_INIT(clear) +{ + (void)mod; /* To stop warning. */ + cmd = grub_register_command ("clear", grub_cmd_clear, + 0, "Clear the terminal screen."); +} + +GRUB_MOD_FINI(clear) +{ + grub_unregister_extcmd (cmd); +} --------------010108070408000609070804--