├── .gitignore ├── .projectile ├── assets ├── preview.png └── preview.xcf ├── examples ├── launcher.sh ├── keybinds.toml ├── menu.toml └── theme.toml ├── config ├── keybinds.default.toml └── theme.default.toml ├── Cargo.toml ├── src ├── macros.rs ├── args.rs ├── state.rs ├── config.rs ├── util.rs ├── theme.rs ├── main.rs ├── draw.rs └── keybinds.rs ├── README.md ├── COPYING └── Cargo.lock /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /.projectile: -------------------------------------------------------------------------------- 1 | -.git 2 | -------------------------------------------------------------------------------- /assets/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fr33zing/fr33zmenu/HEAD/assets/preview.png -------------------------------------------------------------------------------- /assets/preview.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fr33zing/fr33zmenu/HEAD/assets/preview.xcf -------------------------------------------------------------------------------- /examples/launcher.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | fr33zmenu ~/.config/fr33zmenu/menu.toml \ 4 | --exec-with "nohup hyprctl dispatch exec" \ 5 | --transient 6 | -------------------------------------------------------------------------------- /examples/keybinds.toml: -------------------------------------------------------------------------------- 1 | [keybinds] 2 | exit = [ "escape", "ctrl+c" ] 3 | submit = [ "enter" ] 4 | clear = [ "shift+del", "ctrl+del" ] 5 | delete_next = [ "delete" ] 6 | delete_back = [ "backspace" ] 7 | input_next = [ "right" ] 8 | input_back = [ "left" ] 9 | entry_next = [ "down", "ctrl+down", "ctrl+j", "tab" ] 10 | entry_back = [ "up", "ctrl+up", "ctrl+k", "shift+tab" ] 11 | menu_next = [ "ctrl+right", "ctrl+l" ] 12 | menu_back = [ "ctrl+left", "ctrl+h" ] 13 | -------------------------------------------------------------------------------- /config/keybinds.default.toml: -------------------------------------------------------------------------------- 1 | [keybinds] 2 | exit = [ "escape", "ctrl+c" ] 3 | submit = [ "enter" ] 4 | clear = [ "shift+del", "ctrl+del" ] 5 | delete_next = [ "delete" ] 6 | delete_back = [ "backspace" ] 7 | input_next = [ "right" ] 8 | input_back = [ "left" ] 9 | entry_next = [ "down", "ctrl+down", "ctrl+j", "tab" ] 10 | entry_back = [ "up", "ctrl+up", "ctrl+k", "shift+tab" ] 11 | menu_next = [ "ctrl+right", "ctrl+l" ] 12 | menu_back = [ "ctrl+left", "ctrl+h" ] 13 | -------------------------------------------------------------------------------- /examples/menu.toml: -------------------------------------------------------------------------------- 1 | [menus.programs] # Define a new menu named "programs" 2 | order = -1 # Ensure it is the first menu 3 | prompt = "launch -> " # Give it a cool prompt 4 | 5 | [menus.programs.entries] # Define the menu's entries 6 | # ↓ Name ↓ Value 7 | emacs = "emacsclient -c -a emacs" 8 | librewolf = "librewolf --browser" 9 | strawberry = "strawberry" 10 | gimp = "gimp --new-instance" 11 | gajim = "gajim --show" 12 | 13 | [menus.power] # Another menu 14 | prompt = "power -> " 15 | 16 | [menus.power.entries] 17 | shutdown = "shutdown now" 18 | reboot = "reboot" 19 | -------------------------------------------------------------------------------- /examples/theme.toml: -------------------------------------------------------------------------------- 1 | [theme] 2 | prompt = { fg = "#a6e3a1", attrs = "bold" } 3 | input = { fg = "#cdd6f4" } 4 | entry_name = { fg = "#cdd6f4" } 5 | entry_value = { fg = "#6c7086" } 6 | entry_match = { fg = "#74c7ec", attrs = "bold" } 7 | entry_hidden = { fg = "#45475a" } 8 | entry_cursor = { fg = "#1e1e2e", bg = "#cdd6f4", attrs = "bold" } 9 | entry_cursor_match = { fg = "#1e1e2e", bg = "#74c7ec", attrs = "bold" } 10 | menu_name = { fg = "#f38ba8" } 11 | menu_cursor = { fg = "#1e1e2e", bg = "#f38ba8", attrs = "bold" } 12 | overflow = { fg = "#f9e2af", attrs = "bold" } 13 | -------------------------------------------------------------------------------- /config/theme.default.toml: -------------------------------------------------------------------------------- 1 | [theme] 2 | prompt = { fg = "#a6e3a1", attrs = "bold" } 3 | input = { fg = "#cdd6f4" } 4 | entry_name = { fg = "#cdd6f4" } 5 | entry_value = { fg = "#6c7086" } 6 | entry_match = { fg = "#74c7ec", attrs = "bold" } 7 | entry_hidden = { fg = "#45475a" } 8 | entry_cursor = { fg = "#1e1e2e", bg = "#cdd6f4", attrs = "bold" } 9 | entry_cursor_match = { fg = "#1e1e2e", bg = "#74c7ec", attrs = "bold" } 10 | menu_name = { fg = "#f38ba8" } 11 | menu_cursor = { fg = "#1e1e2e", bg = "#f38ba8", attrs = "bold" } 12 | overflow = { fg = "#f9e2af", attrs = "bold" } 13 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fr33zmenu" 3 | description = "A multi-page fuzzy launcher for your terminal." 4 | repository = "https://github.com/fr33zing/fr33zmenu" 5 | authors = ["fr33zing"] 6 | license = "GPL-3.0-or-later" 7 | edition = "2021" 8 | version = "0.1.5" 9 | 10 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 11 | 12 | [dependencies] 13 | anyhow = "1.0.66" 14 | clap = { version = "4.0.27", features = ["derive"] } 15 | config = "0.13.2" 16 | crossterm = "0.25.0" 17 | csscolorparser = "0.6.2" 18 | fuzzy-matcher = "0.3.7" 19 | serde = { version = "1.0.148", features = ["derive"] } 20 | serde_with = "2.1.0" 21 | -------------------------------------------------------------------------------- /src/macros.rs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later 2 | 3 | #[macro_export] 4 | macro_rules! set_style { 5 | ($style:expr) => { 6 | crossterm::style::SetStyle(crossterm::style::ContentStyle { 7 | foreground_color: Some($style.fg.0), 8 | background_color: Some($style.bg.0), 9 | underline_color: None, 10 | attributes: $style.attrs.0, 11 | }) 12 | }; 13 | } 14 | 15 | #[macro_export] 16 | macro_rules! handle_key_event { 17 | ( $self:ident, $event:ident, $state:ident, [$( $bind:ident ),+] ) => { 18 | 'x: { 19 | $( 20 | if $self.$bind.iter().any(|kb| kb.matches($event)) { 21 | break 'x (true, Keybinds::$bind($state)); 22 | } 23 | )* 24 | (false, Ok($state)) 25 | } 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /src/args.rs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later 2 | //! Command line arguments. 3 | 4 | use std::path::PathBuf; 5 | 6 | use clap::{ArgGroup, Parser}; 7 | 8 | #[derive(Parser, Debug)] 9 | #[command(author, version, about, long_about = None)] 10 | #[clap(group( 11 | ArgGroup::new("execute") 12 | .required(false) 13 | .args(&["exec", "exec_with"]), 14 | ))] 15 | pub(crate) struct Args { 16 | /// Configuration file path. 17 | pub(crate) config: PathBuf, 18 | 19 | /// Execute the selection. 20 | #[arg(short = 'x', long)] 21 | pub(crate) exec: bool, 22 | 23 | /// Execute the selection with the provided command. 24 | #[arg(short = 'w', long, value_name = "CMD")] 25 | pub(crate) exec_with: Option, 26 | 27 | /// Exit the program if focus is lost. 28 | #[arg(short, long)] 29 | pub(crate) transient: bool, 30 | } 31 | -------------------------------------------------------------------------------- /src/state.rs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later 2 | 3 | /// Indicates the next action the program should take. 4 | #[derive(Debug, Clone, PartialEq, Eq)] 5 | pub(crate) enum Action { 6 | /// Indicates that the program should continue. 7 | None, 8 | 9 | /// Indicates that the program should exit without submitting. 10 | Exit, 11 | 12 | /// Indicates that the screen should be cleared. 13 | Clear, 14 | 15 | /// Indicates that the program should submit the selected entry and exit. 16 | Submit, 17 | } 18 | 19 | impl Default for Action { 20 | fn default() -> Self { 21 | Action::None 22 | } 23 | } 24 | 25 | #[derive(Debug, Default, Clone, PartialEq, Eq)] 26 | pub(crate) struct State { 27 | /// The user's query. 28 | pub(crate) input: String, 29 | 30 | /// Indicates the next action the program should take. 31 | pub(crate) action: Action, 32 | 33 | /// Position of the input cursor, offset from the left. 34 | pub(crate) cursor_x: u16, 35 | 36 | /// Indicates that the entry cursor is visible. 37 | pub(crate) entry_cursor: bool, 38 | 39 | /// The number of selectable entries in the current menu. 40 | pub(crate) entry_count: usize, 41 | 42 | /// Index of the selected entry. 43 | pub(crate) entry_index: usize, 44 | 45 | /// The number of menus in the config. 46 | pub(crate) menu_count: usize, 47 | 48 | /// Index of the current menu. 49 | pub(crate) menu_index: usize, 50 | } 51 | -------------------------------------------------------------------------------- /src/config.rs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later 2 | //! Loads and globs configuration files. 3 | 4 | use std::{collections::HashMap, path::PathBuf}; 5 | 6 | use anyhow::{Context, Result}; 7 | 8 | use serde::Deserialize; 9 | use serde_with::serde_as; 10 | 11 | use crate::{keybinds::Keybinds, theme::Theme}; 12 | 13 | static DEFAULT_THEME: &'static str = include_str!("../config/theme.default.toml"); 14 | static DEFAULT_KEYBINDS: &'static str = include_str!("../config/keybinds.default.toml"); 15 | 16 | /// A menu page. 17 | #[serde_as] 18 | #[derive(Debug, Deserialize, PartialEq, Eq)] 19 | pub(crate) struct Menu { 20 | /// The sorting order. 21 | #[serde(default)] 22 | pub(crate) order: i64, 23 | 24 | /// The input prompt. 25 | pub(crate) prompt: String, 26 | 27 | /// The menu's entries. The key is used as the entry name. 28 | #[serde_as(as = "HashMap<_, _>")] 29 | pub(crate) entries: Vec<(String, String)>, 30 | } 31 | 32 | /// A configuration file. 33 | #[serde_as] 34 | #[derive(Debug, Deserialize)] 35 | pub(crate) struct Config { 36 | /// A collection of styles to be used in the interface. 37 | pub(crate) theme: Theme, 38 | 39 | /// Pages of entries. The key is used as the menu name. 40 | #[serde_as(as = "HashMap<_, _>")] 41 | pub(crate) menus: Vec<(String, Menu)>, 42 | 43 | /// Keybinds used to interact with the interface. 44 | pub(crate) keybinds: Keybinds, 45 | } 46 | 47 | /// Loads the provided config file, and combines it with the defaults. 48 | pub(crate) fn load_config(file: PathBuf) -> Result { 49 | let builder = config::Config::builder() 50 | .add_source(config::File::from_str( 51 | DEFAULT_THEME, 52 | config::FileFormat::Toml, 53 | )) 54 | .add_source(config::File::from_str( 55 | DEFAULT_KEYBINDS, 56 | config::FileFormat::Toml, 57 | )) 58 | .add_source(config::File::from(file.clone())); 59 | let config = builder 60 | .build() 61 | .context("Failed to read config sources")? 62 | .try_deserialize::() 63 | .context("Failed to deserialize config")?; 64 | Ok(config) 65 | } 66 | -------------------------------------------------------------------------------- /src/util.rs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later 2 | //! Utility functions. 3 | 4 | use std::{fs, io}; 5 | 6 | use crossterm::terminal; 7 | use fuzzy_matcher::clangd::fuzzy_indices; 8 | 9 | use crate::{config::Config, state::State}; 10 | 11 | pub(crate) fn tty() -> io::Result { 12 | fs::OpenOptions::new() 13 | .read(false) 14 | .write(true) 15 | .open("/dev/tty") 16 | } 17 | 18 | pub(crate) fn sort_menus(config: &mut Config) { 19 | config.menus.sort_by(|a, b| { 20 | if a.1.order == b.1.order { 21 | a.0.to_lowercase().cmp(&b.0.to_lowercase()) 22 | } else { 23 | a.1.order.cmp(&b.1.order) 24 | } 25 | }); 26 | } 27 | 28 | pub(crate) fn match_entries( 29 | input: &str, 30 | entries: &Vec<(String, String)>, 31 | ) -> Vec<(Option<(i64, Vec)>, String, String)> { 32 | let mut entries_sorted: Vec<(Option<(i64, Vec)>, String, String)> = entries 33 | .iter() 34 | .map(|entry| { 35 | ( 36 | fuzzy_indices(&entry.0, input), 37 | entry.0.clone(), 38 | entry.1.clone(), 39 | ) 40 | }) 41 | .collect(); 42 | 43 | if input.is_empty() { 44 | entries_sorted.sort_by(|a, b| a.1.to_lowercase().cmp(&b.1.to_lowercase())); 45 | } else { 46 | entries_sorted.sort_by(|a, b| { 47 | if a.0.is_none() && b.0.is_none() { 48 | a.1.to_lowercase().cmp(&b.1.to_lowercase()) 49 | } else { 50 | b.0.cmp(&a.0) 51 | } 52 | }); 53 | } 54 | 55 | entries_sorted 56 | } 57 | 58 | pub(crate) fn count_selectable_entries( 59 | state: &State, 60 | entries: &Vec<(Option<(i64, Vec)>, String, String)>, 61 | ) -> usize { 62 | let h: usize = match terminal::size() { 63 | Ok(size) => size.1.into(), 64 | Err(_) => return 0, 65 | }; 66 | 67 | let count = if state.input.is_empty() { 68 | entries.len() 69 | } else { 70 | entries 71 | .iter() 72 | .filter_map(|e| match &e.0 { 73 | Some(e) => Some(e), 74 | None => None, 75 | }) 76 | .count() 77 | }; 78 | 79 | usize::min(count, h.saturating_sub(5)) 80 | } 81 | -------------------------------------------------------------------------------- /src/theme.rs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later 2 | //! Theme configuration. 3 | //! 4 | //! See [Theme] to view the accepted fields in a theme configuration. 5 | 6 | use std::fmt; 7 | 8 | use crossterm::style::Attribute; 9 | use serde::{ 10 | de::{self, Unexpected, Visitor}, 11 | Deserialize, Deserializer, 12 | }; 13 | 14 | /// Used to deserialize any valid CSS color format into a crossterm color. 15 | #[derive(Debug)] 16 | pub(crate) struct ThemeColor(pub(crate) crossterm::style::Color); 17 | 18 | impl Default for ThemeColor { 19 | fn default() -> Self { 20 | Self(crossterm::style::Color::Reset) 21 | } 22 | } 23 | 24 | impl<'de> Deserialize<'de> for ThemeColor { 25 | fn deserialize(deserializer: D) -> Result 26 | where 27 | D: Deserializer<'de>, 28 | { 29 | struct ThemeColorVisitor; 30 | 31 | impl<'de> Visitor<'de> for ThemeColorVisitor { 32 | type Value = ThemeColor; 33 | 34 | fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { 35 | formatter.write_str("a valid CSS color") 36 | } 37 | 38 | fn visit_str(self, s: &str) -> Result 39 | where 40 | E: de::Error, 41 | { 42 | let css_color = csscolorparser::parse(s) 43 | .map_err(|_| de::Error::invalid_value(Unexpected::Str(s), &self))?; 44 | let crossterm_color = crossterm::style::Color::Rgb { 45 | r: (css_color.r * 255.0) as u8, 46 | g: (css_color.g * 255.0) as u8, 47 | b: (css_color.b * 255.0) as u8, 48 | }; 49 | Ok(ThemeColor(crossterm_color)) 50 | } 51 | } 52 | deserializer.deserialize_str(ThemeColorVisitor) 53 | } 54 | } 55 | 56 | /// Used to deserialize a comma seperated list of text attributes. 57 | #[derive(Debug, Default)] 58 | pub(crate) struct ThemeAttributes(pub(crate) crossterm::style::Attributes); 59 | 60 | impl<'de> Deserialize<'de> for ThemeAttributes { 61 | fn deserialize(deserializer: D) -> Result 62 | where 63 | D: Deserializer<'de>, 64 | { 65 | struct ThemeAttributesVisitor; 66 | 67 | impl<'de> Visitor<'de> for ThemeAttributesVisitor { 68 | type Value = ThemeAttributes; 69 | 70 | fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { 71 | formatter.write_str("a comma-separated list of attributes") 72 | } 73 | 74 | fn visit_str(self, s: &str) -> Result 75 | where 76 | E: de::Error, 77 | { 78 | let attrs_vec: Vec = s 79 | .split(',') 80 | .map(|a| match a.trim() { 81 | "bold" => Ok(Attribute::Bold), 82 | "dim" => Ok(Attribute::Dim), 83 | "italic" => Ok(Attribute::Italic), 84 | "underlined" => Ok(Attribute::Underlined), 85 | "hidden" => Ok(Attribute::Hidden), 86 | _ => Err(de::Error::custom(format!( 87 | "invalid attribute '{}'", 88 | a.trim() 89 | ))), 90 | }) 91 | .collect::>()?; 92 | let attrs = crossterm::style::Attributes::from(attrs_vec.as_slice()); 93 | Ok(ThemeAttributes(attrs)) 94 | } 95 | } 96 | deserializer.deserialize_str(ThemeAttributesVisitor) 97 | } 98 | } 99 | 100 | /// A text style. 101 | #[derive(Debug, Deserialize, Default)] 102 | pub(crate) struct ThemeStyle { 103 | /// Foreground color. 104 | #[serde(default)] 105 | pub(crate) fg: ThemeColor, 106 | 107 | /// Background color. 108 | #[serde(default)] 109 | pub(crate) bg: ThemeColor, 110 | 111 | /// Text attributes. 112 | #[serde(default)] 113 | pub(crate) attrs: ThemeAttributes, 114 | } 115 | 116 | /// A collection of styles to be used in the interface. 117 | #[derive(Debug, Deserialize)] 118 | pub(crate) struct Theme { 119 | /// Style for text overflow indicators. 120 | pub(crate) overflow: ThemeStyle, 121 | 122 | /// Style for the prompt. 123 | pub(crate) prompt: ThemeStyle, 124 | 125 | /// Style for the user's input. 126 | pub(crate) input: ThemeStyle, 127 | 128 | /// Style for the name (left side) of a menu entry. 129 | pub(crate) entry_name: ThemeStyle, 130 | 131 | /// Style for the value (right side) of a menu entry. 132 | pub(crate) entry_value: ThemeStyle, 133 | 134 | /// Style for letters that match the user's input. 135 | pub(crate) entry_match: ThemeStyle, 136 | 137 | /// Style for entries that do not match the user's input. 138 | pub(crate) entry_hidden: ThemeStyle, 139 | 140 | /// Style for the selected entry. 141 | pub(crate) entry_cursor: ThemeStyle, 142 | 143 | /// Style for letters that match the user's input in the selected entry. 144 | pub(crate) entry_cursor_match: ThemeStyle, 145 | 146 | /// Style for menu names (i.e. tabs) that are not selected. 147 | pub(crate) menu_name: ThemeStyle, 148 | 149 | /// Style for the selected menu name. 150 | pub(crate) menu_cursor: ThemeStyle, 151 | } 152 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later 2 | //! A multi-page fuzzy launcher for your terminal. 3 | 4 | use std::{ 5 | io::{self, stderr, stdout, Write}, 6 | process::{self, Command, Stdio}, 7 | time::Duration, 8 | }; 9 | 10 | use anyhow::{anyhow, Result}; 11 | use args::Args; 12 | use clap::Parser; 13 | use crossterm::{ 14 | cursor::{MoveTo, SavePosition}, 15 | event::{poll, read, DisableFocusChange, EnableFocusChange, Event}, 16 | execute, 17 | style::Print, 18 | terminal::{disable_raw_mode, enable_raw_mode, Clear, ClearType}, 19 | }; 20 | 21 | mod args; 22 | mod config; 23 | mod draw; 24 | mod keybinds; 25 | mod macros; 26 | mod state; 27 | mod theme; 28 | mod util; 29 | 30 | use crate::{ 31 | draw::draw, 32 | state::{Action, State}, 33 | }; 34 | 35 | fn main() { 36 | let res: Result<()> = (|| { 37 | let mut tty = util::tty()?; 38 | let args = args::Args::parse(); 39 | let mut config = config::load_config(args.config.clone())?; 40 | util::sort_menus(&mut config); 41 | execute!(tty, Clear(ClearType::All), EnableFocusChange)?; 42 | enable_raw_mode()?; 43 | let selection = interact(&mut tty, &args, &mut config)?; 44 | disable_raw_mode()?; 45 | submit(&mut tty, &args, selection)?; 46 | execute!(tty, Clear(ClearType::All), MoveTo(0, 0), DisableFocusChange)?; 47 | Ok(()) 48 | })(); 49 | 50 | match res { 51 | Ok(_) => process::exit(0), 52 | Err(e) => { 53 | let _ = writeln!(stderr(), "{e:?}"); 54 | process::exit(1); 55 | } 56 | } 57 | } 58 | 59 | /// Handles event polling, state management, and drawing the interface. 60 | fn interact(tty: &mut impl io::Write, args: &Args, config: &mut config::Config) -> Result { 61 | let mut first = true; 62 | let mut state = State::default(); 63 | state.menu_count = config.menus.len().try_into()?; 64 | 65 | loop { 66 | let last_state = state.clone(); 67 | let mut force_redraw = false; 68 | 69 | // Handle events 70 | if !first { 71 | if !poll(Duration::from_millis(100))? { 72 | continue; 73 | } 74 | 75 | match read()? { 76 | Event::Resize(_, _) => { 77 | force_redraw = true; 78 | } 79 | Event::FocusLost => { 80 | if args.transient { 81 | break; 82 | } 83 | } 84 | Event::Key(event) => { 85 | execute!(tty, SavePosition)?; 86 | state = config.keybinds.handle(event, state)?; 87 | } 88 | _ => {} 89 | } 90 | } 91 | 92 | // Update + draw 93 | if state != last_state || first || force_redraw { 94 | // Update 95 | let menu = config 96 | .menus 97 | .get(state.menu_index) 98 | .ok_or_else(|| anyhow!("invalid menu index"))?; 99 | let entries = util::match_entries(&state.input, &menu.1.entries); 100 | state.entry_count = util::count_selectable_entries(&state, &entries); 101 | 102 | // Handle state action 103 | match state.action { 104 | Action::None => {} 105 | Action::Exit => break, 106 | Action::Clear => { 107 | execute!(tty, Clear(ClearType::All))?; 108 | } 109 | Action::Submit => { 110 | if state.entry_count > 0 { 111 | let selection = entries 112 | .get(state.entry_index) 113 | .ok_or_else(|| anyhow!("selection index out of bounds"))?; 114 | return Ok(selection.2.clone()); 115 | } 116 | } 117 | } 118 | 119 | state.action = Action::Clear; 120 | first = false; 121 | draw(tty, config, &mut state, menu, &entries)?; 122 | tty.flush()?; 123 | } 124 | } 125 | Ok(String::default()) 126 | } 127 | 128 | /// Writes the selected entry's value to stdout, or if `--exec` / `--exec-with` is provided, 129 | /// executes it. 130 | // TODO clean this up 131 | fn submit(tty: &mut impl io::Write, args: &Args, selection: String) -> Result<()> { 132 | execute!(tty, Clear(ClearType::All), MoveTo(0, 0))?; 133 | if args.exec { 134 | // --exec 135 | Command::new("nohup") 136 | .arg(selection) 137 | .stdin(Stdio::null()) 138 | .stdout(Stdio::null()) 139 | .stderr(Stdio::null()) 140 | .spawn()?; 141 | } else if let Some(e) = &args.exec_with { 142 | // --exec-with 143 | let mut split = e.split(" "); 144 | let cmd = split.next().ok_or_else(|| anyhow!("empty exec_with"))?; 145 | let executor_args: Vec<&str> = split.collect(); 146 | Command::new(cmd) 147 | .args(executor_args) 148 | .arg(selection) 149 | .stdin(Stdio::null()) 150 | .stdout(Stdio::null()) 151 | .stderr(Stdio::null()) 152 | .spawn()?; 153 | } else { 154 | execute!(stdout(), Print(&selection), Print('\n'))?; 155 | return Ok(()); 156 | } 157 | 158 | Ok(()) 159 | } 160 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
 
2 |
 
3 |
4 | preview 5 |

fr33zmenu

6 |

A multi-page fuzzy launcher for your terminal, written in Rust.

7 |

Supports theming and multiple keybind schemes, including basic vim keybinds.

8 | Installation 9 |      10 | Usage 11 |      12 | Integration 13 |      14 | Configuration 15 |
16 |
 
17 |
 
18 | 19 | ## Installation 20 | 21 | If you don't have Rust, follow the installation instructions 22 | [here](https://www.rust-lang.org/tools/install). 23 | 24 | Run the following command to install fr33zmenu: 25 | 26 | ``` sh 27 | cargo install fr33zmenu 28 | ``` 29 | 30 | ## Usage 31 | 32 | Run the following command to view help: `fr33zmenu --help` 33 | 34 | If the command isn't found, you will need to add `~/.cargo/bin` to your path. 35 | 36 | ``` sh 37 | echo 'export PATH=$PATH:~/.cargo/bin' >> ~/.bashrc 38 | source ~/.bashrc 39 | ``` 40 | 41 | If you're using zsh, replace `~/.bashrc` with `~/.zshrc`. 42 | 43 | ## Integration 44 | 45 | This guide will demonstrate how to integrate fr33zmenu with your window manager. 46 | You'll need to adapt this to your terminal and window manager (obviously), but 47 | for this guide I'm using [Hyprland](https://hyprland.org/) (wayland compositor) 48 | and [Kitty](https://sw.kovidgoyal.net/kitty/) (terminal). 49 | 50 | ### 1. Create a configuration file 51 | 52 | See the [Configuration](#configuration) section below. I saved mine as 53 | `~/.config/fr33menu/menu.toml`. 54 | 55 | ### 2. Create a script for your window manager to execute 56 | 57 | I saved mine as `~/scripts/launcher`. 58 | 59 | ``` sh 60 | #!/bin/sh 61 | 62 | fr33zmenu ~/.config/fr33zmenu/menu.toml \ 63 | --exec-with "nohup hyprctl dispatch exec" \ 64 | --transient 65 | ``` 66 | 67 | ### 3. Configure window manager / compositor 68 | 69 | Through keybinds and window rules, it's possible to make a terminal window 70 | behave exactly like a graphical launcher. My goal with these settings is to have 71 | the window pop up in the center of the screen at a fixed sized. 72 | 73 | The following configuration was added to my `~/.config/hypr/hyprland.conf`. 74 | 75 | ``` conf 76 | $launcher = kitty --class fr33zmenu ~/scripts/launcher 77 | bind = $mainMod, SPACE, exec, $launcher 78 | 79 | windowrulev2 = float, class:fr33zmenu 80 | windowrulev2 = size 600 400, class:fr33zmenu 81 | windowrulev2 = center, class:fr33zmenu 82 | ``` 83 | 84 | If your terminal doesn't support opening with a provided class, you can use the 85 | title of the window instead. 86 | 87 | # Configuration 88 | 89 | - Supported formats: `toml` `json` `yaml` `ini` `ron` `json5` 90 | 91 | Configuration is supported for theming, keybinds, and menus. There is no preset 92 | config directory, as the path to your config file will be passed as a positional 93 | argument. Even so, you may want to store your config(s) in `~/.config/fr33zmenu` 94 | for the sake of organization. 95 | 96 | Note: All configuration options must reside in the one file passed to the 97 | program. There is no support for providing or importing multiple config files 98 | (yet?) 99 | 100 | ## Menus 101 | 102 | **Required** 103 | 104 | A *menu* defines the interactive content of the program. Each menu is displayed 105 | as a tab on the first line of the interface, and the *entries* of the current 106 | menu are displayed underneath the menu's prompt. 107 | 108 | ### Example 109 | 110 | ``` toml 111 | [menus.programs] # Define a new menu named "programs" 112 | order = -1 # Ensure it is the first menu 113 | prompt = "launch -> " # Give it a cool prompt 114 | 115 | [menus.programs.entries] # Define the menu's entries 116 | # ↓ Name ↓ Value 117 | emacs = "emacsclient -c -a emacs" 118 | librewolf = "librewolf --browser" 119 | strawberry = "strawberry" 120 | gimp = "gimp --new-instance" 121 | gajim = "gajim --show" 122 | 123 | [menus.power] # Another menu 124 | prompt = "power -> " 125 | 126 | [menus.power.entries] 127 | shutdown = "shutdown now" 128 | reboot = "reboot" 129 | ``` 130 | 131 | ## Keybinds 132 | 133 | **Optional** - Defaults will be loaded if this section is absent in your config. 134 | 135 | - Keybinds must include at exactly *one* non-modifier key. 136 | - One command can have many keybinds, but one keybind cannot be bound to 137 | multiple commands. 138 | - Keybinds are case-insensitive. 139 | 140 | **Named keys** 141 | 142 | - Modifier keys 143 | - `shift` 144 | - `control` | `ctrl` 145 | - `alt` 146 | - `backspace` | `back` 147 | - `enter` | `return` | `ret` 148 | - Non-modifier keys 149 | - `left` 150 | - `right` 151 | - `up` 152 | - `down` 153 | - `home` 154 | - `end` 155 | - `pageup` | `pgup` 156 | - `pagedown` | `pgdn` 157 | - `tab` 158 | - `delete` | `del` 159 | - `insert` 160 | - `escape` | `esc` 161 | 162 | 163 | 164 | 165 | ### Example (default keybinds) 166 | 167 | ``` toml 168 | [keybinds] 169 | exit = [ "escape", "ctrl+c" ] 170 | submit = [ "enter" ] 171 | clear = [ "shift+del", "ctrl+del" ] 172 | delete_next = [ "delete" ] 173 | delete_back = [ "backspace" ] 174 | input_next = [ "right" ] 175 | input_back = [ "left" ] 176 | entry_next = [ "down", "ctrl+down", "ctrl+j", "tab" ] 177 | entry_back = [ "up", "ctrl+up", "ctrl+k", "shift+tab" ] 178 | menu_next = [ "ctrl+right", "ctrl+l" ] 179 | menu_back = [ "ctrl+left", "ctrl+h" ] 180 | ``` 181 | 182 | ## Theme 183 | 184 | **Optional** - Defaults will be loaded if this section is absent in your config. 185 | 186 | All text in the interface can be themed. Every value in the theme accepts the 187 | following properties: 188 | 189 | - `fg` - Foreground / text color 190 | - `bg` - Background color 191 | - `attrs` - A comma separated string of text style attributes, e.g. `bold, 192 | italic, underlined` 193 | - `bold` 194 | - `dim` 195 | - `italic` 196 | - `underlined` 197 | - `hidden` 198 | 199 | Any valid CSS color string is accepted, but alpha values will have no effect. 200 | 201 | ### Example (default theme) 202 | 203 | ``` toml 204 | [theme] 205 | prompt = { fg = "#a6e3a1", attrs = "bold" } 206 | input = { fg = "#cdd6f4" } 207 | entry_name = { fg = "#cdd6f4" } 208 | entry_value = { fg = "#6c7086" } 209 | entry_match = { fg = "#74c7ec", attrs = "bold" } 210 | entry_hidden = { fg = "#45475a" } 211 | entry_cursor = { fg = "#1e1e2e", bg = "#cdd6f4", attrs = "bold" } 212 | entry_cursor_match = { fg = "#1e1e2e", bg = "#74c7ec", attrs = "bold" } 213 | menu_name = { fg = "#f38ba8" } 214 | menu_cursor = { fg = "#1e1e2e", bg = "#f38ba8", attrs = "bold" } 215 | overflow = { fg = "#f9e2af", attrs = "bold" } 216 | ``` 217 | 218 | -------------------------------------------------------------------------------- /src/draw.rs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later 2 | //! Draws the interface. 3 | 4 | use anyhow::Context; 5 | use crossterm::{ 6 | cursor::{MoveRight, MoveTo, MoveToColumn, MoveToNextLine, RestorePosition, SavePosition}, 7 | execute, queue, 8 | style::{Print, ResetColor, SetAttributes, SetForegroundColor}, 9 | terminal::{self, Clear, ClearType}, 10 | }; 11 | 12 | use crate::{ 13 | config::{Config, Menu}, 14 | set_style, 15 | state::State, 16 | theme::Theme, 17 | }; 18 | 19 | // Spacing between elements on the same line 20 | const SPACING: u16 = 2; 21 | 22 | const ROW_MENULINE: u16 = 0; 23 | const ROW_PROMPT: u16 = 2; 24 | const ROW_ENTRIES: u16 = 4; 25 | 26 | /// Draws the interface. 27 | pub(crate) fn draw( 28 | tty: &mut impl std::io::Write, 29 | config: &Config, 30 | state: &mut State, 31 | menu: &(String, Menu), 32 | entries: &Vec<(Option<(i64, Vec)>, String, String)>, 33 | ) -> Result<(), anyhow::Error> { 34 | draw_menu_line(tty, &config.theme, &config.menus, state.menu_index) 35 | .context("Failed to draw menu line")?; 36 | draw_entries( 37 | tty, 38 | &config.theme, 39 | &entries, 40 | state.entry_cursor, 41 | state.entry_index, 42 | ) 43 | .context("Failed to draw entries")?; 44 | draw_prompt(tty, &config.theme, &menu.1.prompt).context("Failed to draw prompt")?; 45 | draw_input(tty, &config.theme, &state.input, state.cursor_x) 46 | .context("Failed to draw user input")?; 47 | 48 | Ok(()) 49 | } 50 | 51 | fn draw_menu_line( 52 | tty: &mut impl std::io::Write, 53 | theme: &Theme, 54 | menus: &Vec<(String, Menu)>, 55 | menu_index: usize, 56 | ) -> anyhow::Result<()> { 57 | let mut x: u16 = 0; 58 | for (i, menu) in menus.iter().enumerate() { 59 | let style = if i == menu_index { 60 | &theme.menu_cursor 61 | } else { 62 | &theme.menu_name 63 | }; 64 | 65 | execute!( 66 | tty, 67 | ResetColor, 68 | MoveTo(x, ROW_MENULINE), 69 | set_style!(style), 70 | Print(&menu.0) 71 | )?; 72 | x += &menu.0.len().try_into()? + SPACING; 73 | } 74 | Ok(()) 75 | } 76 | 77 | fn draw_prompt( 78 | tty: &mut impl std::io::Write, 79 | theme: &Theme, 80 | text: &str, 81 | ) -> Result<(), std::io::Error> { 82 | execute!( 83 | tty, 84 | MoveTo(0, ROW_PROMPT), 85 | ResetColor, 86 | set_style!(theme.prompt), 87 | Print(text), 88 | ResetColor, 89 | SavePosition 90 | ) 91 | } 92 | 93 | fn draw_input( 94 | tty: &mut impl std::io::Write, 95 | theme: &Theme, 96 | text: &str, 97 | cursor_x: u16, 98 | ) -> Result<(), anyhow::Error> { 99 | execute!( 100 | tty, 101 | RestorePosition, 102 | Clear(ClearType::UntilNewLine), 103 | set_style!(theme.input), 104 | Print(text), 105 | RestorePosition 106 | )?; 107 | if cursor_x > 0 { 108 | execute!(tty, MoveRight(cursor_x))?; 109 | } 110 | Ok(()) 111 | } 112 | 113 | fn draw_entries( 114 | tty: &mut impl std::io::Write, 115 | theme: &Theme, 116 | entries: &Vec<(Option<(i64, Vec)>, String, String)>, 117 | entry_cursor: bool, 118 | entry_index: usize, 119 | ) -> anyhow::Result<()> { 120 | queue!(tty, MoveTo(0, ROW_ENTRIES), ResetColor)?; 121 | 122 | let size = terminal::size()?; 123 | let w = size.0; 124 | let h: usize = size.1.try_into()?; 125 | 126 | for (i, entry) in entries.iter().enumerate() { 127 | let y = i + 4; // TODO what's the proper value here? where does it come from? 128 | 129 | if y < h { 130 | let selected = entry_cursor && i == entry_index; 131 | draw_entry(tty, theme, w, entry, selected)?; 132 | } else if i == 0 { 133 | break; // No room to draw anything 134 | } else { 135 | let msg = format!("+{} more", entries.len() - i + 1); 136 | queue!( 137 | tty, 138 | set_style!(theme.overflow), 139 | MoveToNextLine(1), 140 | MoveToNextLine(1), 141 | Clear(ClearType::CurrentLine), 142 | Print(msg) 143 | )?; 144 | break; 145 | } 146 | } 147 | 148 | Ok(()) 149 | } 150 | 151 | fn draw_entry( 152 | tty: &mut impl std::io::Write, 153 | theme: &Theme, 154 | 155 | term_width: u16, 156 | entry: &(Option<(i64, Vec)>, String, String), 157 | selected: bool, 158 | ) -> Result<(), anyhow::Error> { 159 | if let Some(fuzzy) = &entry.0 { 160 | for (j, c) in entry.1.char_indices() { 161 | let style = if fuzzy.1.contains(&j) { 162 | if selected { 163 | &theme.entry_cursor_match 164 | } else { 165 | &theme.entry_match 166 | } 167 | } else { 168 | if selected { 169 | &theme.entry_cursor 170 | } else { 171 | &theme.entry_name 172 | } 173 | }; 174 | queue!(tty, ResetColor, set_style!(style), Print(c))?; 175 | } 176 | } else { 177 | queue!( 178 | tty, 179 | ResetColor, 180 | SetForegroundColor(theme.entry_hidden.fg.0), 181 | SetAttributes(theme.entry_hidden.attrs.0), 182 | Print(&entry.1) 183 | )?; 184 | } 185 | 186 | // Draw value on right side 187 | let name_width: u16 = entry.1.len().try_into()?; 188 | let name_width = name_width + SPACING; 189 | let value_width: u16 = entry.2.len().try_into()?; 190 | let remaining_cols = term_width.saturating_sub(name_width); 191 | 192 | let style = match entry.0 { 193 | Some(_) => &theme.entry_value, 194 | None => &theme.entry_hidden, 195 | }; 196 | 197 | if remaining_cols >= value_width { 198 | queue!( 199 | tty, 200 | ResetColor, 201 | set_style!(style), 202 | MoveToColumn(term_width - value_width), 203 | Print(&entry.2) 204 | )?; 205 | } else if remaining_cols >= 4 { 206 | // at least 1 char + ellipses 207 | let overflow_indicator = "+"; 208 | let overflow_indicator_width: u16 = overflow_indicator.len().try_into()?; 209 | let value_trunc = entry 210 | .2 211 | .get(..(remaining_cols - overflow_indicator_width).into()); 212 | 213 | if let Some(vt) = value_trunc { 214 | let value_trunc_width: u16 = vt.len().try_into()?; 215 | let value_total_width: u16 = value_trunc_width + overflow_indicator_width; 216 | queue!( 217 | tty, 218 | ResetColor, 219 | set_style!(style), 220 | MoveToColumn(term_width - value_total_width), 221 | Print(vt), 222 | set_style!(theme.overflow), 223 | Print(overflow_indicator) 224 | )?; 225 | } 226 | } 227 | queue!(tty, MoveToNextLine(1), MoveToColumn(0))?; 228 | Ok(()) 229 | } 230 | -------------------------------------------------------------------------------- /src/keybinds.rs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later 2 | //! Keybind configuration and key event handling. 3 | 4 | use std::fmt; 5 | 6 | use anyhow::{anyhow, bail, Context, Result}; 7 | use crossterm::event::{KeyCode, KeyEvent, KeyModifiers}; 8 | use serde::{ 9 | de::{self, Visitor}, 10 | Deserialize, Deserializer, 11 | }; 12 | 13 | use crate::{ 14 | handle_key_event, 15 | state::{Action, State}, 16 | }; 17 | 18 | /// Indicates that unhandled key events should cause errors. 19 | const UNHANDLED_KEY_EVENT_ERRORS: bool = false; 20 | 21 | #[derive(Debug)] 22 | /// Used to deserialize keybinds from a plus-seperated list of modifier keys and one non-modifier 23 | /// key. 24 | pub(crate) struct Keybind( 25 | /// **One** non-modifier key. 26 | pub(crate) KeyCode, 27 | /// Zero, one, or multiple modifier keys. 28 | pub(crate) KeyModifiers, 29 | ); 30 | 31 | impl Keybind { 32 | fn matches(&self, event: KeyEvent) -> bool { 33 | let code = if event.code == KeyCode::BackTab { 34 | KeyCode::Tab 35 | } else { 36 | event.code 37 | }; 38 | code == self.0 && event.modifiers == self.1 39 | } 40 | } 41 | 42 | impl<'de> Deserialize<'de> for Keybind { 43 | fn deserialize(deserializer: D) -> Result 44 | where 45 | D: Deserializer<'de>, 46 | { 47 | struct KeybindVisitor; 48 | 49 | impl<'de> Visitor<'de> for KeybindVisitor { 50 | type Value = Keybind; 51 | 52 | fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { 53 | formatter.write_str("a plus-separated list of attributes") 54 | } 55 | 56 | fn visit_str(self, s: &str) -> Result 57 | where 58 | E: de::Error, 59 | { 60 | let mut code: Option = None; 61 | let mut modifiers = KeyModifiers::from_bits(0).unwrap(); 62 | 63 | for key in s.split('+') { 64 | let key = key.trim().to_lowercase(); 65 | let key = key.as_str(); 66 | let mut c: Option = None; 67 | 68 | match key { 69 | "shift" => modifiers.insert(KeyModifiers::SHIFT), 70 | "control" | "ctrl" => modifiers.insert(KeyModifiers::CONTROL), 71 | "alt" => modifiers.insert(KeyModifiers::ALT), 72 | "backspace" | "back" => c = Some(KeyCode::Backspace), 73 | "enter" | "return" | "ret" => c = Some(KeyCode::Enter), 74 | "left" => c = Some(KeyCode::Left), 75 | "right" => c = Some(KeyCode::Right), 76 | "up" => c = Some(KeyCode::Up), 77 | "down" => c = Some(KeyCode::Down), 78 | "home" => c = Some(KeyCode::Home), 79 | "end" => c = Some(KeyCode::End), 80 | "pageup" | "pgup" => c = Some(KeyCode::PageUp), 81 | "pagedown" | "pgdn" => c = Some(KeyCode::PageDown), 82 | "tab" => c = Some(KeyCode::Tab), 83 | "delete" | "del" => c = Some(KeyCode::Delete), 84 | "insert" => c = Some(KeyCode::Insert), 85 | "escape" | "esc" => c = Some(KeyCode::Esc), 86 | _ => { 87 | let mut chars = key.chars(); 88 | if let Some(first_char) = chars.next() { 89 | if key.len() == 1 { 90 | c = Some(KeyCode::Char(first_char)); 91 | } else if first_char == 'f' { 92 | let remaining: String = chars.collect(); 93 | let num = remaining.parse::().map_err(|_| { 94 | de::Error::custom("invalid function key code") 95 | })?; 96 | c = Some(KeyCode::F(num)); 97 | } 98 | } else { 99 | return Err(de::Error::custom("empty key code")); 100 | } 101 | } 102 | }; 103 | 104 | if let Some(c) = c { 105 | if code.is_some() { 106 | return Err(de::Error::custom("multiple non-modifier keys")); 107 | } else { 108 | code = Some(c); 109 | } 110 | } 111 | } 112 | 113 | if let Some(code) = code { 114 | Ok(Keybind(code, modifiers)) 115 | } else { 116 | Err(de::Error::custom( 117 | "keybind must include one non-modifier key", 118 | )) 119 | } 120 | } 121 | } 122 | deserializer.deserialize_str(KeybindVisitor) 123 | } 124 | } 125 | 126 | /// A collection of keybinds used to control the program. 127 | #[derive(Debug, Deserialize)] 128 | pub(crate) struct Keybinds { 129 | /// Quit the program. 130 | pub(crate) exit: Vec, 131 | 132 | /// Submit / execute the selected entry. 133 | pub(crate) submit: Vec, 134 | 135 | /// Clear the input. 136 | pub(crate) clear: Vec, 137 | 138 | /// Delete the next character at the input cursor. 139 | pub(crate) delete_next: Vec, 140 | 141 | /// Delete the previous character at the input cursor. 142 | pub(crate) delete_back: Vec, 143 | 144 | /// Move the input cursor to the right. 145 | pub(crate) input_next: Vec, 146 | 147 | /// Move the input cursor to the left. 148 | pub(crate) input_back: Vec, 149 | 150 | /// Go to the next menu to the right. 151 | pub(crate) menu_next: Vec, 152 | 153 | /// Go to the previous menu to the left. 154 | pub(crate) menu_back: Vec, 155 | 156 | /// Select the next entry. 157 | pub(crate) entry_next: Vec, 158 | 159 | /// Select the previous entry. 160 | pub(crate) entry_back: Vec, 161 | } 162 | 163 | impl Keybinds { 164 | pub(crate) fn handle(&self, event: KeyEvent, state: State) -> Result { 165 | let (handled, state_res) = handle_key_event!( 166 | self, 167 | event, 168 | state, 169 | [ 170 | exit, 171 | submit, 172 | clear, 173 | delete_next, 174 | delete_back, 175 | input_next, 176 | input_back, 177 | entry_next, 178 | entry_back, 179 | menu_next, 180 | menu_back 181 | ] 182 | ); 183 | let state = state_res.context("Keybind handler error")?; 184 | if handled { 185 | Ok(state) 186 | } else { 187 | Keybinds::fallback_handler(state, event) 188 | } 189 | } 190 | 191 | fn fallback_handler(state: State, event: KeyEvent) -> Result { 192 | let new_state = match event.code { 193 | KeyCode::Char(c) => { 194 | if event.modifiers.bits() <= 1 { 195 | let mut input = state.input.clone(); 196 | input.insert(state.cursor_x.into(), c); 197 | let state = State { 198 | input, 199 | cursor_x: state.cursor_x.saturating_add(1), 200 | entry_cursor: false, 201 | entry_index: 0, 202 | ..state.clone() 203 | }; 204 | Some(state) 205 | } else { 206 | None 207 | } 208 | } 209 | _ => None, 210 | }; 211 | 212 | if let Some(state) = new_state { 213 | Ok(state) 214 | } else if UNHANDLED_KEY_EVENT_ERRORS { 215 | bail!("Unhandled key event: {event:?}"); 216 | } else { 217 | Ok(state) 218 | } 219 | } 220 | 221 | fn exit(state: State) -> Result { 222 | let state = State { 223 | action: Action::Exit, 224 | ..state 225 | }; 226 | Ok(state) 227 | } 228 | 229 | fn submit(state: State) -> Result { 230 | let state = State { 231 | action: Action::Submit, 232 | ..state 233 | }; 234 | Ok(state) 235 | } 236 | 237 | fn clear(state: State) -> Result { 238 | let state = State { 239 | input: String::default(), 240 | cursor_x: 0, 241 | entry_cursor: false, 242 | ..state 243 | }; 244 | Ok(state) 245 | } 246 | 247 | fn delete_next(state: State) -> Result { 248 | let state = State { 249 | entry_cursor: false, 250 | input: state 251 | .input 252 | .char_indices() 253 | .filter_map(|(i, c)| { 254 | if (i as u16) == state.cursor_x { 255 | None 256 | } else { 257 | Some(c) 258 | } 259 | }) 260 | .collect(), 261 | ..state 262 | }; 263 | Ok(state) 264 | } 265 | 266 | fn delete_back(state: State) -> Result { 267 | if state.cursor_x == 0 { 268 | return Ok(state); 269 | } 270 | let cursor_x = state.cursor_x.saturating_sub(1); 271 | let state = State { 272 | entry_cursor: false, 273 | input: state 274 | .input 275 | .char_indices() 276 | .filter_map(|(i, c)| { 277 | if (i as u16) == cursor_x { 278 | None 279 | } else { 280 | Some(c) 281 | } 282 | }) 283 | .collect(), 284 | cursor_x, 285 | ..state 286 | }; 287 | Ok(state) 288 | } 289 | 290 | fn input_next(state: State) -> Result { 291 | let len: u16 = state.input.len().try_into()?; 292 | let state = State { 293 | cursor_x: u16::min(len, state.cursor_x.saturating_add(1)), 294 | ..state 295 | }; 296 | Ok(state) 297 | } 298 | 299 | fn input_back(state: State) -> Result { 300 | let state = State { 301 | cursor_x: u16::max(0, state.cursor_x.saturating_sub(1)), 302 | ..state 303 | }; 304 | Ok(state) 305 | } 306 | 307 | fn entry_next(state: State) -> Result { 308 | if state.entry_count == 0 { 309 | return Ok(state); 310 | } 311 | let state = State { 312 | entry_cursor: true, 313 | entry_index: if state.entry_cursor { 314 | state.entry_index.saturating_add(1) % state.entry_count 315 | } else { 316 | 0 317 | }, 318 | ..state 319 | }; 320 | Ok(state) 321 | } 322 | 323 | fn entry_back(state: State) -> Result { 324 | if state.entry_count == 0 { 325 | return Ok(state); 326 | } 327 | let state = State { 328 | entry_cursor: true, 329 | entry_index: if state.entry_cursor && state.entry_index != 0 { 330 | state.entry_index.saturating_sub(1) % state.entry_count 331 | } else { 332 | state.entry_count - 1 333 | }, 334 | ..state 335 | }; 336 | Ok(state) 337 | } 338 | 339 | fn menu_next(state: State) -> Result { 340 | let state = State { 341 | input: String::default(), 342 | cursor_x: 0, 343 | entry_cursor: false, 344 | entry_index: 0, 345 | menu_index: state 346 | .menu_index 347 | .saturating_add(1) 348 | .checked_rem(state.menu_count) 349 | .ok_or_else(|| anyhow!("zero menus"))?, 350 | ..state 351 | }; 352 | Ok(state) 353 | } 354 | 355 | fn menu_back(state: State) -> Result { 356 | let state = State { 357 | input: String::default(), 358 | cursor_x: 0, 359 | entry_cursor: false, 360 | entry_index: 0, 361 | menu_index: if state.menu_index != 0 { 362 | state 363 | .menu_index 364 | .saturating_sub(1) 365 | .checked_rem(state.menu_count) 366 | .ok_or_else(|| anyhow!("zero menus"))? 367 | } else { 368 | state.menu_count - 1 369 | }, 370 | ..state 371 | }; 372 | Ok(state) 373 | } 374 | } 375 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "ahash" 7 | version = "0.7.6" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" 10 | dependencies = [ 11 | "getrandom", 12 | "once_cell", 13 | "version_check", 14 | ] 15 | 16 | [[package]] 17 | name = "android_system_properties" 18 | version = "0.1.5" 19 | source = "registry+https://github.com/rust-lang/crates.io-index" 20 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 21 | dependencies = [ 22 | "libc", 23 | ] 24 | 25 | [[package]] 26 | name = "anyhow" 27 | version = "1.0.66" 28 | source = "registry+https://github.com/rust-lang/crates.io-index" 29 | checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" 30 | 31 | [[package]] 32 | name = "async-trait" 33 | version = "0.1.58" 34 | source = "registry+https://github.com/rust-lang/crates.io-index" 35 | checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" 36 | dependencies = [ 37 | "proc-macro2", 38 | "quote", 39 | "syn", 40 | ] 41 | 42 | [[package]] 43 | name = "autocfg" 44 | version = "1.1.0" 45 | source = "registry+https://github.com/rust-lang/crates.io-index" 46 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 47 | 48 | [[package]] 49 | name = "base64" 50 | version = "0.13.1" 51 | source = "registry+https://github.com/rust-lang/crates.io-index" 52 | checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" 53 | 54 | [[package]] 55 | name = "bitflags" 56 | version = "1.3.2" 57 | source = "registry+https://github.com/rust-lang/crates.io-index" 58 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 59 | 60 | [[package]] 61 | name = "block-buffer" 62 | version = "0.10.3" 63 | source = "registry+https://github.com/rust-lang/crates.io-index" 64 | checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" 65 | dependencies = [ 66 | "generic-array", 67 | ] 68 | 69 | [[package]] 70 | name = "bumpalo" 71 | version = "3.11.1" 72 | source = "registry+https://github.com/rust-lang/crates.io-index" 73 | checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" 74 | 75 | [[package]] 76 | name = "cc" 77 | version = "1.0.77" 78 | source = "registry+https://github.com/rust-lang/crates.io-index" 79 | checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" 80 | 81 | [[package]] 82 | name = "cfg-if" 83 | version = "1.0.0" 84 | source = "registry+https://github.com/rust-lang/crates.io-index" 85 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 86 | 87 | [[package]] 88 | name = "chrono" 89 | version = "0.4.23" 90 | source = "registry+https://github.com/rust-lang/crates.io-index" 91 | checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" 92 | dependencies = [ 93 | "iana-time-zone", 94 | "num-integer", 95 | "num-traits", 96 | "serde", 97 | "winapi", 98 | ] 99 | 100 | [[package]] 101 | name = "clap" 102 | version = "4.0.27" 103 | source = "registry+https://github.com/rust-lang/crates.io-index" 104 | checksum = "0acbd8d28a0a60d7108d7ae850af6ba34cf2d1257fc646980e5f97ce14275966" 105 | dependencies = [ 106 | "bitflags", 107 | "clap_derive", 108 | "clap_lex", 109 | "is-terminal", 110 | "once_cell", 111 | "strsim", 112 | "termcolor", 113 | ] 114 | 115 | [[package]] 116 | name = "clap_derive" 117 | version = "4.0.21" 118 | source = "registry+https://github.com/rust-lang/crates.io-index" 119 | checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" 120 | dependencies = [ 121 | "heck", 122 | "proc-macro-error", 123 | "proc-macro2", 124 | "quote", 125 | "syn", 126 | ] 127 | 128 | [[package]] 129 | name = "clap_lex" 130 | version = "0.3.0" 131 | source = "registry+https://github.com/rust-lang/crates.io-index" 132 | checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" 133 | dependencies = [ 134 | "os_str_bytes", 135 | ] 136 | 137 | [[package]] 138 | name = "codespan-reporting" 139 | version = "0.11.1" 140 | source = "registry+https://github.com/rust-lang/crates.io-index" 141 | checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" 142 | dependencies = [ 143 | "termcolor", 144 | "unicode-width", 145 | ] 146 | 147 | [[package]] 148 | name = "config" 149 | version = "0.13.2" 150 | source = "registry+https://github.com/rust-lang/crates.io-index" 151 | checksum = "11f1667b8320afa80d69d8bbe40830df2c8a06003d86f73d8e003b2c48df416d" 152 | dependencies = [ 153 | "async-trait", 154 | "json5", 155 | "lazy_static", 156 | "nom", 157 | "pathdiff", 158 | "ron", 159 | "rust-ini", 160 | "serde", 161 | "serde_json", 162 | "toml", 163 | "yaml-rust", 164 | ] 165 | 166 | [[package]] 167 | name = "core-foundation-sys" 168 | version = "0.8.3" 169 | source = "registry+https://github.com/rust-lang/crates.io-index" 170 | checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" 171 | 172 | [[package]] 173 | name = "cpufeatures" 174 | version = "0.2.5" 175 | source = "registry+https://github.com/rust-lang/crates.io-index" 176 | checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" 177 | dependencies = [ 178 | "libc", 179 | ] 180 | 181 | [[package]] 182 | name = "crossterm" 183 | version = "0.25.0" 184 | source = "registry+https://github.com/rust-lang/crates.io-index" 185 | checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67" 186 | dependencies = [ 187 | "bitflags", 188 | "crossterm_winapi", 189 | "libc", 190 | "mio", 191 | "parking_lot", 192 | "signal-hook", 193 | "signal-hook-mio", 194 | "winapi", 195 | ] 196 | 197 | [[package]] 198 | name = "crossterm_winapi" 199 | version = "0.9.0" 200 | source = "registry+https://github.com/rust-lang/crates.io-index" 201 | checksum = "2ae1b35a484aa10e07fe0638d02301c5ad24de82d310ccbd2f3693da5f09bf1c" 202 | dependencies = [ 203 | "winapi", 204 | ] 205 | 206 | [[package]] 207 | name = "crypto-common" 208 | version = "0.1.6" 209 | source = "registry+https://github.com/rust-lang/crates.io-index" 210 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 211 | dependencies = [ 212 | "generic-array", 213 | "typenum", 214 | ] 215 | 216 | [[package]] 217 | name = "csscolorparser" 218 | version = "0.6.2" 219 | source = "registry+https://github.com/rust-lang/crates.io-index" 220 | checksum = "eb2a7d3066da2de787b7f032c736763eb7ae5d355f81a68bab2675a96008b0bf" 221 | dependencies = [ 222 | "phf", 223 | ] 224 | 225 | [[package]] 226 | name = "cxx" 227 | version = "1.0.82" 228 | source = "registry+https://github.com/rust-lang/crates.io-index" 229 | checksum = "d4a41a86530d0fe7f5d9ea779916b7cadd2d4f9add748b99c2c029cbbdfaf453" 230 | dependencies = [ 231 | "cc", 232 | "cxxbridge-flags", 233 | "cxxbridge-macro", 234 | "link-cplusplus", 235 | ] 236 | 237 | [[package]] 238 | name = "cxx-build" 239 | version = "1.0.82" 240 | source = "registry+https://github.com/rust-lang/crates.io-index" 241 | checksum = "06416d667ff3e3ad2df1cd8cd8afae5da26cf9cec4d0825040f88b5ca659a2f0" 242 | dependencies = [ 243 | "cc", 244 | "codespan-reporting", 245 | "once_cell", 246 | "proc-macro2", 247 | "quote", 248 | "scratch", 249 | "syn", 250 | ] 251 | 252 | [[package]] 253 | name = "cxxbridge-flags" 254 | version = "1.0.82" 255 | source = "registry+https://github.com/rust-lang/crates.io-index" 256 | checksum = "820a9a2af1669deeef27cb271f476ffd196a2c4b6731336011e0ba63e2c7cf71" 257 | 258 | [[package]] 259 | name = "cxxbridge-macro" 260 | version = "1.0.82" 261 | source = "registry+https://github.com/rust-lang/crates.io-index" 262 | checksum = "a08a6e2fcc370a089ad3b4aaf54db3b1b4cee38ddabce5896b33eb693275f470" 263 | dependencies = [ 264 | "proc-macro2", 265 | "quote", 266 | "syn", 267 | ] 268 | 269 | [[package]] 270 | name = "darling" 271 | version = "0.14.2" 272 | source = "registry+https://github.com/rust-lang/crates.io-index" 273 | checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" 274 | dependencies = [ 275 | "darling_core", 276 | "darling_macro", 277 | ] 278 | 279 | [[package]] 280 | name = "darling_core" 281 | version = "0.14.2" 282 | source = "registry+https://github.com/rust-lang/crates.io-index" 283 | checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" 284 | dependencies = [ 285 | "fnv", 286 | "ident_case", 287 | "proc-macro2", 288 | "quote", 289 | "strsim", 290 | "syn", 291 | ] 292 | 293 | [[package]] 294 | name = "darling_macro" 295 | version = "0.14.2" 296 | source = "registry+https://github.com/rust-lang/crates.io-index" 297 | checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" 298 | dependencies = [ 299 | "darling_core", 300 | "quote", 301 | "syn", 302 | ] 303 | 304 | [[package]] 305 | name = "digest" 306 | version = "0.10.6" 307 | source = "registry+https://github.com/rust-lang/crates.io-index" 308 | checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" 309 | dependencies = [ 310 | "block-buffer", 311 | "crypto-common", 312 | ] 313 | 314 | [[package]] 315 | name = "dlv-list" 316 | version = "0.3.0" 317 | source = "registry+https://github.com/rust-lang/crates.io-index" 318 | checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257" 319 | 320 | [[package]] 321 | name = "errno" 322 | version = "0.2.8" 323 | source = "registry+https://github.com/rust-lang/crates.io-index" 324 | checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" 325 | dependencies = [ 326 | "errno-dragonfly", 327 | "libc", 328 | "winapi", 329 | ] 330 | 331 | [[package]] 332 | name = "errno-dragonfly" 333 | version = "0.1.2" 334 | source = "registry+https://github.com/rust-lang/crates.io-index" 335 | checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" 336 | dependencies = [ 337 | "cc", 338 | "libc", 339 | ] 340 | 341 | [[package]] 342 | name = "fnv" 343 | version = "1.0.7" 344 | source = "registry+https://github.com/rust-lang/crates.io-index" 345 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 346 | 347 | [[package]] 348 | name = "fr33zmenu" 349 | version = "0.1.5" 350 | dependencies = [ 351 | "anyhow", 352 | "clap", 353 | "config", 354 | "crossterm", 355 | "csscolorparser", 356 | "fuzzy-matcher", 357 | "serde", 358 | "serde_with", 359 | ] 360 | 361 | [[package]] 362 | name = "fuzzy-matcher" 363 | version = "0.3.7" 364 | source = "registry+https://github.com/rust-lang/crates.io-index" 365 | checksum = "54614a3312934d066701a80f20f15fa3b56d67ac7722b39eea5b4c9dd1d66c94" 366 | dependencies = [ 367 | "thread_local", 368 | ] 369 | 370 | [[package]] 371 | name = "generic-array" 372 | version = "0.14.6" 373 | source = "registry+https://github.com/rust-lang/crates.io-index" 374 | checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" 375 | dependencies = [ 376 | "typenum", 377 | "version_check", 378 | ] 379 | 380 | [[package]] 381 | name = "getrandom" 382 | version = "0.2.8" 383 | source = "registry+https://github.com/rust-lang/crates.io-index" 384 | checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" 385 | dependencies = [ 386 | "cfg-if", 387 | "libc", 388 | "wasi", 389 | ] 390 | 391 | [[package]] 392 | name = "hashbrown" 393 | version = "0.12.3" 394 | source = "registry+https://github.com/rust-lang/crates.io-index" 395 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 396 | dependencies = [ 397 | "ahash", 398 | ] 399 | 400 | [[package]] 401 | name = "heck" 402 | version = "0.4.0" 403 | source = "registry+https://github.com/rust-lang/crates.io-index" 404 | checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" 405 | 406 | [[package]] 407 | name = "hermit-abi" 408 | version = "0.2.6" 409 | source = "registry+https://github.com/rust-lang/crates.io-index" 410 | checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" 411 | dependencies = [ 412 | "libc", 413 | ] 414 | 415 | [[package]] 416 | name = "hex" 417 | version = "0.4.3" 418 | source = "registry+https://github.com/rust-lang/crates.io-index" 419 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 420 | 421 | [[package]] 422 | name = "iana-time-zone" 423 | version = "0.1.53" 424 | source = "registry+https://github.com/rust-lang/crates.io-index" 425 | checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" 426 | dependencies = [ 427 | "android_system_properties", 428 | "core-foundation-sys", 429 | "iana-time-zone-haiku", 430 | "js-sys", 431 | "wasm-bindgen", 432 | "winapi", 433 | ] 434 | 435 | [[package]] 436 | name = "iana-time-zone-haiku" 437 | version = "0.1.1" 438 | source = "registry+https://github.com/rust-lang/crates.io-index" 439 | checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" 440 | dependencies = [ 441 | "cxx", 442 | "cxx-build", 443 | ] 444 | 445 | [[package]] 446 | name = "ident_case" 447 | version = "1.0.1" 448 | source = "registry+https://github.com/rust-lang/crates.io-index" 449 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 450 | 451 | [[package]] 452 | name = "indexmap" 453 | version = "1.9.2" 454 | source = "registry+https://github.com/rust-lang/crates.io-index" 455 | checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" 456 | dependencies = [ 457 | "autocfg", 458 | "hashbrown", 459 | "serde", 460 | ] 461 | 462 | [[package]] 463 | name = "io-lifetimes" 464 | version = "1.0.2" 465 | source = "registry+https://github.com/rust-lang/crates.io-index" 466 | checksum = "e394faa0efb47f9f227f1cd89978f854542b318a6f64fa695489c9c993056656" 467 | dependencies = [ 468 | "libc", 469 | "windows-sys", 470 | ] 471 | 472 | [[package]] 473 | name = "is-terminal" 474 | version = "0.4.0" 475 | source = "registry+https://github.com/rust-lang/crates.io-index" 476 | checksum = "aae5bc6e2eb41c9def29a3e0f1306382807764b9b53112030eff57435667352d" 477 | dependencies = [ 478 | "hermit-abi", 479 | "io-lifetimes", 480 | "rustix", 481 | "windows-sys", 482 | ] 483 | 484 | [[package]] 485 | name = "itoa" 486 | version = "1.0.4" 487 | source = "registry+https://github.com/rust-lang/crates.io-index" 488 | checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" 489 | 490 | [[package]] 491 | name = "js-sys" 492 | version = "0.3.60" 493 | source = "registry+https://github.com/rust-lang/crates.io-index" 494 | checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" 495 | dependencies = [ 496 | "wasm-bindgen", 497 | ] 498 | 499 | [[package]] 500 | name = "json5" 501 | version = "0.4.1" 502 | source = "registry+https://github.com/rust-lang/crates.io-index" 503 | checksum = "96b0db21af676c1ce64250b5f40f3ce2cf27e4e47cb91ed91eb6fe9350b430c1" 504 | dependencies = [ 505 | "pest", 506 | "pest_derive", 507 | "serde", 508 | ] 509 | 510 | [[package]] 511 | name = "lazy_static" 512 | version = "1.4.0" 513 | source = "registry+https://github.com/rust-lang/crates.io-index" 514 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 515 | 516 | [[package]] 517 | name = "libc" 518 | version = "0.2.137" 519 | source = "registry+https://github.com/rust-lang/crates.io-index" 520 | checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" 521 | 522 | [[package]] 523 | name = "link-cplusplus" 524 | version = "1.0.7" 525 | source = "registry+https://github.com/rust-lang/crates.io-index" 526 | checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" 527 | dependencies = [ 528 | "cc", 529 | ] 530 | 531 | [[package]] 532 | name = "linked-hash-map" 533 | version = "0.5.6" 534 | source = "registry+https://github.com/rust-lang/crates.io-index" 535 | checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" 536 | 537 | [[package]] 538 | name = "linux-raw-sys" 539 | version = "0.1.3" 540 | source = "registry+https://github.com/rust-lang/crates.io-index" 541 | checksum = "8f9f08d8963a6c613f4b1a78f4f4a4dbfadf8e6545b2d72861731e4858b8b47f" 542 | 543 | [[package]] 544 | name = "lock_api" 545 | version = "0.4.9" 546 | source = "registry+https://github.com/rust-lang/crates.io-index" 547 | checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" 548 | dependencies = [ 549 | "autocfg", 550 | "scopeguard", 551 | ] 552 | 553 | [[package]] 554 | name = "log" 555 | version = "0.4.17" 556 | source = "registry+https://github.com/rust-lang/crates.io-index" 557 | checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 558 | dependencies = [ 559 | "cfg-if", 560 | ] 561 | 562 | [[package]] 563 | name = "memchr" 564 | version = "2.5.0" 565 | source = "registry+https://github.com/rust-lang/crates.io-index" 566 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 567 | 568 | [[package]] 569 | name = "minimal-lexical" 570 | version = "0.2.1" 571 | source = "registry+https://github.com/rust-lang/crates.io-index" 572 | checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 573 | 574 | [[package]] 575 | name = "mio" 576 | version = "0.8.5" 577 | source = "registry+https://github.com/rust-lang/crates.io-index" 578 | checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" 579 | dependencies = [ 580 | "libc", 581 | "log", 582 | "wasi", 583 | "windows-sys", 584 | ] 585 | 586 | [[package]] 587 | name = "nom" 588 | version = "7.1.1" 589 | source = "registry+https://github.com/rust-lang/crates.io-index" 590 | checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" 591 | dependencies = [ 592 | "memchr", 593 | "minimal-lexical", 594 | ] 595 | 596 | [[package]] 597 | name = "num-integer" 598 | version = "0.1.45" 599 | source = "registry+https://github.com/rust-lang/crates.io-index" 600 | checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" 601 | dependencies = [ 602 | "autocfg", 603 | "num-traits", 604 | ] 605 | 606 | [[package]] 607 | name = "num-traits" 608 | version = "0.2.15" 609 | source = "registry+https://github.com/rust-lang/crates.io-index" 610 | checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" 611 | dependencies = [ 612 | "autocfg", 613 | ] 614 | 615 | [[package]] 616 | name = "once_cell" 617 | version = "1.16.0" 618 | source = "registry+https://github.com/rust-lang/crates.io-index" 619 | checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" 620 | 621 | [[package]] 622 | name = "ordered-multimap" 623 | version = "0.4.3" 624 | source = "registry+https://github.com/rust-lang/crates.io-index" 625 | checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a" 626 | dependencies = [ 627 | "dlv-list", 628 | "hashbrown", 629 | ] 630 | 631 | [[package]] 632 | name = "os_str_bytes" 633 | version = "6.4.1" 634 | source = "registry+https://github.com/rust-lang/crates.io-index" 635 | checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" 636 | 637 | [[package]] 638 | name = "parking_lot" 639 | version = "0.12.1" 640 | source = "registry+https://github.com/rust-lang/crates.io-index" 641 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 642 | dependencies = [ 643 | "lock_api", 644 | "parking_lot_core", 645 | ] 646 | 647 | [[package]] 648 | name = "parking_lot_core" 649 | version = "0.9.4" 650 | source = "registry+https://github.com/rust-lang/crates.io-index" 651 | checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" 652 | dependencies = [ 653 | "cfg-if", 654 | "libc", 655 | "redox_syscall", 656 | "smallvec", 657 | "windows-sys", 658 | ] 659 | 660 | [[package]] 661 | name = "pathdiff" 662 | version = "0.2.1" 663 | source = "registry+https://github.com/rust-lang/crates.io-index" 664 | checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" 665 | 666 | [[package]] 667 | name = "pest" 668 | version = "2.5.0" 669 | source = "registry+https://github.com/rust-lang/crates.io-index" 670 | checksum = "5f400b0f7905bf702f9f3dc3df5a121b16c54e9e8012c082905fdf09a931861a" 671 | dependencies = [ 672 | "thiserror", 673 | "ucd-trie", 674 | ] 675 | 676 | [[package]] 677 | name = "pest_derive" 678 | version = "2.5.0" 679 | source = "registry+https://github.com/rust-lang/crates.io-index" 680 | checksum = "423c2ba011d6e27b02b482a3707c773d19aec65cc024637aec44e19652e66f63" 681 | dependencies = [ 682 | "pest", 683 | "pest_generator", 684 | ] 685 | 686 | [[package]] 687 | name = "pest_generator" 688 | version = "2.5.0" 689 | source = "registry+https://github.com/rust-lang/crates.io-index" 690 | checksum = "3e64e6c2c85031c02fdbd9e5c72845445ca0a724d419aa0bc068ac620c9935c1" 691 | dependencies = [ 692 | "pest", 693 | "pest_meta", 694 | "proc-macro2", 695 | "quote", 696 | "syn", 697 | ] 698 | 699 | [[package]] 700 | name = "pest_meta" 701 | version = "2.5.0" 702 | source = "registry+https://github.com/rust-lang/crates.io-index" 703 | checksum = "57959b91f0a133f89a68be874a5c88ed689c19cd729ecdb5d762ebf16c64d662" 704 | dependencies = [ 705 | "once_cell", 706 | "pest", 707 | "sha1", 708 | ] 709 | 710 | [[package]] 711 | name = "phf" 712 | version = "0.11.1" 713 | source = "registry+https://github.com/rust-lang/crates.io-index" 714 | checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" 715 | dependencies = [ 716 | "phf_macros", 717 | "phf_shared", 718 | ] 719 | 720 | [[package]] 721 | name = "phf_generator" 722 | version = "0.11.1" 723 | source = "registry+https://github.com/rust-lang/crates.io-index" 724 | checksum = "b1181c94580fa345f50f19d738aaa39c0ed30a600d95cb2d3e23f94266f14fbf" 725 | dependencies = [ 726 | "phf_shared", 727 | "rand", 728 | ] 729 | 730 | [[package]] 731 | name = "phf_macros" 732 | version = "0.11.1" 733 | source = "registry+https://github.com/rust-lang/crates.io-index" 734 | checksum = "92aacdc5f16768709a569e913f7451034034178b05bdc8acda226659a3dccc66" 735 | dependencies = [ 736 | "phf_generator", 737 | "phf_shared", 738 | "proc-macro2", 739 | "quote", 740 | "syn", 741 | ] 742 | 743 | [[package]] 744 | name = "phf_shared" 745 | version = "0.11.1" 746 | source = "registry+https://github.com/rust-lang/crates.io-index" 747 | checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" 748 | dependencies = [ 749 | "siphasher", 750 | ] 751 | 752 | [[package]] 753 | name = "proc-macro-error" 754 | version = "1.0.4" 755 | source = "registry+https://github.com/rust-lang/crates.io-index" 756 | checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" 757 | dependencies = [ 758 | "proc-macro-error-attr", 759 | "proc-macro2", 760 | "quote", 761 | "syn", 762 | "version_check", 763 | ] 764 | 765 | [[package]] 766 | name = "proc-macro-error-attr" 767 | version = "1.0.4" 768 | source = "registry+https://github.com/rust-lang/crates.io-index" 769 | checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" 770 | dependencies = [ 771 | "proc-macro2", 772 | "quote", 773 | "version_check", 774 | ] 775 | 776 | [[package]] 777 | name = "proc-macro2" 778 | version = "1.0.47" 779 | source = "registry+https://github.com/rust-lang/crates.io-index" 780 | checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" 781 | dependencies = [ 782 | "unicode-ident", 783 | ] 784 | 785 | [[package]] 786 | name = "quote" 787 | version = "1.0.21" 788 | source = "registry+https://github.com/rust-lang/crates.io-index" 789 | checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" 790 | dependencies = [ 791 | "proc-macro2", 792 | ] 793 | 794 | [[package]] 795 | name = "rand" 796 | version = "0.8.5" 797 | source = "registry+https://github.com/rust-lang/crates.io-index" 798 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 799 | dependencies = [ 800 | "rand_core", 801 | ] 802 | 803 | [[package]] 804 | name = "rand_core" 805 | version = "0.6.4" 806 | source = "registry+https://github.com/rust-lang/crates.io-index" 807 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 808 | 809 | [[package]] 810 | name = "redox_syscall" 811 | version = "0.2.16" 812 | source = "registry+https://github.com/rust-lang/crates.io-index" 813 | checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 814 | dependencies = [ 815 | "bitflags", 816 | ] 817 | 818 | [[package]] 819 | name = "ron" 820 | version = "0.7.1" 821 | source = "registry+https://github.com/rust-lang/crates.io-index" 822 | checksum = "88073939a61e5b7680558e6be56b419e208420c2adb92be54921fa6b72283f1a" 823 | dependencies = [ 824 | "base64", 825 | "bitflags", 826 | "serde", 827 | ] 828 | 829 | [[package]] 830 | name = "rust-ini" 831 | version = "0.18.0" 832 | source = "registry+https://github.com/rust-lang/crates.io-index" 833 | checksum = "f6d5f2436026b4f6e79dc829837d467cc7e9a55ee40e750d716713540715a2df" 834 | dependencies = [ 835 | "cfg-if", 836 | "ordered-multimap", 837 | ] 838 | 839 | [[package]] 840 | name = "rustix" 841 | version = "0.36.3" 842 | source = "registry+https://github.com/rust-lang/crates.io-index" 843 | checksum = "0b1fbb4dfc4eb1d390c02df47760bb19a84bb80b301ecc947ab5406394d8223e" 844 | dependencies = [ 845 | "bitflags", 846 | "errno", 847 | "io-lifetimes", 848 | "libc", 849 | "linux-raw-sys", 850 | "windows-sys", 851 | ] 852 | 853 | [[package]] 854 | name = "ryu" 855 | version = "1.0.11" 856 | source = "registry+https://github.com/rust-lang/crates.io-index" 857 | checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" 858 | 859 | [[package]] 860 | name = "scopeguard" 861 | version = "1.1.0" 862 | source = "registry+https://github.com/rust-lang/crates.io-index" 863 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 864 | 865 | [[package]] 866 | name = "scratch" 867 | version = "1.0.2" 868 | source = "registry+https://github.com/rust-lang/crates.io-index" 869 | checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" 870 | 871 | [[package]] 872 | name = "serde" 873 | version = "1.0.148" 874 | source = "registry+https://github.com/rust-lang/crates.io-index" 875 | checksum = "e53f64bb4ba0191d6d0676e1b141ca55047d83b74f5607e6d8eb88126c52c2dc" 876 | dependencies = [ 877 | "serde_derive", 878 | ] 879 | 880 | [[package]] 881 | name = "serde_derive" 882 | version = "1.0.148" 883 | source = "registry+https://github.com/rust-lang/crates.io-index" 884 | checksum = "a55492425aa53521babf6137309e7d34c20bbfbbfcfe2c7f3a047fd1f6b92c0c" 885 | dependencies = [ 886 | "proc-macro2", 887 | "quote", 888 | "syn", 889 | ] 890 | 891 | [[package]] 892 | name = "serde_json" 893 | version = "1.0.89" 894 | source = "registry+https://github.com/rust-lang/crates.io-index" 895 | checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" 896 | dependencies = [ 897 | "itoa", 898 | "ryu", 899 | "serde", 900 | ] 901 | 902 | [[package]] 903 | name = "serde_with" 904 | version = "2.1.0" 905 | source = "registry+https://github.com/rust-lang/crates.io-index" 906 | checksum = "25bf4a5a814902cd1014dbccfa4d4560fb8432c779471e96e035602519f82eef" 907 | dependencies = [ 908 | "base64", 909 | "chrono", 910 | "hex", 911 | "indexmap", 912 | "serde", 913 | "serde_json", 914 | "serde_with_macros", 915 | "time", 916 | ] 917 | 918 | [[package]] 919 | name = "serde_with_macros" 920 | version = "2.1.0" 921 | source = "registry+https://github.com/rust-lang/crates.io-index" 922 | checksum = "e3452b4c0f6c1e357f73fdb87cd1efabaa12acf328c7a528e252893baeb3f4aa" 923 | dependencies = [ 924 | "darling", 925 | "proc-macro2", 926 | "quote", 927 | "syn", 928 | ] 929 | 930 | [[package]] 931 | name = "sha1" 932 | version = "0.10.5" 933 | source = "registry+https://github.com/rust-lang/crates.io-index" 934 | checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" 935 | dependencies = [ 936 | "cfg-if", 937 | "cpufeatures", 938 | "digest", 939 | ] 940 | 941 | [[package]] 942 | name = "signal-hook" 943 | version = "0.3.14" 944 | source = "registry+https://github.com/rust-lang/crates.io-index" 945 | checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d" 946 | dependencies = [ 947 | "libc", 948 | "signal-hook-registry", 949 | ] 950 | 951 | [[package]] 952 | name = "signal-hook-mio" 953 | version = "0.2.3" 954 | source = "registry+https://github.com/rust-lang/crates.io-index" 955 | checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" 956 | dependencies = [ 957 | "libc", 958 | "mio", 959 | "signal-hook", 960 | ] 961 | 962 | [[package]] 963 | name = "signal-hook-registry" 964 | version = "1.4.0" 965 | source = "registry+https://github.com/rust-lang/crates.io-index" 966 | checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" 967 | dependencies = [ 968 | "libc", 969 | ] 970 | 971 | [[package]] 972 | name = "siphasher" 973 | version = "0.3.10" 974 | source = "registry+https://github.com/rust-lang/crates.io-index" 975 | checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" 976 | 977 | [[package]] 978 | name = "smallvec" 979 | version = "1.10.0" 980 | source = "registry+https://github.com/rust-lang/crates.io-index" 981 | checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" 982 | 983 | [[package]] 984 | name = "strsim" 985 | version = "0.10.0" 986 | source = "registry+https://github.com/rust-lang/crates.io-index" 987 | checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" 988 | 989 | [[package]] 990 | name = "syn" 991 | version = "1.0.104" 992 | source = "registry+https://github.com/rust-lang/crates.io-index" 993 | checksum = "4ae548ec36cf198c0ef7710d3c230987c2d6d7bd98ad6edc0274462724c585ce" 994 | dependencies = [ 995 | "proc-macro2", 996 | "quote", 997 | "unicode-ident", 998 | ] 999 | 1000 | [[package]] 1001 | name = "termcolor" 1002 | version = "1.1.3" 1003 | source = "registry+https://github.com/rust-lang/crates.io-index" 1004 | checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" 1005 | dependencies = [ 1006 | "winapi-util", 1007 | ] 1008 | 1009 | [[package]] 1010 | name = "thiserror" 1011 | version = "1.0.37" 1012 | source = "registry+https://github.com/rust-lang/crates.io-index" 1013 | checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" 1014 | dependencies = [ 1015 | "thiserror-impl", 1016 | ] 1017 | 1018 | [[package]] 1019 | name = "thiserror-impl" 1020 | version = "1.0.37" 1021 | source = "registry+https://github.com/rust-lang/crates.io-index" 1022 | checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" 1023 | dependencies = [ 1024 | "proc-macro2", 1025 | "quote", 1026 | "syn", 1027 | ] 1028 | 1029 | [[package]] 1030 | name = "thread_local" 1031 | version = "1.1.4" 1032 | source = "registry+https://github.com/rust-lang/crates.io-index" 1033 | checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" 1034 | dependencies = [ 1035 | "once_cell", 1036 | ] 1037 | 1038 | [[package]] 1039 | name = "time" 1040 | version = "0.3.17" 1041 | source = "registry+https://github.com/rust-lang/crates.io-index" 1042 | checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" 1043 | dependencies = [ 1044 | "itoa", 1045 | "serde", 1046 | "time-core", 1047 | "time-macros", 1048 | ] 1049 | 1050 | [[package]] 1051 | name = "time-core" 1052 | version = "0.1.0" 1053 | source = "registry+https://github.com/rust-lang/crates.io-index" 1054 | checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" 1055 | 1056 | [[package]] 1057 | name = "time-macros" 1058 | version = "0.2.6" 1059 | source = "registry+https://github.com/rust-lang/crates.io-index" 1060 | checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" 1061 | dependencies = [ 1062 | "time-core", 1063 | ] 1064 | 1065 | [[package]] 1066 | name = "toml" 1067 | version = "0.5.9" 1068 | source = "registry+https://github.com/rust-lang/crates.io-index" 1069 | checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" 1070 | dependencies = [ 1071 | "serde", 1072 | ] 1073 | 1074 | [[package]] 1075 | name = "typenum" 1076 | version = "1.15.0" 1077 | source = "registry+https://github.com/rust-lang/crates.io-index" 1078 | checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" 1079 | 1080 | [[package]] 1081 | name = "ucd-trie" 1082 | version = "0.1.5" 1083 | source = "registry+https://github.com/rust-lang/crates.io-index" 1084 | checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" 1085 | 1086 | [[package]] 1087 | name = "unicode-ident" 1088 | version = "1.0.5" 1089 | source = "registry+https://github.com/rust-lang/crates.io-index" 1090 | checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" 1091 | 1092 | [[package]] 1093 | name = "unicode-width" 1094 | version = "0.1.10" 1095 | source = "registry+https://github.com/rust-lang/crates.io-index" 1096 | checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" 1097 | 1098 | [[package]] 1099 | name = "version_check" 1100 | version = "0.9.4" 1101 | source = "registry+https://github.com/rust-lang/crates.io-index" 1102 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1103 | 1104 | [[package]] 1105 | name = "wasi" 1106 | version = "0.11.0+wasi-snapshot-preview1" 1107 | source = "registry+https://github.com/rust-lang/crates.io-index" 1108 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1109 | 1110 | [[package]] 1111 | name = "wasm-bindgen" 1112 | version = "0.2.83" 1113 | source = "registry+https://github.com/rust-lang/crates.io-index" 1114 | checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" 1115 | dependencies = [ 1116 | "cfg-if", 1117 | "wasm-bindgen-macro", 1118 | ] 1119 | 1120 | [[package]] 1121 | name = "wasm-bindgen-backend" 1122 | version = "0.2.83" 1123 | source = "registry+https://github.com/rust-lang/crates.io-index" 1124 | checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" 1125 | dependencies = [ 1126 | "bumpalo", 1127 | "log", 1128 | "once_cell", 1129 | "proc-macro2", 1130 | "quote", 1131 | "syn", 1132 | "wasm-bindgen-shared", 1133 | ] 1134 | 1135 | [[package]] 1136 | name = "wasm-bindgen-macro" 1137 | version = "0.2.83" 1138 | source = "registry+https://github.com/rust-lang/crates.io-index" 1139 | checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" 1140 | dependencies = [ 1141 | "quote", 1142 | "wasm-bindgen-macro-support", 1143 | ] 1144 | 1145 | [[package]] 1146 | name = "wasm-bindgen-macro-support" 1147 | version = "0.2.83" 1148 | source = "registry+https://github.com/rust-lang/crates.io-index" 1149 | checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" 1150 | dependencies = [ 1151 | "proc-macro2", 1152 | "quote", 1153 | "syn", 1154 | "wasm-bindgen-backend", 1155 | "wasm-bindgen-shared", 1156 | ] 1157 | 1158 | [[package]] 1159 | name = "wasm-bindgen-shared" 1160 | version = "0.2.83" 1161 | source = "registry+https://github.com/rust-lang/crates.io-index" 1162 | checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" 1163 | 1164 | [[package]] 1165 | name = "winapi" 1166 | version = "0.3.9" 1167 | source = "registry+https://github.com/rust-lang/crates.io-index" 1168 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1169 | dependencies = [ 1170 | "winapi-i686-pc-windows-gnu", 1171 | "winapi-x86_64-pc-windows-gnu", 1172 | ] 1173 | 1174 | [[package]] 1175 | name = "winapi-i686-pc-windows-gnu" 1176 | version = "0.4.0" 1177 | source = "registry+https://github.com/rust-lang/crates.io-index" 1178 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1179 | 1180 | [[package]] 1181 | name = "winapi-util" 1182 | version = "0.1.5" 1183 | source = "registry+https://github.com/rust-lang/crates.io-index" 1184 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 1185 | dependencies = [ 1186 | "winapi", 1187 | ] 1188 | 1189 | [[package]] 1190 | name = "winapi-x86_64-pc-windows-gnu" 1191 | version = "0.4.0" 1192 | source = "registry+https://github.com/rust-lang/crates.io-index" 1193 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1194 | 1195 | [[package]] 1196 | name = "windows-sys" 1197 | version = "0.42.0" 1198 | source = "registry+https://github.com/rust-lang/crates.io-index" 1199 | checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" 1200 | dependencies = [ 1201 | "windows_aarch64_gnullvm", 1202 | "windows_aarch64_msvc", 1203 | "windows_i686_gnu", 1204 | "windows_i686_msvc", 1205 | "windows_x86_64_gnu", 1206 | "windows_x86_64_gnullvm", 1207 | "windows_x86_64_msvc", 1208 | ] 1209 | 1210 | [[package]] 1211 | name = "windows_aarch64_gnullvm" 1212 | version = "0.42.0" 1213 | source = "registry+https://github.com/rust-lang/crates.io-index" 1214 | checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" 1215 | 1216 | [[package]] 1217 | name = "windows_aarch64_msvc" 1218 | version = "0.42.0" 1219 | source = "registry+https://github.com/rust-lang/crates.io-index" 1220 | checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" 1221 | 1222 | [[package]] 1223 | name = "windows_i686_gnu" 1224 | version = "0.42.0" 1225 | source = "registry+https://github.com/rust-lang/crates.io-index" 1226 | checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" 1227 | 1228 | [[package]] 1229 | name = "windows_i686_msvc" 1230 | version = "0.42.0" 1231 | source = "registry+https://github.com/rust-lang/crates.io-index" 1232 | checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" 1233 | 1234 | [[package]] 1235 | name = "windows_x86_64_gnu" 1236 | version = "0.42.0" 1237 | source = "registry+https://github.com/rust-lang/crates.io-index" 1238 | checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" 1239 | 1240 | [[package]] 1241 | name = "windows_x86_64_gnullvm" 1242 | version = "0.42.0" 1243 | source = "registry+https://github.com/rust-lang/crates.io-index" 1244 | checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" 1245 | 1246 | [[package]] 1247 | name = "windows_x86_64_msvc" 1248 | version = "0.42.0" 1249 | source = "registry+https://github.com/rust-lang/crates.io-index" 1250 | checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" 1251 | 1252 | [[package]] 1253 | name = "yaml-rust" 1254 | version = "0.4.5" 1255 | source = "registry+https://github.com/rust-lang/crates.io-index" 1256 | checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" 1257 | dependencies = [ 1258 | "linked-hash-map", 1259 | ] 1260 | --------------------------------------------------------------------------------