diff options
Diffstat (limited to 'scripts/llvm.py')
-rw-r--r-- | scripts/llvm.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/llvm.py b/scripts/llvm.py index 4b18560..27b8cb7 100644 --- a/scripts/llvm.py +++ b/scripts/llvm.py @@ -1,6 +1,7 @@ """This is the main tool for handling llvm builds, bisects etc.""" import os +from sys import argv from sys import exit from modules.llvm import LLVMSubproject @@ -103,12 +104,8 @@ options.add_argument( '--env', required=True, help="Path to the environment to update.") -options.add_argument( - '--repos', required=True, - help="Path to the directory containing the repositories for all LLVM " - "subprojects.") -subcommands = options.add_subparsers() +subcommands = options.add_subparsers(dest="subcommand") # Subcommand for adding / removing subprojects projs = subcommands.add_parser( @@ -138,6 +135,10 @@ projs.add_argument( choices=valid_subprojects, metavar='subproject', help="Disable given subprojects.") +projs.add_argument( + '--repos', + help="Path to the directory containing the repositories for all LLVM " + "subprojects.") # Subcommand for pushing the current branch to origin push = subcommands.add_parser( @@ -147,4 +148,7 @@ push = subcommands.add_parser( push.set_defaults(run_command=push_current_branch) args = options.parse_args() +if args.subcommand == "projects" and args.add and not args.repos: + projs.error( + "When adding a subproject you must also pass the --repos argument") args.run_command(args) |