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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(author, version, about)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
Create {
/// Name of the datapack (creates folder with this name)
name: Option<String>,
/// Description of the datapack
#[arg(short, long)]
description: Option<String>,
/// Path to pack icon (must be PNG)
#[arg(short, long, group = "icon_handling")]
icon: Option<String>,
/// Pack format(s) to support (space-separated list)
#[arg(short = 'f', long = "format", num_args = 1.., value_delimiter = ' ')]
format: Option<Vec<String>>,
/// Include minecraft namespace folder
#[arg(
short = 'm',
long,
group = "mc_namespace",
group = "minecraft_handling"
)]
minecraft: bool,
/// Include template minecraft load.mcfunction tag
#[arg(long = "load", requires = "minecraft")]
minecraft_load: bool,
/// Include template minecraft tick.mcfunction tag
#[arg(long = "tick", requires = "minecraft")]
minecraft_tick: bool,
/// Custom namespace name
#[arg(short, long, group = "namespace_handling")]
namespace: Option<String>,
/// Starter folder files to create in custom namespace (space-separated list)
#[arg(short = 's', long = "starters", num_args = 1.., value_delimiter = ' ', requires = "namespace")]
folders: Option<Vec<String>>,
/// Output directory for the datapack
#[arg(short = 'o', long)]
output_dir: Option<String>,
/// Force overwrite existing directory without prompting
#[arg(short = 'F', long)]
force: bool,
/// Skip pack icon prompt
#[arg(long = "no-icon", group = "icon_handling")]
skip_icon: bool,
/// Skip starter files creation for custom namespace
#[arg(
long = "no-starters",
conflicts_with = "folders" // Removed from "namespace_handling" group
)]
skip_starters: bool,
/// Skip minecraft tags selection
#[arg(long = "no-minecraft-tags", group = "minecraft_handling")]
skip_minecraft_tags: bool,
},
Info {
/// Path to datapack folder or zip file
path: Option<String>,
/// Show only basic information (name, description, pack format)
#[arg(long, group = "display_mode")]
compact: bool,
/// Show only pack.mcmeta information
#[arg(long, group = "display_mode")]
pack_info: bool,
/// Show only namespace information
#[arg(long, group = "display_mode")]
namespaces: bool,
},
Zip {
/// Path to datapack folder
path: Option<String>,
/// Input directory containing the unzipped datapack
#[arg(short = 'i', long)]
input_dir: Option<String>,
/// Custom name for the output zip file
#[arg(short = 'n', long)]
name: Option<String>,
/// Output directory for the zip file
#[arg(short = 'o', long)]
output_dir: Option<String>,
/// Force overwrite existing zip file without prompting
#[arg(short = 'F', long)]
force: bool,
},
Add {
/// Type of element to add (e.g., function, advancement, loot_table)
#[arg(short, long)]
element: Option<String>,
/// Path to datapack directory
#[arg(short, long)]
path: Option<String>,
/// Name of the namespace to add element to
#[arg(short = 'x', long)]
namespace: Option<String>,
/// Path and name for the new file (supports subdirectories)
#[arg(short, long)]
name: Option<String>,
/// Force overwrite existing files without prompting
#[arg(short = 'F', long)]
force: bool,
},
}