]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[script] Allow commands following a script label
authorMichael Brown <mcb30@ipxe.org>
Tue, 23 Jul 2013 15:49:12 +0000 (16:49 +0100)
committerMichael Brown <mcb30@ipxe.org>
Thu, 25 Jul 2013 12:22:43 +0000 (13:22 +0100)
commit31f5211035cf0434a1b5043f707ecd2316d4a18c
tree31e7af8257515dbc9137e2154796adda00f5de0e
parent7fc18ea8ab845da3e252abb7d78060182b0342a3
[script] Allow commands following a script label

Allow commands to be placed on the same line as a label.  This allows
for improved legibility of loop constructions by incorporating the
loop check condition into the same line as the loop label.  For
example, to iterate over network devices using the forthcoming "inc"
command:

  set idx:int16 0
  :loop isset ${net${idx}/mac} || goto loop_done
    echo net${idx} is a ${net${idx}/chip} with MAC ${net${idx}/mac}
    inc idx && goto loop
  :loop_done

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/image/script.c