1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! Serial command CLI definitions
use clap::Subcommand;
use std::path::PathBuf;
#[derive(Subcommand)]
pub enum SerialCommand {
/// Decode an item serial number
Decode {
/// Item serial to decode (e.g. @Ugr$ZCm/&tH!t{KgK/Shxu>k)
serial: String,
/// Show detailed byte-by-byte breakdown
#[arg(short, long)]
verbose: bool,
/// Show bit-by-bit parsing debug output
#[arg(short, long)]
debug: bool,
/// Analyze first token bit structure for group ID research
#[arg(short, long)]
analyze: bool,
/// Path to parts database for resolving part names
#[arg(long, default_value = "share/manifest/parts_database.json")]
parts_db: PathBuf,
},
/// Re-encode a serial (for testing round-trip encoding)
Encode {
/// Item serial to decode and re-encode
serial: String,
},
/// Compare two item serials side by side
Compare {
/// First serial
serial1: String,
/// Second serial
serial2: String,
},
/// Modify a serial by swapping parts from another serial
Modify {
/// Base serial to modify
base: String,
/// Source serial to take parts from
source: String,
/// Part indices to copy from source (e.g. "4,12" for body and barrel)
parts: String,
},
/// Batch decode serials from a file to binary output
BatchDecode {
/// Input file with one serial per line
input: PathBuf,
/// Output binary file (length-prefixed records)
output: PathBuf,
},
}