Draft: Refactor VECTO Console
Legend
✅ Refactor WriteXXXLine to accept STDOUT and STDERR
1.
✅ Use argument parser
2. https://stackoverflow.com/questions/491595/best-way-to-parse-command-line-arguments-in-c
vecto/vecto!81 (comment 69390)
Arguments to implement:
ams: append manufacturing stept: output information about execution timesmod: write mod-data in addition to sum-data1Hz: convert mod-data to 1Hz resolutioneng: switch to engineering mode (implies -mod)q: quiet - disables console output unless verbose information is enablednv: skip validation of internal data structure before simulationv: Shows verbose information (errors and warnings will be displayed)vv: Shows more verbose information (infos will be displayed)vvv: Shows debug messages (slow!)vvvv: Shows all verbose information (everything, slow!)V: show version informationh: Displays this help.
See Mono.Options documentation:
https://github.com/xamarin/XamarinComponents/blob/main/XPlat/Mono.Options/GettingStarted.md
or
https://github.com/xamarin/XamarinComponents/tree/main/XPlat/Mono.Options
✅ Stop execution when asking for app version via command -v
3. I would separate the 2 cases, and stop when explicitly asking app-version:
Line 194:
- if (args.Contains("-V") || _debugEnabled) {
- ShowVersionInformation();
- }
+ if (args.Contains("-V")) {
+ ShowVersionInformation(Console);
+ return 0;
+ }
+ else if (_debugEnabled) {
+ ShowVersionInformation(Console.Error);
+ }
vecto/vecto!81 (comment 69391)
✅ Let exceptions "bubble up" and handle on final step
4. See 69392 and for the "above" see 69393.
✅ Use speaking names for existing commands
5. Create speaking names for the following commands:
--version
--help
v, vv, vvv, vvvv
Make it possible to be backwards compatible, i.e. do not deprecate the existing solution.
Consider implementation alongside 2. Use argument parser
.
⚠ ️ Add logger
6. Either add a logger or use the half implemented one.
Problems and considerations:
- Is it supported on Debug mode only?
- Specify an output for all cases (Debug, Release, etc.)
- File
Terminal
Current situation: log console messages and other outputs in existing logger. Considerations above still need to be addressed.
⬆ ️ Update VECTO Console documentation
7. Consider using tool for auto-generating the help or man page. Either entire documentation or part of it.
Considerations:
- Find speaking name for -1Hz.
- Find out reason for
-act
command. Done✅ - Do we want to re-introduce/re-support
-act
command? No⛔