diff options
author | Yunhua Feng <yunhuax.feng@intel.com> | 2018-08-24 14:01:50 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-10-13 09:54:54 +0800 |
commit | 60dc40db2aac3d84332dbb17b1d20e353bfceb0c (patch) | |
tree | d7f5e78f2f3070d0d05f5e0e54599affa00ffd0d /BaseTools/Source/Python/Rsa2048Sha256Sign | |
parent | 2e300969aeff5a863098242ebd95b7d653893262 (diff) | |
download | edk2-60dc40db2aac3d84332dbb17b1d20e353bfceb0c.tar.gz edk2-60dc40db2aac3d84332dbb17b1d20e353bfceb0c.tar.bz2 edk2-60dc40db2aac3d84332dbb17b1d20e353bfceb0c.zip |
BaseTools: Update argparse arguments since it not have version now
argparse.ArgumentParser not have version parameter
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Rsa2048Sha256Sign')
-rw-r--r-- | BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256GenerateKeys.py | 3 | ||||
-rw-r--r-- | BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256GenerateKeys.py b/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256GenerateKeys.py index e49e819c9a..7bdc460146 100644 --- a/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256GenerateKeys.py +++ b/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256GenerateKeys.py @@ -42,8 +42,9 @@ if __name__ == '__main__': #
# Create command line argument parser object
#
- parser = argparse.ArgumentParser(prog=__prog__, version=__version__, usage=__usage__, description=__copyright__, conflict_handler='resolve')
+ parser = argparse.ArgumentParser(prog=__prog__, usage=__usage__, description=__copyright__, conflict_handler='resolve')
group = parser.add_mutually_exclusive_group(required=True)
+ group.add_argument("--version", action='version', version=__version__)
group.add_argument("-o", "--output", dest='OutputFile', type=argparse.FileType('wb'), metavar='filename', nargs='*', help="specify the output private key filename in PEM format")
group.add_argument("-i", "--input", dest='InputFile', type=argparse.FileType('rb'), metavar='filename', nargs='*', help="specify the input private key filename in PEM format")
parser.add_argument("--public-key-hash", dest='PublicKeyHashFile', type=argparse.FileType('wb'), help="specify the public key hash filename that is SHA 256 hash of 2048 bit RSA public key in binary format")
diff --git a/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py b/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py index be5ebac280..6cb235ae75 100644 --- a/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py +++ b/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py @@ -61,8 +61,9 @@ if __name__ == '__main__': #
# Create command line argument parser object
#
- parser = argparse.ArgumentParser(prog=__prog__, version=__version__, usage=__usage__, description=__copyright__, conflict_handler='resolve')
+ parser = argparse.ArgumentParser(prog=__prog__, usage=__usage__, description=__copyright__, conflict_handler='resolve')
group = parser.add_mutually_exclusive_group(required=True)
+ group.add_argument("--version", action='version', version=__version__)
group.add_argument("-e", action="store_true", dest='Encode', help='encode file')
group.add_argument("-d", action="store_true", dest='Decode', help='decode file')
parser.add_argument("-o", "--output", dest='OutputFile', type=str, metavar='filename', help="specify the output filename", required=True)
|