Crate conciliator
source · [−]Expand description
WIP library for writing interactive CLI programs.
Currently very unstable with a somewhat unusual API.
Subject to major changes as I use it and implement missing functionality.
Intended to implement the things that the Python click library provides which are missing from clap.
Using that basis, provide useful abstractions for interacting with the CLI.
Scope:
- Pretty
status,info,warnanderrormessages - Convenient traits and methods for printing color escape codes when available
- Print lists and trees
- Simplify dealing with terminal colors using “color palettes”
- Request and validate user input
- Launch
$EDITORto edit plain text and typed data - (TODO) Animated spinners (using
tokioforasyncprojects andstd::threadotherwise)
Out of scope:
- Non-UNIX platforms
- Config file handling
- Argument parsing (intended to be used alongside
clap) - Progress bars (for now)
curses-style text user interface (TUI) painting to the terminal as a canvas
Initially, this library was written as an extension of termcolor, but now the functionality that was required has been absorbed / copied / rewritten. As such, some of the ideas and design are taken from there and credit is due.
Re-exports
pub use crate::core::Buffer;pub use crate::core::Line;pub use crate::core::Stream;pub use crate::core::GetLine;pub use input::Input;pub use print::Print;pub use style::Paint;pub use style::Palette;pub use style::Color;pub use style::Tags;Modules
Core functionality: dealing with buffers of colored terminal output
Edit text using $EDITOR
User input
Writing colored text to the terminal
Macros
Implement Editable for a type T: Serialize + DeserializeOwned
Structs
The main Conciliator implementor
List of things to print, with a short description
Tree structure of things to print, recursively traversed
Enums
Traits
Convenient methods for printing user-facing messages
Functions
Initialize the main Conciliator implementor, Claw