gooftool: make --file required in cmd - get_firmware_hash.
Without this change, user would see Traceback msg directly because
os.stat() needs string or buffer but NoneType found when --file is not
indicated. With this change, the error msg will be more clear.
BUG=b:78491252
TEST=manually test in the DUT
Change-Id: I11a3eb4ab1f2edef5d388b31250a393e37dbdea8
Reviewed-on: https://chromium-review.googlesource.com/1042625
Commit-Ready: Marco Chen <marcochen@chromium.org>
Tested-by: Marco Chen <marcochen@chromium.org>
Reviewed-by: Yilun Lin <yllin@chromium.org>
diff --git a/py/gooftool/commands.py b/py/gooftool/commands.py
index 64a5ecb..6afa8d0 100755
--- a/py/gooftool/commands.py
+++ b/py/gooftool/commands.py
@@ -757,7 +757,7 @@
@Command('get_firmware_hash',
- CmdArg('--file', metavar='FILE', help='Firmware File.'))
+ CmdArg('--file', required=True, metavar='FILE', help='Firmware File.'))
def GetFirmwareHash(options):
"""Get firmware hash from a file"""
if os.path.exists(options.file):