Multi-word command #1284
-
I'm considering using spectre.console for my pdp/8 emulator. That is, presenting a prompt and having the user enter commands. What I'm after is for instance:
In the first example "boot" is a valid command and "rx0" is a device (that can be validated). In the second "d" or "deposit" (with tab completion) takes one or two integer arguments. Those have to be in an acceptable range, but that can be solved. I would like to validate the command and parse additional parameters as well. Come to think of it, in example #1, it would be nice if both "boot" and "rx0" could support completion. Is this possible using Spectre? I've browsed through the demos, but not found an answer. It seems to be a great library and I especially like the ability to present live data in an structured way (e.g. tables). I know I can, but don't want to, parse e.g. "deposit" and then ask "what address?" followed by "which value?". |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Am I right in saying that you try to build a REPL style application? If so, maybe you can take a look at the RadLine project: https://github.com/spectreconsole/radline |
Beta Was this translation helpful? Give feedback.
Am I right in saying that you try to build a REPL style application?
If so, maybe you can take a look at the RadLine project: https://github.com/spectreconsole/radline