Skip to contentSkip to conversation

document that menuentry takes positional arguments

PATCH In review Andrey Borzenkov 2 participants 2 messages Jun 25, 2013 – Jul 12, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 document that menuentry takes positional arguments

---
 docs/grub.texi | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
docs/grub.texi +4 -1
index 9dcfa2d..1e53364 100644
@@ -3264,7 +3264,7 @@ These commands can only be used in the menu:
 @deffn Command menuentry @var{title} @
  [@option{--class=class} @dots{}] [@option{--users=users}] @
  [@option{--unrestricted}] [@option{--hotkey=key}] [@option{--id=id}] @
- @{ @var{command}; @dots{} @}
+ [@var{arg} @dots{}] @{ @var{command}; @dots{} @}
 This defines a GRUB menu entry named @var{title}.  When this entry is
 selected from the menu, GRUB will set the @var{chosen} environment variable
 to value of @option{--id} if @option{--id} is given, execute the list of
@@ -3288,6 +3288,9 @@ The @option{--hotkey} option associates a hotkey with a menu entry.
 The @option{--id} may be used to associate unique identifier with a menu entry.
 @var{id} is string of ASCII aphanumeric characters, underscore and hyphen
 and should not start with a digit.
+
+All other arguments including @var{title} are passed as positional parameters
+when list of commands is executed with @var{title} always assigned to @code{$1}.
 @end deffn
 
 
Signature · 1 line
tg: (2cca311..) u/menuentry-args (depends on: master)
#1 lore raw

Go ahead.

Quoted 28 lines · Andrey Borzenkov
---
  docs/grub.texi | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
docs/grub.texi +4 -1
index 9dcfa2d..1e53364 100644
@@ -3264,7 +3264,7 @@ These commands can only be used in the menu:
  @deffn Command menuentry @var{title} @
   [@option{--class=class} @dots{}] [@option{--users=users}] @
   [@option{--unrestricted}] [@option{--hotkey=key}] [@option{--id=id}] @
- @{ @var{command}; @dots{} @}
+ [@var{arg} @dots{}] @{ @var{command}; @dots{} @}
  This defines a GRUB menu entry named @var{title}.  When this entry is
  selected from the menu, GRUB will set the @var{chosen} environment variable
  to value of @option{--id} if @option{--id} is given, execute the list of
@@ -3288,6 +3288,9 @@ The @option{--hotkey} option associates a hotkey with a menu entry.
  The @option{--id} may be used to associate unique identifier with a menu entry.
  @var{id} is string of ASCII aphanumeric characters, underscore and hyphen
  and should not start with a digit.
+
+All other arguments including @var{title} are passed as positional parameters
+when list of commands is executed with @var{title} always assigned to @code{$1}.
  @end deffn