[coreboot-gerrit] Patch set updated for coreboot: board_status: Add longopt equivalents for older options
David Hendricks (dhendrix@chromium.org)
gerrit at coreboot.org
Sat May 7 21:29:10 CEST 2016
David Hendricks (dhendrix at chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14736
-gerrit
commit de3d01dfc7fcf5c346ef1604e80568c5f96483cc
Author: David Hendricks <davidhendricks at gmail.com>
Date: Sat May 7 11:44:05 2016 -0700
board_status: Add longopt equivalents for older options
Long options can be useful when writing examples and documentation
as they are more expressive and obvious to the reader.
Change-Id: I39496765ba1f15ccc2ffe1ad730f0f95702f82b8
Signed-off-by: David Hendricks <dhendrix at chromium.org>
---
util/board_status/board_status.sh | 33 +++++++++++++++++----------------
1 file changed, 17 insertions(+), 16 deletions(-)
diff --git a/util/board_status/board_status.sh b/util/board_status/board_status.sh
index 3dca85f..39977ca 100755
--- a/util/board_status/board_status.sh
+++ b/util/board_status/board_status.sh
@@ -171,19 +171,19 @@ show_help() {
${0} <option>
Options
- -h
+ -h, --help
Show this message.
- -C
+ -C, --clobber
Clobber temporary output when finished. Useful for debugging.
- -i <image>
+ -i, --input <image>
Path to coreboot image (Default is $COREBOOT_IMAGE).
- -r <host>
+ -r, --remote-host <host>
Obtain machine information from remote host (using ssh).
- -s </dev/xxx>
+ -s, --serial-device </dev/xxx>
Obtain boot log via serial device.
- -S <speed>
+ -S, --serial-speed <speed>
Set the port speed for the serial device (Default is $SERIAL_PORT_SPEED).
- -u
+ -u, --upload-results
Upload results to coreboot.org.
"
}
@@ -194,36 +194,37 @@ if [ $? -ne 4 ]; then
exit $EXIT_FAILURE
fi
-# TODO: add longopts in the quotes after -l
-ARGS=$(getopt -o Chi:r:s:S:u -l "" -n "$0" -- "$@");
+LONGOPTS="clobber,help,input:,remote-host:,serial-device:,serial-speed:,upload-results"
+
+ARGS=$(getopt -o Chi:r:s:S:u -l "$LONGOPTS" -n "$0" -- "$@");
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
eval set -- "$ARGS"
while true ; do
case "$1" in
- -h)
+ -h|--help)
show_help
exit $EXIT_SUCCESS
;;
- -C)
+ -C|--clobber)
CLOBBER_OUTPUT=1
;;
- -i)
+ -i|--input)
shift
COREBOOT_IMAGE="$1"
;;
- -r)
+ -r|--remote-host)
shift
REMOTE_HOST="$1"
;;
- -s)
+ -s|--serial-device)
shift
SERIAL_DEVICE="$1"
;;
- -S)
+ -S|--serial-speed)
shift
SERIAL_PORT_SPEED="$1"
;;
- -u)
+ -u|--upload-results)
UPLOAD_RESULTS=1
;;
--)
More information about the coreboot-gerrit
mailing list