improved help message for toolchain-m68k

This commit is contained in:
bebbo
2017-09-06 08:03:54 +02:00
parent 97046e279b
commit 2c75594562
+13 -18
View File
@@ -8,6 +8,7 @@ from logging import info, getLogger
from os import environ from os import environ
import os import os
import argparse import argparse
from argparse import RawTextHelpFormatter
import logging import logging
import platform import platform
import re import re
@@ -807,18 +808,6 @@ def test():
execute('make', 'clean') execute('make', 'clean')
execute('make') execute('make')
def __help_actions():
print ('\n'
'build: download, update and build the tool chain (use --threads n to speed up the build)\n'
'xbuild: build the tool chain (use --threads n to speed up the build)\n'
'clean: remove the build artifacts\n'
'update: updates the submodules using git\n'
'download: download the archives\n'
'list-sdk: list the available sdks\n'
'install-sdk: install the specified sdk\n'
'test: build the example files\n')
if __name__ == "__main__": if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG, format='%(levelname)s: %(message)s') logging.basicConfig(level=logging.DEBUG, format='%(levelname)s: %(message)s')
@@ -832,14 +821,20 @@ if __name__ == "__main__":
if platform.machine() not in ['i686', 'x86_64']: if platform.machine() not in ['i686', 'x86_64']:
panic('Build on %s architecture not supported!', platform.machine()) panic('Build on %s architecture not supported!', platform.machine())
if sys.argv[1] == '--help': parser = argparse.ArgumentParser(description='Build cross toolchain.', formatter_class=RawTextHelpFormatter)
__help_actions()
parser = argparse.ArgumentParser(description='Build cross toolchain.')
parser.add_argument('action', parser.add_argument('action',
choices=['build', 'xbuild', 'list-sdk', 'install-sdk', 'clean', choices=['build', 'xbuild', 'list-sdk', 'install-sdk', 'clean',
'test', 'update', 'download'], 'test', 'update', 'download'],
default='build', help='perform an action') default='build', help='\n'
'build: download, update and build the tool chain (use --threads n to speed up the build)\n'
'xbuild: build the tool chain (use --threads n to speed up the build)\n'
'clean: remove the build artifacts\n'
'update: updates the submodules using git\n'
'download: download the archives\n'
'list-sdk: list the available sdks\n'
'install-sdk: install the specified sdk\n'
'test: build mui and mmu sdk, then build the example files\n'
'\n')
parser.add_argument('args', metavar='ARGS', type=str, nargs='*', parser.add_argument('args', metavar='ARGS', type=str, nargs='*',
help='action arguments') help='action arguments')
parser.add_argument('--binutils', choices=['2.9.1', '2.14'], default='2.14', parser.add_argument('--binutils', choices=['2.9.1', '2.14'], default='2.14',
@@ -860,7 +855,7 @@ if __name__ == "__main__":
binutils_ver=args.binutils, binutils_ver=args.binutils,
gcc_ver=args.gcc, gcc_ver=args.gcc,
numThreads=args.threads) numThreads=args.threads)
setvar(m4='m4-1.4.17', setvar(m4='m4-1.4.17',
gawk='gawk-3.1.8', gawk='gawk-3.1.8',
flex='flex-2.5.4', flex='flex-2.5.4',