image-info: ensure target is an absolute path

Specify the type for the 'target' command line argument to be an
absolute path. Also add a metavar description for the option.
This commit is contained in:
Christian Kellner 2020-07-08 15:04:55 +02:00 committed by Ondřej Budai
parent ea9b1fa333
commit 9c0fdd9981

View file

@ -398,7 +398,9 @@ def analyse_tarball(path):
def main():
parser = argparse.ArgumentParser(description="Inspect an image")
parser.add_argument("target", help="The file or directory to analyse")
parser.add_argument("target", metavar="TARGET",
help="The file or directory to analyse",
type=os.path.abspath)
args = parser.parse_args()
target = args.target