colloquy: branch on widget type

pull/433/head
nick black 4 years ago
parent a64119931a
commit ddf206462b
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -10,4 +10,8 @@ homepage = "https://nick-black.com/dankwiki/index.php/Notcurses"
[dependencies]
notcurses = ">= 1.2.3"
clap = {version = ">= 2.33.0", features = ["yaml", "color", "suggestions"]}
[dependencies.clap]
version = ">= 2.33.0"
default-features = false
features = ["yaml", "color", "suggestions"]

@ -1,17 +1,17 @@
name: colloquy
version: "0.1.0"
about: Attractive UI widgets from the shell
about: Attractive Notcurses UI widgets from the shell
author: Nick Black <dankamongmen@gmail.com>
args:
- verbose:
long: verbose
short: v
help: Verbose mode
- file:
long: file
short: f
help: Read configuration options from this file
takes_value: true
# - file:
# long: file
# short: f
# help: Read configuration options from this file
# takes_value: true
- title:
long: title
short: t
@ -19,15 +19,13 @@ args:
- msgbox:
long: msgbox
help: Display arbitrary text with a single button to accept it
requires: text
- text:
help: The contents of the widget
required: true
index: 1
- height:
help: The height of the widget, 0 for screen height
required: true
index: 2
- width:
help: The width of the widget, 0 for screen width
required: true
index: 3

@ -2,4 +2,10 @@ fn main() {
use clap::{load_yaml, App};
let yaml = load_yaml!("cli.yml");
let matches = App::from_yaml(yaml).get_matches();
if matches.is_present("msgbox") {
// do a messagebox
}else{
eprintln!("Needed a widget type");
std::process::exit(1);
}
}

Loading…
Cancel
Save