sw-update: provide usage info
with option -h or with invalid arguments a usage info is printed to the console. BugzID: 53654 Signed-off-by: Patrick Zysset <patrick.zysset@netmodule.com>
This commit is contained in:
parent
2d1b39425a
commit
9516353ff8
|
|
@ -276,6 +276,12 @@ update_spl()
|
||||||
log INFO "spl update succeed!"
|
log INFO "spl update succeed!"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
usage()
|
||||||
|
{
|
||||||
|
echo "Usage: $0 [ -l <linux-image>.tar.gz ] [ -u <u-boot>.img ] [ -s <spl>.img ] [ -h ]"
|
||||||
|
exit 2
|
||||||
|
}
|
||||||
|
|
||||||
############################ Start of script ###################################
|
############################ Start of script ###################################
|
||||||
|
|
||||||
if [ ! -b $PLATFORM_MAIN_STORAGE ]; then
|
if [ ! -b $PLATFORM_MAIN_STORAGE ]; then
|
||||||
|
|
@ -295,7 +301,11 @@ while getopts ":l:u:s:h" opt; do
|
||||||
update_spl $OPTARG
|
update_spl $OPTARG
|
||||||
;;
|
;;
|
||||||
h)
|
h)
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
usage
|
||||||
|
;;
|
||||||
|
?)
|
||||||
|
log INFO "Invalid option: -$OPTARG"
|
||||||
|
usage
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue