Skip to content

Commit

Permalink
main: Add -C parameter
Browse files Browse the repository at this point in the history
Add -C parameter to allow specifying alternative working
directory.

Ref:
    https://lists.denx.de/pipermail/tbot/2018-November/000063.html

Signed-off-by: Rahix <hws@denx.de>
  • Loading branch information
Rahix committed Nov 28, 2018
1 parent 95eeaa5 commit a2afa7c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,8 @@
# Changelog

## [Unreleased]
### Added
- `-C` parameter to allow setting a different working directory


## [0.6.3] - 2018-11-28
Expand Down
12 changes: 12 additions & 0 deletions tbot/main.py
Expand Up @@ -28,6 +28,13 @@ def main() -> None: # noqa: C901

parser.add_argument("testcase", nargs="*", help="testcase that should be run.")

parser.add_argument(
"-C",
metavar="WORKDIR",
dest="workdir",
help="use WORKDIR as working directory instead of the current directory.",
)

parser.add_argument("-b", "--board", help="use this board instead of the default.")

parser.add_argument("-l", "--lab", help="use this lab instead of the default.")
Expand Down Expand Up @@ -90,6 +97,11 @@ def main() -> None: # noqa: C901

args = parser.parse_args()

if args.workdir:
import os

os.chdir(args.workdir)

from tbot import log

# Determine LogFile
Expand Down

0 comments on commit a2afa7c

Please sign in to comment.