Skip to content

REPL vs. CLI

While working pretty extensively with and around EXPLIoT I came to the conclusion that the REPL doesn't provide as much benefit as it should compared to a CLI-only approach. At various positions the REPL's behavior simply mimics a "classic" CLI (basically it saves one from typing expliot for the execution of a test, e. g., expliot run... vs. run).

Unfortunately are not all options and parameters stored between runs e. g., -p /dev/ttyACM0.

ef> run uart.generic.baudscan -p /dev/ttyACM0
[...] Connecting to the the serial port (/dev/ttyACM0) timeout (3)
[*] Scanning for baud rates: 1200,2400,4800,9600,19200,38400,57600,115200
[?] Checking baud rate: 1200
[...]
[+] 
[*] Baud rate 1200 has max. ASCII percentage of 83.33 %
[-] Test uart.generic.baudscan failed. Reason = No good baud rate found
ef> run uart.generic.baudscan
[...]
[*] Connecting to the the serial port (/dev/ttyUSB0) timeout (3)
[*] Scanning for baud rates: 1200,2400,4800,9600,19200,38400,57600,115200

It feels like that supporting env vars, e.g., export PORT=/dev/ttyACM0 would help to be able streamline tests or re-run tests if there are failures.

One other concern, cmd2 was last released 1.5 years ago and the development is slow.

Perhaps would it make sense to try out other CLI framework, like rich or python-fire.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information