From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1HvEU3-0004Na-SY for mharc-grub-devel@gnu.org; Mon, 04 Jun 2007 11:28:39 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HvEU1-0004Ju-MF for grub-devel@gnu.org; Mon, 04 Jun 2007 11:28:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HvETz-0004Iv-Pn for grub-devel@gnu.org; Mon, 04 Jun 2007 11:28:37 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HvETz-0004Ih-B4 for grub-devel@gnu.org; Mon, 04 Jun 2007 11:28:35 -0400 Received: from smtp-vbr10.xs4all.nl ([194.109.24.30]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HvETy-0007Ox-Re for grub-devel@gnu.org; Mon, 04 Jun 2007 11:28:35 -0400 Received: from localhost.localdomain (249-174.surfsnel.dsl.internl.net [145.99.174.249]) by smtp-vbr10.xs4all.nl (8.13.8/8.13.8) with ESMTP id l54FSXvK063740 for ; Mon, 4 Jun 2007 17:28:34 +0200 (CEST) (envelope-from mgerards@xs4all.nl) From: Marco Gerards To: The development of GRUB 2 References: <200706021604.l52G4Ar4014398@correoredir01.dinaserver.com> <46622EA6.904@raulete.net> Mail-Copies-To: mgerards@xs4all.nl Date: Mon, 04 Jun 2007 17:34:34 +0200 In-Reply-To: <46622EA6.904@raulete.net> (adrian15@raulete.net's message of "Sun, 03 Jun 2007 04:59:50 +0200") Message-ID: <877iqj7myd.fsf@xs4all.nl> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by XS4ALL Virus Scanner X-detected-kernel: FreeBSD 4.6-4.9 Subject: Re: test -e patch 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: Mon, 04 Jun 2007 15:28:37 -0000 adrian15 writes: >>> GRUB_MOD_INIT(test) >>> { >>> (void)mod; /* To stop warning. */ >>> grub_register_command ("[", grub_cmd_test, GRUB_COMMAND_FLAG_CMDLINE, >>> "[ EXPRESSION ]", "Evaluate an expression", 0); >>> grub_register_command ("test", grub_cmd_test, GRUB_COMMAND_FLAG_CMDLINE, >>> "test EXPRESSION", "Evaluate an expression", 0); >>> } >> >> I understand this register commands. I suppose this information is read >> from the help command or it isn't ? >> >> Or maybe it also reads from: >> static const struct grub_arg_option options ? > > I've found it. > > It reads from the register command and ALSO from options IF you tell it > to do so with: > > (void)mod; /* To stop warning. */ > grub_register_command ("[", grub_cmd_test, GRUB_COMMAND_FLAG_CMDLINE, > "[ EXPRESSION ]", "Evaluate an expression", options); > grub_register_command ("test", grub_cmd_test, GRUB_COMMAND_FLAG_CMDLINE, > "test EXPRESSION", "Evaluate an expression", options); If you don't pass the options to this functions, the options won't be parsed. One fun thing you can try: options can be tab-completed in GRUB 2 :-) -- Marco