Skip to contentSkip to conversation

Checking parametres that are not inside an option

DISCUSSION adrian15 2 participants 2 messages Jun 12, 2007

lore
Share & tools
lore

adrian15

author
#0 lore raw

If you take a look at search.c you can see that the -s parametrer is checked outside the command thanks to the ARG_TYPE_STRING constant.

{"set", 's', GRUB_ARG_OPTION_OPTIONAL, "set a variable to the first device found", "VAR", ARG_TYPE_STRING}

If I want not to check if an argument command that it IS NOT inside an option is something (a disk, i.e.) or not... how do I do it?

I mean I want something like:

map (hd0) (hd1)

to be checked outside the command without using:

map -disk1 (hd0) -disk2 (hd1)
and the correspondent option definition at map.c

how do I do it ?

adrian15

#1 lore raw
Quoted 12 lines · adrian15 <[email protected]> writes:

If you take a look at search.c you can see that the -s parametrer is checked outside the command thanks to the ARG_TYPE_STRING constant.

{"set", 's', GRUB_ARG_OPTION_OPTIONAL, "set a variable to the first device found", "VAR", ARG_TYPE_STRING}

If I want not to check if an argument command that it IS NOT inside an option is something (a disk, i.e.) or not... how do I do it?

I mean I want something like:

Quoted 8 lines

map (hd0) (hd1)

to be checked outside the command without using:

map -disk1 (hd0) -disk2 (hd1)
and the correspondent option definition at map.c

how do I do it ?

That's not possible with the current code. You would have to add such check yourself, which should not be too hard.

--
Marco