1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! A full-screen interactive shell for command-line apps.
//!
//! Output fills the top of the terminal and an input box stays pinned to
//! the bottom: `/` opens a menu of commands and their flags, a status bar
//! shows what's running and any notices, and `/help` and `/settings` open
//! panels in place of the input box. Commands run on a worker thread and
//! print through [`out`], so they work the same from the command line.
//!
//! ```no_run
//! use abalone::{App, CommandInfo, Ctx, NoPanel, Shell, outln};
//!
//! struct Hello;
//!
//! impl App for Hello {
//! type Msg = ();
//! type Panel = NoPanel;
//!
//! fn commands(&self) -> Vec<CommandInfo> {
//! vec![CommandInfo::new("greet", "Say hello").flag("--name", "Who to greet", Some("NAME"))]
//! }
//!
//! fn run(&mut self, line: &str, ctx: &mut Ctx<Self>) {
//! let line = line.to_owned();
//! ctx.start("Greeting", move || outln!("Hello! You said {line}"));
//! }
//! }
//!
//! Shell::new(Hello).title("Hello").run().unwrap();
//! ```
//!
//! Every part can be swapped or extended:
//!
//! - colours: [`Theme`] (or a TOML file, with the `theme-file` feature);
//! - the logo: [`Logo`], with [`TextLogo`], [`PixelLogo`] and [`half_blocks`] to build one;
//! - the spinner: [`Spinner`], or any `Fn(Duration) -> (Style, String)`;
//! - the header, menu, input box, status bar and footer: [`skin::Skin`];
//! - help: [`Help`] tabs of text, the commands, or rows of your own;
//! - settings: [`SimpleSettings`], or [`SettingsModel`] for settings that lead to one another;
//! - panels of your own: [`Panel`], built from [`widgets`];
//! - full screen or in the terminal's own scrollback: [`Tui`], or `/tui`;
//! - `/release-notes` from the app's changelog: [`Shell::release_notes`].
//!
//! Around the shell, for any command-line app:
//!
//! - [`log`]: a log file per run, for bug reports, and [`log::guard`] for `main`;
//! - [`files`] (`files` feature): the data folder and settings in a TOML file;
//! - [`install`] and [`update`] (`install`, `update` features): installing
//! itself and updating from GitHub releases, with the install scripts and
//! release workflow ([`release`]).
//!
//! It runs on Windows, macOS and Linux.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
/// Keys, for panels.
pub use ;
/// The colour type rows are drawn with.
pub use Color;