Marcus is a library for writing interactive CLIs in Elixir.
Marcus provides helpers for:
- enabling ANSI colors,
- printing ANSI-formatted information,
- printing notices in bright blue,
- printing success messages in brigh green,
- printing information in green,
- printing errors (in bright red, on
stderr
) - halting the VM with an error message and status.
You can also prompt the user for:
- a string,
- an integer,
- a yes/no question,
- a choice from a list.
import Marcus
prompt_string("Name")
# Name: Jean-Philippe
# => "Jean-Philippe"
prompt_integer("Integer")
# Integer: 8
# => 8
yes?("Do you want?")
# Do you want? (y/n) y
# => true
choose("Make a choice:", item1: "Item 1", item2: "Item 2")
# Make a choice:
#
# 1. Item 1
# 2. Item 2
#
# Choice: 2
# => :item2
To use Marcus in your project, add this to your Mix dependencies:
{:marcus, "~> 0.1.2"}
Before contributing to this project, please read the CONTRIBUTING.md.
Copyright © 2018-2019 Jean-Philippe Cugnet
This project is licensed under the MIT license.