Skip to content

Commit

Permalink
WIP handle '--' in pydoit
Browse files Browse the repository at this point in the history
  • Loading branch information
umarcor committed Aug 1, 2021
1 parent 988ab8f commit 558ca09
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion dodo.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
#!/usr/bin/env python3

# doit

from sys import executable
from sys import executable, argv as sys_argv, exit as sys_exit
from os import environ
from pathlib import Path

from doit.action import CmdAction
from doit.cmd_base import ModuleTaskLoader
from doit.doit_cmd import DoitMain

from tasks.examples import Example, GenerateExamplesJobMatrix, PRJ

BOARDS = PRJ.Boards

DOIT_CONFIG = {"verbosity": 2, "action_string_formatting": "both"}
EXTRA_ARGS = []

ROOT = Path(__file__).parent

Expand Down Expand Up @@ -203,3 +208,29 @@ def task_DeployToGitHubPages():
"doc": "Create a clean branch in subdir 'public' and push to branch 'gh-pages'",
"pos_arg": "posargs",
}


def task_echo():
return {
'actions': ['echo hi {args}'],
'verbosity': 2,
"params": [
{
"name": "args",
"short": "a",
"long": "args",
"type": list,
"default": EXTRA_ARGS,
"help": "Arguments to pass to the VUnit script",
}
],
}


if __name__ == '__main__':
argv = sys_argv[1:]
if '--' in argv:
idx = argv.index('--')
EXTRA_ARGS = argv[idx+1:]
argv = argv[0:idx]
sys_exit(DoitMain(ModuleTaskLoader(globals())).run(argv))

0 comments on commit 558ca09

Please sign in to comment.