ravenous-tools/crates/config/src/tablegen.rs

66 lines
2.0 KiB
Rust

// Workspace: config
// File: config/src/tablegen.rs
//! Table generation structs
use clap::{Args, ValueEnum};
use serde::Deserialize;
/// An enumeration representing different target types.
#[derive(ValueEnum, Debug, Clone)]
pub enum TableGenerationTarget {
/// Processes all classes
Classes,
/// Processes all the craft tables
Craft,
/// Processes only the given files
Files,
/// Processes all the known targets
All,
}
/// Configuration options for processing TSV files and generating LaTeX tables.
#[derive(Debug, Args)]
pub struct TableArgs {
/// Wether to export all files (if used), or output everything to stdout
#[arg(short)]
pub export: bool,
/// The kind of tables to operate on: classes, craft or files followed by a list of files
pub kind: TableGenerationTarget,
/// A vector of strings representing the names of TSV files to process.
pub filenames: Vec<String>,
}
// This config can contain unconstructed code for compatibility purposes
#[allow(dead_code)]
#[derive(Deserialize)]
/// The Craft configs
pub struct Craft {
/// The food header string formatter
pub header_food: String,
/// The alchemy header string formatter
pub header_alchemy: String,
/// The forge header string formatter
pub header_forge: String,
/// The mtrap header string formatter
pub header_mtrap: String,
/// The weapons header string formatter
pub header_weapons: String,
/// The armors header string formatter
pub header_armors: String,
/// The gadgets header string formatter
pub header_gadgets: String,
/// The potions header string formatter
pub header_potions: String,
/// The traps header string formatter
pub header_traps: String,
/// The table end string formatter
pub end: String,
/// The long table end string formatter
pub end_long: String,
/// The long sideways table end string formatter
pub end_long_side: String,
/// The no_headers table end string formatter
pub end_empty: String,
}