72 lines
2.1 KiB
Rust
72 lines
2.1 KiB
Rust
// Workspace: config
|
|
// File: config/src/make.rs
|
|
//! Makepdf generation structs
|
|
|
|
use clap::ValueEnum;
|
|
use std::{collections::HashMap, fmt::Debug, sync::LazyLock};
|
|
|
|
/// List all blocktype
|
|
pub static HELP_BLOCK_SELECTION: LazyLock<String> = LazyLock::new(|| {
|
|
let mut targets = BLOCK_PROGRESSION
|
|
.keys()
|
|
.map(|v| v.to_owned())
|
|
.collect::<Vec<String>>();
|
|
targets.sort();
|
|
targets.join(", ").to_string()
|
|
});
|
|
|
|
/// The verbosity level
|
|
#[derive(ValueEnum, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
|
|
pub enum VerboseLevel {
|
|
/// Shouldn't be printed no matter what
|
|
None,
|
|
/// Garbage
|
|
Misc,
|
|
/// Boxness, barely above Misc
|
|
Box,
|
|
/// Context info (Debug info)
|
|
Context,
|
|
/// Usefull info
|
|
Info,
|
|
/// Important warnings
|
|
Warning,
|
|
/// Errors encountered requiring user input
|
|
Error,
|
|
/// Uncatchable errors
|
|
Critical,
|
|
/// Interactive prompt context, only useful in interactive mode
|
|
InteractiveContext,
|
|
/// Literrally uncatchable things
|
|
Uncatchable,
|
|
}
|
|
|
|
/// All progress bar styles
|
|
pub static BLOCK_PROGRESSION: LazyLock<HashMap<String, String>> = LazyLock::new(|| {
|
|
let mut m = HashMap::new();
|
|
m.insert("class".to_string(), "#>-".to_string());
|
|
m.insert("cargo".to_string(), "#> ".to_string());
|
|
m.insert("rough".to_string(), "█ ".to_string());
|
|
m.insert("fine".to_string(), "█▉▊▋▌▍▎▏ ".to_string());
|
|
m.insert("vert".to_string(), "█▇▆▅▄▃▂▁ ".to_string());
|
|
m.insert("fade".to_string(), "█▓▒░ ".to_string());
|
|
m.insert("block".to_string(), "█▛▌▖ ".to_string());
|
|
m.insert("curse".to_string(), "▓▙▚▐▔ ▛▘▖▄▟▞▂█".to_string());
|
|
m.insert("load".to_string(), " ⱠØ₳Đł₦₲ ".to_string());
|
|
m.insert("cool".to_string(), "▰▱".to_string());
|
|
m.insert("neo".to_string(), "▰═".to_string());
|
|
m
|
|
});
|
|
|
|
/// List of all alternative targets
|
|
#[derive(ValueEnum, Debug, Clone)]
|
|
pub enum MakeTargets {
|
|
/// Make all targets
|
|
All,
|
|
/// Make a list of all optionals
|
|
List,
|
|
/// Make glossaries
|
|
Glossaries,
|
|
/// Make the working directory clean
|
|
Clean,
|
|
}
|