Expand description
Interactive prompt, used when hashiverse-cli is run without a command.
Each line is split into words (see split_repl_words) and is either a REPL-only command (help, quit/exit,
login <client_id_hex>) or one of the regular Commands, parsed by the same clap
definitions as the one-shot CLI. The identity and network connection persist across lines,
so repeating user X / hashtag Y walks further back in that timeline.
The loop is generic over ReplSession so it can be tested without a network.
Structs§
Enums§
Traits§
- Repl
Session - The state the REPL drives: the current identity and how to run commands against it.
Functions§
- format_
prompt - help_
text - The list shown by
help, built from the clap definitions so it never drifts from them. - parse_
repl_ line - Parses one line.
Errcarries a message ready to show the user (including clap’s usage text, or a command’s--helpoutput). - run_
repl - Runs the prompt loop until
quit/exitor end of input. Command output goes tooutput, errors toerror_output; a failing line never ends the loop. In a--jsonsession (session_json) prompts, help and login status also go toerror_output, keepingoutputJSON-only. A per-line--jsononly changes that command’s output. - split_
repl_ words - Splits a line into words, shell-style: whitespace separates words,
"..."and'...'group them, and a backslash escapes the next character (outside single quotes). Unlike a real shell there is no comment syntax, so#hashtagis an ordinary word.