Skip to content

Commit

Permalink
Add CLI client arg to turn debugging on/off.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertbartel committed Jan 24, 2024
1 parent 463b977 commit 8e6e3bd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/lib/client/dmod/client/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ def _handle_args():
default=Path('.dmod_client_config.json'))
parser.add_argument('--bypass-request-service', '-b', dest='bypass_reqsrv', action='store_true', default=False,
help='Attempt to connect directly to the applicable service')
parser.add_argument('--remote-debug', '-D', dest='remote_debug', action='store_true', default=False,
help='Activate remote debugging, according to loaded client configuration.')
# Top-level subparsers container, splitting off a variety of handled commands for different behavior
# e.g., 'dataset' to do things related to datasets, like creation
subparsers = parser.add_subparsers(dest='command')
Expand Down Expand Up @@ -441,8 +443,11 @@ def main():
try:

client_config = ClientConfig.parse_file(client_config_path)
if client_config.pycharm_debug_config is not None:
if args.remote_debug and client_config.pycharm_debug_config is not None:
_load_debugger_and_settrace(debug_cfg=client_config.pycharm_debug_config)
elif args.remote_debug:
print("ERROR: received arg to activate remote debugging, but client config lacks debugging parameters.")
exit(1)

client = DmodClient(client_config=client_config, bypass_request_service=args.bypass_reqsrv)

Expand Down

0 comments on commit 8e6e3bd

Please sign in to comment.