Commit c2226790 authored by segfault's avatar segfault
Browse files

Fix tails-get-bootinfo

- didn't return error return code in one error case
- error message was printed to stdout instead of stderr
- incorrect usage string
parent 42cbea3d
......@@ -35,13 +35,14 @@ def main(*args):
if not kernel or not initrd:
print('Failed to parse /proc/cmdline', file=sys.stderr)
sys.exit(1)
if 'kernel' in args:
print(LIVE_IMAGE_MOUNTPOINT + kernel, end="")
elif 'initrd' in args:
print(LIVE_IMAGE_MOUNTPOINT + initrd, end="")
else:
print('Usage: tails-get-bootinfo kernel|initrd PATH', file=sys.stderr)
print('Usage: tails-get-bootinfo kernel|initrd', file=sys.stderr)
sys.exit(1)
......@@ -52,5 +53,5 @@ if __name__ == "__main__":
elif len(sys.argv) == 2:
main(*sys.argv[1:])
else:
print('Usage: tails-get-bootinfo kernel|initrd')
print('Usage: tails-get-bootinfo kernel|initrd', file=sys.stderr)
sys.exit(1)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment