Giter VIP home page Giter VIP logo

read_input's Introduction

Read Input

A simple CLI tool that asks for user input until the data inputted is valid.

License Latest version Latest Docs downloads-badge

Why you need it

When writing command line tools you will often need to take input from the user. If the user inputs invalid information the program needs to ask them again. Having to make this loop distracts from the useful logic in your program.

read_input attempts to make it easy to get input from the user without having to think about converting types.

How to get started.

Everything is covered on our documentation page. Latest Docs

Docs

API Documentation

read_input's People

Contributors

eopb avatar jbtrystram avatar jimmiebfulton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

read_input's Issues

newline in the err() method

Copied from https://gitlab.com/efunb/read_input/-/issues/5

It seems that the err() method automatically append a newline character at the end. Is it possible to not add this newline and let the user add it if necessary? I have the following code:

    let input = input::<u8>()
        .msg("What's your age: ")
        .err("That's not correct, try again: ").get();

The user input for msg() is at the same line with What's your age: . I want the user's next try is also at the same line with That's not correct, try again:. That will make the UI a little bit more clean. Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.