console-rs / dialoguer

Rust utility library for nice command line prompts and similar things
MIT License
1.33k stars 142 forks source link

Save and restore a wizard flow #311

Open soywod opened 7 months ago

soywod commented 7 months ago

I have a tool called Himalaya, a CLI to manage emails. The configuration is based on a TOML file. Recently I introduce a wizard module, based on you great lib, that help new users to create their own TOML configuration file. So far so good, except that it takes a while to set up an account. If a user exits the wizard flow (either by accident, or if he did a mistake in the form), he needs to start all over again. And the Himalaya wizard flow is quite long. So I try to find a way to be able to save and restore a wizard.

I have an idea on how to implement it, but I wanted to know first if you would be interested in such PR? Not sure if it is part of the dialoguer lib, or if it should be another lib.

soywod commented 7 months ago

Another small first task could be to be able to navigate between prompts. For example to going backward in case of mistake.