https://github.com/duesee/wizard
A patch for a bad interface
https://github.com/duesee/wizard
Last synced: about 2 months ago
JSON representation
A patch for a bad interface
- Host: GitHub
- URL: https://github.com/duesee/wizard
- Owner: duesee
- Created: 2023-11-02T15:06:48.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-04T00:31:44.000Z (over 1 year ago)
- Last Synced: 2023-11-04T01:37:58.839Z (over 1 year ago)
- Language: Rust
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Wizard
The following code ...
```rust
/// Config
#[derive(Debug, WizardDerive)]
struct Config {
/// Name
name: String,
/// IPv4
ipv4: std::net::Ipv4Addr,
/// Port
port: u16,
/// Transport Encryption
encryption: Encryption,
}/// Encryption
#[derive(Debug, WizardDerive)]
enum Encryption {
/// No encryption (insecure)
Insecure,
/// TLS encryption
Tls,
}fn main() {
let config: Config = Wizard::prompt("Config");println!("\nThanks! Here is your value: {config:?}");
}
```... provides this terminal interaction ...
[](https://asciinema.org/a/e2jzYWC3FY0NC5z504iwveTV4)