README.md in cliprompt-0.0.2 vs README.md in cliprompt-0.0.3
- old
+ new
@@ -5,17 +5,17 @@
[![Build Status](https://travis-ci.org/mose/cliprompt.png?branch=master)](https://travis-ci.org/mose/cliprompt)
[![Coverage Status](https://coveralls.io/repos/mose/cliprompt/badge.png?branch=master)](https://coveralls.io/r/mose/cliprompt?branch=master)
[![Dependency Status](https://gemnasium.com/mose/cliprompt.svg)](https://gemnasium.com/mose/cliprompt)
[![Code Climate](https://codeclimate.com/github/mose/cliprompt.png)](https://codeclimate.com/github/mose/cliprompt)
-This library provides a simple DSL for managing user interaction in a CLI application. Still under development, not stable yet.
+This library provides a simple DSL for managing user interaction in a CLI application. Still under development, not stable yet. Check the [Changelog](https://github.com/mose/cliprompt/blob/master/CHANGELOG.md) to see what is in already.
Features
----------
- manages questions, choices, default values, yes/no values (done)
-- makes possible to have env vars set for defaults (todo)
+- makes possible to have env vars set for defaults (done)
Usage
----------
# add in your Gemfile
@@ -31,9 +31,12 @@
def initialize
@url = ask "What is the url of Myclass?"
@ssl = ask "Is it using SSL?", 'y/N'
@age = ask "What is the age of the captain?", [22,33,=44,55]
+ # if you set set ENV['SOMEVAR'], it will override the answer and won't display the question
+ # in such case you still can use normal options and nev var will be validated against it (for boolean or choices setup)
+ @age = guess 'SOMEVAR', "What is the age of the captain?", [22,33,=44,55]
end
end
```
Check [example.rb](https://github.com/mose/cliprompt/blob/master/example.rb) for various possible combinations, or run `rspec -f d` after all that's also what tests are for.