diff --git a/scripts/imgtool/__init__.py b/scripts/imgtool/__init__.py index 107921f9..8f6e8489 100644 --- a/scripts/imgtool/__init__.py +++ b/scripts/imgtool/__init__.py @@ -11,3 +11,5 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + +imgtool_version = "1.4.0a3" diff --git a/scripts/imgtool/main.py b/scripts/imgtool/main.py index 22bce62c..27697aeb 100755 --- a/scripts/imgtool/main.py +++ b/scripts/imgtool/main.py @@ -20,7 +20,7 @@ import click import getpass import imgtool.keys as keys import sys -from imgtool import image +from imgtool import image, imgtool_version from imgtool.version import decode_version @@ -249,6 +249,11 @@ class AliasesGroup(click.Group): return None +@click.command(help='Print imgtool version information') +def version(): + print(imgtool_version) + + @click.command(cls=AliasesGroup, context_settings=dict(help_option_names=['-h', '--help'])) def imgtool(): @@ -259,6 +264,7 @@ imgtool.add_command(keygen) imgtool.add_command(getpub) imgtool.add_command(verify) imgtool.add_command(sign) +imgtool.add_command(version) if __name__ == '__main__': diff --git a/scripts/setup.py b/scripts/setup.py index 0eeeba52..a58e6b02 100644 --- a/scripts/setup.py +++ b/scripts/setup.py @@ -1,8 +1,9 @@ import setuptools +from imgtool import imgtool_version setuptools.setup( name="imgtool", - version="1.3.1", + version=imgtool_version, author="The MCUboot commiters", description=("MCUboot's image signing and key management"), license="Apache Software License",