* How to call a command from another one
@ 2007-06-12 11:57 adrian15
2007-06-12 14:16 ` Robert Millan
0 siblings, 1 reply; 4+ messages in thread
From: adrian15 @ 2007-06-12 11:57 UTC (permalink / raw)
To: The development of GRUB 2
Hi,
I want to implement the pause command so that it is the same thing as
the echo command with all of its options and also that it stops.
My first approach which I could not compile because I do not how to add
a new command to grub2 is the following one:
char key;
if (argc!=0)
grub_cmd_echo(state,argc,args);
key = grub_getkey ();
return 0;
So my question is if it's an orthodox way of calling another command, if
I should call it in another way or if I should not call it in any way.
adrian15
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: How to call a command from another one
2007-06-12 11:57 How to call a command from another one adrian15
@ 2007-06-12 14:16 ` Robert Millan
2007-06-12 14:09 ` adrian15
0 siblings, 1 reply; 4+ messages in thread
From: Robert Millan @ 2007-06-12 14:16 UTC (permalink / raw)
To: The development of GRUB 2
On Tue, Jun 12, 2007 at 01:57:11PM +0200, adrian15 wrote:
> Hi,
>
> I want to implement the pause command so that it is the same thing as
> the echo command with all of its options and also that it stops.
>
> My first approach which I could not compile because I do not how to
> add
> a new command to grub2 is the following one:
>
>
> char key;
> if (argc!=0)
> grub_cmd_echo(state,argc,args);
> key = grub_getkey ();
>
> return 0;
>
>
>
> So my question is if it's an orthodox way of calling another command, if
> I should call it in another way or if I should not call it in any way.
I don't know how to call other commands, but in this case, maybe grub_printf()
will be good enough?
--
Robert Millan
My spam trap is honeypot@aybabtu.com. Note: this address is only intended
for spam harvesters. Writing to it will get you added to my black list.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to call a command from another one
2007-06-12 14:16 ` Robert Millan
@ 2007-06-12 14:09 ` adrian15
2007-06-12 17:16 ` Marco Gerards
0 siblings, 1 reply; 4+ messages in thread
From: adrian15 @ 2007-06-12 14:09 UTC (permalink / raw)
To: The development of GRUB 2
Robert Millan escribió:
> On Tue, Jun 12, 2007 at 01:57:11PM +0200, adrian15 wrote:
>> Hi,
>>
>> I want to implement the pause command so that it is the same thing as
>> the echo command with all of its options and also that it stops.
> I don't know how to call other commands, but in this case, maybe grub_printf()
> will be good enough?
I agree with you but...
I think it would be a good idea to have a pause message that has the
same options as the echo command because the echo command has some nice
options and because I like to reuse code.
adrian15
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to call a command from another one
2007-06-12 14:09 ` adrian15
@ 2007-06-12 17:16 ` Marco Gerards
0 siblings, 0 replies; 4+ messages in thread
From: Marco Gerards @ 2007-06-12 17:16 UTC (permalink / raw)
To: The development of GRUB 2
adrian15 <adrian15@raulete.net> writes:
> Robert Millan escribió:
>> On Tue, Jun 12, 2007 at 01:57:11PM +0200, adrian15 wrote:
>>> Hi,
>>>
>>> I want to implement the pause command so that it is the same thing as
>>> the echo command with all of its options and also that it stops.
>> I don't know how to call other commands, but in this case, maybe grub_printf()
>> will be good enough?
>
> I agree with you but...
>
> I think it would be a good idea to have a pause message that has the
> same options as the echo command because the echo command has some
> nice options and because I like to reuse code.
Make them share the same file. Call grub_cmd_echo with the same
arguments which are used for pause. Before and after that you can do
whatever you want. The disadvantage of this approach is that the set
of arguments should be the same.
--
Marco
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-06-12 17:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-12 11:57 How to call a command from another one adrian15
2007-06-12 14:16 ` Robert Millan
2007-06-12 14:09 ` adrian15
2007-06-12 17:16 ` Marco Gerards
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.