vectorgrp / sil-kit

Vector SIL Kit – Open-Source Library for Connecting Software-in-the-Loop Environments
https://vectorgrp.github.io/sil-kit-docs
MIT License
107 stars 32 forks source link

SILKIT-1529 Harmonize CLI of commandline utilities #106

Closed AndreasRentschler closed 2 months ago

AndreasRentschler commented 2 months ago

Subject

Commandline utilities Registry, Monitor and System Controller behaved differently for the user:

Description

Changes:

Instructions for review / testing

Things to check

Developer checklist (address before review)

AndreasRentschler commented 2 months ago

As suggested by @VDanielEdwards, an alternative to introduce option `--interactive' is to deploy a Windows batch script which pauses our utilities after execution, for example:

run-and-pause.cmd

@echo off

if ["%~1"]==[""] goto usage
%* && pause || pause
exit /b %errorlevel%
goto :eof

:usage
@echo Execute a command line program and then prompt the user to press a key.
@echo Usage: run-and-pause ^<executable^> ^[^<argument1^> ^[^<argument2^> ...^]^]
exit /b 1

Downside: When the user uses [Ctrl+C] to signal the executed tool to shutdown, the signal is subsequently forwarded to Windows cmd, which asks to Terminate batch job (Y/N)?. This behavior cannot be suppressed to my knowledge.