Add versioning to imgtool

Signed-off-by: Fabio Utzig <utzig@apache.org>
This commit is contained in:
Fabio Utzig 2019-09-10 12:52:26 -03:00 committed by Andrzej Puzdrowski
parent 99ec383ea1
commit 25c6a1590a
3 changed files with 11 additions and 2 deletions

View File

@ -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"

View File

@ -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__':

View File

@ -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",