diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2020-11-24 15:32:58 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-24 23:32:58 +0200 |
| commit | 56984a34b03c5b87d8bad69e6f169d176b7c4a55 (patch) | |
| tree | 8acd04221966e1a32c5dc07895072efbbbffa676 /task | |
| parent | Update README.md (diff) | |
| download | taskipy2-56984a34b03c5b87d8bad69e6f169d176b7c4a55.zip | |
Add -l option for taskipy list command (#24)
Diffstat (limited to '')
| -rwxr-xr-x | taskipy/cli.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/taskipy/cli.py b/taskipy/cli.py index d558e3b..f8e49ee 100755 --- a/taskipy/cli.py +++ b/taskipy/cli.py @@ -12,15 +12,17 @@ def main(): prog='task', description='runs a task specified in your pyproject.toml under [tool.taskipy.tasks]', ) - parser.add_argument('--list', help='show list of available tasks', action='store_true') + parser.add_argument('-l', '--list', help='show list of available tasks', action='store_true') parser.add_argument('name', help='name of the task', nargs='?') parser.add_argument('args', nargs=argparse.REMAINDER, help='arguments to pass to the task') args = parser.parse_args() try: runner = TaskRunner(Path.cwd() / 'pyproject.toml') + if args.list: runner.list() sys.exit(0) + exit_code = runner.run(args.name, args.args) sys.exit(exit_code) except TaskipyError as e: |