Skip to content

Commit 9153229

Browse files
committed
tools/versions: alphabetize subcommands
In help, and in the codebase.
1 parent 31f09ae commit 9153229

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

tools/versions.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,13 @@ def do_autoupdate(args: Namespace) -> None:
262262
raise Exception(f"Couldn't update {failures} wraps")
263263

264264

265+
def do_libtool_ver(args: Namespace) -> None:
266+
components = args.info.split(':', 2)
267+
components += ['0'] * (3 - len(components))
268+
current, revision, age = (int(c) for c in components)
269+
print(f'{current - age}.{age}.{revision}')
270+
271+
265272
def do_list(args: Namespace) -> None:
266273
# set default flags
267274
if not any((args.official, args.port)):
@@ -355,13 +362,6 @@ def do_list(args: Namespace) -> None:
355362
print(line)
356363

357364

358-
def do_libtool_ver(args: Namespace) -> None:
359-
components = args.info.split(':', 2)
360-
components += ['0'] * (3 - len(components))
361-
current, revision, age = (int(c) for c in components)
362-
print(f'{current - age}.{age}.{revision}')
363-
364-
365365
def main() -> None:
366366
parser = ArgumentParser(
367367
prog='versions.py',
@@ -388,6 +388,17 @@ def main() -> None:
388388
)
389389
autoupdate.set_defaults(func=do_autoupdate)
390390

391+
libtool_ver = subparsers.add_parser(
392+
'libtool-ver',
393+
aliases=['ltv'],
394+
help='calculate library version from libtool version-info',
395+
description='Calculate library version number from libtool version-info.',
396+
)
397+
libtool_ver.add_argument(
398+
'info', metavar='version-info', help='libtool current:revision:age'
399+
)
400+
libtool_ver.set_defaults(func=do_libtool_ver)
401+
391402
list = subparsers.add_parser(
392403
'list',
393404
aliases=['ls'],
@@ -433,17 +444,6 @@ def main() -> None:
433444
)
434445
list.set_defaults(func=do_list)
435446

436-
libtool_ver = subparsers.add_parser(
437-
'libtool-ver',
438-
aliases=['ltv'],
439-
help='calculate library version from libtool version-info',
440-
description='Calculate library version number from libtool version-info.',
441-
)
442-
libtool_ver.add_argument(
443-
'info', metavar='version-info', help='libtool current:revision:age'
444-
)
445-
libtool_ver.set_defaults(func=do_libtool_ver)
446-
447447
args = parser.parse_args()
448448
args.func(args)
449449

0 commit comments

Comments
 (0)