Mercurial > lcfOS
comparison python/zcc.py @ 332:87feb8a23b4d
Added task list command
author | Windel Bouwman |
---|---|
date | Fri, 07 Feb 2014 12:51:55 +0100 |
parents | a78b41ff6ad2 |
children | 6f4753202b9a |
comparison
equal
deleted
inserted
replaced
331:a78b41ff6ad2 | 332:87feb8a23b4d |
---|---|
28 def make_parser(): | 28 def make_parser(): |
29 parser = argparse.ArgumentParser(description='lcfos Compiler') | 29 parser = argparse.ArgumentParser(description='lcfos Compiler') |
30 | 30 |
31 parser.add_argument('--log', help='Log level (INFO,DEBUG,[WARN])', | 31 parser.add_argument('--log', help='Log level (INFO,DEBUG,[WARN])', |
32 type=logLevel, default='WARN') | 32 type=logLevel, default='WARN') |
33 parser.add_argument('--display-build-steps', action='store_true') | |
33 sub_parsers = parser.add_subparsers(title='commands', | 34 sub_parsers = parser.add_subparsers(title='commands', |
34 description='possible commands', dest='command') | 35 description='possible commands', dest='command') |
35 recipe_parser = sub_parsers.add_parser('recipe', help="Bake recipe") | 36 recipe_parser = sub_parsers.add_parser('recipe', help="Bake recipe") |
36 recipe_parser.add_argument('recipe_file', help='recipe file') | 37 recipe_parser.add_argument('recipe_file', help='recipe file') |
37 | 38 |
101 recipe_loader = RecipeLoader() | 102 recipe_loader = RecipeLoader() |
102 recipe_loader.load_file(args.recipe_file, runner) | 103 recipe_loader.load_file(args.recipe_file, runner) |
103 else: | 104 else: |
104 raise NotImplementedError('Invalid option') | 105 raise NotImplementedError('Invalid option') |
105 | 106 |
106 res = runner.run_tasks() | 107 if args.display_build_steps: |
108 runner.display() | |
109 res = 0 | |
110 else: | |
111 res = runner.run_tasks() | |
107 | 112 |
108 logging.getLogger().removeHandler(ch) | 113 logging.getLogger().removeHandler(ch) |
109 return res | 114 return res |
110 | 115 |
111 | 116 |