Slop cleanup

This commit is contained in:
Dandaedre 2025-12-15 03:41:56 +01:00
parent 43fccdd4c6
commit e85e47971f
6 changed files with 38 additions and 38 deletions

View File

@ -6,9 +6,9 @@
//!
//! ## Summary
//!
//! | Sub‑command | Usage | What it changes |
//! | Sub-command | Usage | What it changes |
//! |-------------|-------|-----------------|
//! | **add** | `<entity> add [OPTIONS] [IDENTIFIER]` | Creates a new `<entity>`, pushes it to the epoch’s list, and writes the epoch. |
//! | **add** | `<entity> add [OPTIONS] [IDENTIFIER]` | Creates a new `<entity>`, pushes it to the epoch's list, and writes the epoch. |
//! | **del** | `<entity> del <IDENTIFIER>` | Removes the matching `<entity>` from the list and writes the epoch. |
//! | **edit** | `<entity> edit <IDENTIFIER> [OPTIONS]` | Modifies the stats/position/duration/effect/bounds of the chosen `<entity>` and writes the epoch. |
//! | **find** | `<entity> find <IDENTIFIER>` | Prints full details of a single `<entity>`. |
@ -26,11 +26,11 @@
//! instead of an absolute overwrite. |
//! | `-v, --verbose…` | *global* | Increases the amount of diagnostic output. |
//! | `--rng <RNG>` | *add/edit* | How to initialise *missing* stats. Possible values: `zero`, `low`, `med`, `high`, `legendary`, `mixed`, `flawed`. Default: `zero`. |
//! | `--pos-exact <POS>` / `--pos <POS>` | *add/edit* | Set the entity’s coordinates. `--pos-exact` forces the coordinates to be used verbatim; `--pos` applies the map’s current position transformation (if any). |
//! | `--duration <DURATION>` | *add/edit* | Lifespan of the entity – e.g. `Permanent`, `Temporary` or `Duration(1)` for a one‑turn event. |
//! | `--pos-exact <POS>` / `--pos <POS>` | *add/edit* | Set the entity's coordinates. `--pos-exact` forces the coordinates to be used verbatim; `--pos` applies the map's current position transformation (if any). |
//! | `--duration <DURATION>` | *add/edit* | Lifespan of the entity - e.g. `Permanent`, `Temporary` or `Duration(1)` for a one-turn event. |
//! | `--bounds <BOUNDS>` | *add/edit* | Effect limits in the form `min,max` (e.g. `10,80`). |
//! | `--effect <EFFECT>` | *add/edit* | How the effect is applied: `recurring`, `when-present`, `permanent-effect-to-apply`, `permanent-effect-applied`. |
//! | `-s, --stats <STATS>` | *add/edit* | One or more `key:value` pairs – e.g. `fod:10 military:8`. |
//! | `-s, --stats <STATS>` | *add/edit* | One or more `key:value` pairs - e.g. `fod:10 military:8`. |
//! | `--rng-name` | *add* | If set, the tool generates a random name instead of using the supplied identifier. |
//!
//! All changes are **persisted immediately** to the epoch file after the
@ -62,7 +62,7 @@
//! chr diff Aria
//! ```
//!
//! > **Tip** – `<entity> diff` automatically loads the current epoch and the previous one, so you don’t need to specify epoch numbers.
//! > **Tip** - `<entity> diff` automatically loads the current epoch and the previous one, so you don't need to specify epoch numbers.
//!
//! *All changes are persisted immediately to the epoch file after the command finishes.*
#![warn(unused_attributes)]
@ -91,7 +91,7 @@ mod helper_functions;
///
/// Each variant contains the arguments that are common to that
/// operation. The enum itself is used by `clap` to dispatch
/// the user‑provided sub‑command.
/// the user-provided sub-command.
#[derive(Subcommand, Debug)]
pub(crate) enum EntitySubCommands {
// /// Find an entity by its identifier
@ -108,7 +108,7 @@ pub(crate) enum EntitySubCommands {
Diff(DiffArgs),
}
/// Arguments used only for the `diff` sub‑command.
/// Arguments used only for the `diff` sub-command.
#[derive(Args, Debug)]
pub(crate) struct DiffArgs {
/// Identifier (name or `@tag`) of the entity to diff
@ -130,7 +130,7 @@ pub(crate) struct DelArgs {
/// Arguments for showing entities.
#[derive(Args, Debug)]
pub(crate) struct ShowArgs {
/// Optional identifier – when omitted all entities are listed.
/// Optional identifier - when omitted all entities are listed.
pub identifier: Option<EntityIdentifier>,
/// Filter by faction id (used only when an identifier is supplied)
@ -198,7 +198,7 @@ pub struct CommonArgs {
#[arg(short = 'e', long)]
pub effect: Option<EffectApplication>,
/// One or more `key:value` pairs that modify the entity’s stats.
/// One or more `key:value` pairs that modify the entity's stats.
#[arg(short = 's', long, num_args = 1..)]
pub stats: Vec<stats::StatPair>,

View File

@ -90,12 +90,12 @@ pub(crate) fn update_defaults(entity_args: &AddArgs, e: &mut Entity) {
/// Apply a `CommonArgs` bundle to an existing entity.
///
/// # Parameters
/// * `entity_args` – A set of common arguments that may specify
/// * `entity_args` - A set of common arguments that may specify
/// duration, effect application, bounds, position, and faction.
/// * `position` – An optional `stats::Position`. If `Some`, it
/// * `position` - An optional `stats::Position`. If `Some`, it
/// overrides the position supplied in `entity_args`. Passing
/// `None` leaves the entity’s position untouched.
/// * `entity` – The mutable entity to update.
/// `None` leaves the entity's position untouched.
/// * `entity` - The mutable entity to update.
pub fn update_common_values(
entity_args: &CommonArgs,
position: Option<stats::Position>,

View File

@ -1,9 +1,9 @@
//! # `epoch` sub-command
//!
//! The `epoch` sub‑command is the single entry point for all epoch‑related
//! The `epoch` sub-command is the single entry point for all epoch-related
//! operations in **efo**.
//! An *epoch* represents a point in the simulated world’s history.
//! The command lets you inspect, advance, modify and sanity‑check the epoch
//! An *epoch* represents a point in the simulated world's history.
//! The command lets you inspect, advance, modify and sanity-check the epoch
//! timeline.
//!
//! ### Usage
@ -24,7 +24,7 @@
//! # Add a unique tag to the current epoch
//! efo epoch tag milestone1
//!
//! # Replace the current epoch’s summary
//! # Replace the current epoch's summary
//! efo epoch summary "Reached the new frontier"
//!
//! # (Future) Check consistency
@ -33,15 +33,15 @@
//!
//! ### Summary
//!
//! | Sub‑command | Usage | What it changes |
//! | Sub-command | Usage | What it changes |
//! |-------------|-------|-----------------|
//! | `log` | `efo epoch log [--limit N]` | Prints the chronological list of epochs up to the current one. |
//! | `switch` | `efo epoch switch <id>` | Sets the current epoch to the specified `<id>` (must already exist). |
//! | `next` | `efo epoch next` | Generates the next scheduled epoch and inserts it. |
//! | `reset` | `efo epoch reset` | Deletes all epochs with an identifier greater than the current one. |
//! | `diff` | `efo epoch diff <id1> <id2>` | *Unimplemented* – placeholder for future diffing logic. |
//! | `diff` | `efo epoch diff <id1> <id2>` | *Unimplemented* - placeholder for future diffing logic. |
//! | `tag` | `efo epoch tag <TAG>` | Adds a unique tag to the current epoch, updating the global tag map. |
//! | `fsck` | `efo epoch fsck` | *Unimplemented* – intended to run a consistency check. |
//! | `fsck` | `efo epoch fsck` | *Unimplemented* - intended to run a consistency check. |
//! | `summary` | `efo epoch summary <text>` | Replaces the `summary` field of the current epoch with `<text>`. |
//!

View File

@ -7,21 +7,21 @@
//!
//! ## Available sub-commands
//!
//! | Sub‑command | What it prints | Typical output |
//! | Sub-command | What it prints | Typical output |
//! |-------------|----------------|----------------|
//! | `character` | Character names (short or long) | `Eldric the Bold` |
//! | `event` | Random event ideas | `A mysterious fog descends over the town` |
//! | `town` | Town names | `Glimmerdale` |
//! | `exotic` | Exotic character names | `Zar‑nith the Wanderer` |
//! | `exotic` | Exotic character names | `Zar-nith the Wanderer` |
//! | `calamity` | Calamity names | `Great Plague of 1743` |
//! | `blocker` | Blocker names | `Stone Wall of the North` |
//!
//! All sub‑commands share the same options:
//! All sub-commands share the same options:
//!
//! * `-n / --number` – how many items to generate (default = 1)
//! * `--short` – print the short form when applicable (ignored for `event`, `exotic`,
//! * `-n / --number` - how many items to generate (default = 1)
//! * `--short` - print the short form when applicable (ignored for `event`, `exotic`,
//! `calamity`, `blocker`)
//! * `--name` – output only the name string, no extra formatting (good for scripting)
//! * `--name` - output only the name string, no extra formatting (good for scripting)
//!
//! # Usage
//! ```bash
@ -44,13 +44,13 @@
//! gen blocker -n 4 --short
//! ```
//!
//! > **Tip** – redirect or pipe the output:
//! > **Tip** - redirect or pipe the output:
//! > `gen character -n 10 > chars.txt`
//!
//! ---
//!
//! # Summary
//! | Sub‑command | Usage example | What it does |
//! | Sub-command | Usage example | What it does |
//! |-------------|---------------|-----------------|
//! | `character` | `gen character -n 5 --short` | Prints 5 short (or long if `--short` omitted) character names |
//! | `event` | `gen event -n 3 --name` | Prints 3 event names only |
@ -59,7 +59,7 @@
//! | `calamity` | `gen calamity -n 2` | Prints 2 calamity names |
//! | `blocker` | `gen blocker -n 4 --short` | Prints 4 blocker names (short form) |
//!
//! *All sub‑commands simply output the generated data; they do not alter any files or state.*
//! *All sub-commands simply output the generated data; they do not alter any files or state.*
use clap::{Args, Subcommand};
use lib_efo::{Displayable, error::EpochError, naming::NAMING};

View File

@ -11,7 +11,7 @@
//!
//! ## Guide
//!
//! The `init` sub‑command bootstraps a new epoch repository:
//! The `init` sub-command bootstraps a new epoch repository:
//!
//! * It creates the default `.epoch` configuration file in the current directory.
//! * It creates an empty **epoch 0** folder (with its metadata file).
@ -20,13 +20,13 @@
//! ### How to use
//!
//! ```bash
//! epoch init # normal init – directory must be empty
//! epoch init --force # skip the empty‑folder check
//! epoch init # normal init - directory must be empty
//! epoch init --force # skip the empty-folder check
//! ```
//!
//! ### Table Entry
//!
//! | Sub‑command | Usage | What it changes |
//! | Sub-command | Usage | What it changes |
//! |-------------|-------|-----------------|
//! | `init` | `epoch init [--force]` | Initialize the current folder as an epoch folder |

View File

@ -1,9 +1,9 @@
//! # `epoch_forge` CLI
//!
//! The **command‑line interface** for `epoch_forge`. It exposes a single
//! binary `efo` that supports the following sub‑commands:
//! The **command-line interface** for `epoch_forge`. It exposes a single
//! binary `efo` that supports the following sub-commands:
//!
//! ## Sub‑modules
//! ## Sub-modules
//!
//! * [`epoch`](crate::commands::epoch) - switch / advance time
//! * [`event`](crate::commands::entity_generic) - add / remove events
@ -13,7 +13,7 @@
//! * [`calamity`](crate::commands::entity_generic) - add / remove calamities
//! * [`link`](crate::commands::link) - add / remove links (alliances, wars, roads, etc.)
//!
//! Each sub‑command is implemented in its own module under `commands/`.
//! Each sub-command is implemented in its own module under `commands/`.
//! The `main.rs` file simply parses arguments with `clap` and dispatches
//! to the appropriate handler. The handlers share a common `World`
//! instance that they load from / persist to disk.