Skip to content

Latest commit

 

History

History
46 lines (40 loc) · 1.05 KB

README.md

File metadata and controls

46 lines (40 loc) · 1.05 KB

vin

A Simple Command Line Interface for V

demo.webm

Installation

v install --git https://github.com/DeoDorqnt387/vin

Example Usage

import vin { display_question, Question }

fn main() {
    questions := [
        Question{
            type: "list",
            prompt: "What is your favorite programming lang?",
            choices: ["VLang", "GoLang", "Ruby", "Rust", "Python"]
        },
        Question{
            type: "input",
            prompt: "Which game do you like the most?",
        },
        Question{
            type: "confirm",
            prompt: "Confirm?",
        },
        Question{
            type: "password",
            prompt: "Your password!",
        },
    ]
    
    for q in questions {
        answer := display_question(q) or { panic(err) return }
        println("You selected ${answer}")
    }
}