Skip to content

Commit

Permalink
Fixed -S option to tell you the tasks if no task is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
OmegaLambda1998 committed Sep 6, 2021
1 parent 1090e63 commit b841f1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion run.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def get_syntax():
taskname = ["DATAPREP", "SIM", "LCFIT", "CLASSIFY", "AGG", "MERGE", "BIASCOR", "CREATE_COV", "COSMOMC", "ANALYSE"]
for i, name in enumerate(taskname):
syntax[name] = tasks[i]
syntax["options"] = f"Possible tasks are: ({[(i, task) for i, task in enumerate(taskname)]})"
return syntax

def print_syntax(s):
Expand Down Expand Up @@ -169,7 +170,7 @@ def get_args(test=False):
parser.add_argument("-c", "--check", help="Check if config is valid", action="store_true", default=False)
parser.add_argument("-p", "--permission", help="Fix permissions and groups on all output, don't rerun", action="store_true", default=False)
parser.add_argument("-i", "--ignore", help="Dont rerun tasks with this stage or less", default=None)
parser.add_argument("-S", "--syntax", help="Get the syntax of the given task.", default=None, type=str)
parser.add_argument("-S", "--syntax", help="Get the syntax of the given task.", default=None, const="options", type=str, nargs='?')
args = parser.parse_args()

if args.syntax is not None:
Expand Down

0 comments on commit b841f1e

Please sign in to comment.