common: also accept single digit values for mnclen

when using the --mnclen option it is easy to get confused with the
parameter. The parameter has to be a two digit hex value. To make things
easier lets convert a single digit hex value to two digit one
This commit is contained in:
Philipp Maier 2023-01-19 12:19:00 +01:00
parent 1b44d0e651
commit 7c6777d127
1 changed files with 2 additions and 0 deletions

View File

@ -84,6 +84,8 @@ class Common():
elif opt in ("-n", "--mnclen"):
self.show_mnclen = True
elif opt in ("-N", "--set-mnclen"):
if len(arg) == 1:
arg = "0" + arg
self.write_mnclen = asciihex_to_list(arg)
elif opt in ("-l", "--milenage"):
self.show_milenage = True