aboutsummaryrefslogtreecommitdiff
path: root/docs/example-pages/examples.json
blob: 8e8719b5ad2f57bcf29a1062f585497da9510b2e (plain) (blame)
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
[
  {
    "id": "example-basic",
    "name": "Basic",
    "icon": "🚀",
    "category": "core",
    "desc": "Demonstrates the basic usage of Mingling with a simple `greet` subcommand that takes a name and prints a greeting.\n",
    "tags": [
      "dispatcher!",
      "#[chain]",
      "#[renderer]"
    ],
    "files": [
      "src/main.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "example-argument-parse",
    "name": "Argument Parse",
    "icon": "📋",
    "category": "parsing",
    "desc": "Shows how to use Mingling's `parser` feature with a `Picker` to extract and validate typed arguments from the command line.\n",
    "tags": [
      "pick",
      "Pickable"
    ],
    "files": [
      "src/main.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "example-async-support",
    "name": "Async Support",
    "icon": "⚡",
    "category": "runtime",
    "desc": "Shows how to drive an async runtime with Mingling using the `async` feature, enabling `async fn` in `#[chain]` with tokio.\n",
    "tags": [
      "async",
      "await",
      "#[chain]"
    ],
    "files": [
      "src/main.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "example-clap-binding",
    "name": "Clap Binding",
    "icon": "🔗",
    "category": "parsing",
    "desc": "Demonstrates how to bind a `clap::Parser` derive struct to Mingling using `#[dispatcher_clap]` for advanced argument parsing.\n",
    "tags": [
      "clap"
    ],
    "files": [
      "src/main.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "example-completion",
    "name": "Completion",
    "icon": "🔄",
    "category": "ux",
    "desc": "Demonstrates how to implement dynamic shell completion with `#[completion]` and generate scripts for bash, zsh, fish, and pwsh.\n",
    "tags": [
      "comp"
    ],
    "files": [
      "src/main.rs",
      "build.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "example-custom-pickable",
    "name": "Custom Pickable",
    "icon": "🎯",
    "category": "parsing",
    "desc": "Shows how to implement the `Pickable` trait on custom types for seamless extraction from CLI arguments via Picker.\n",
    "tags": [
      "Pickable",
      "custom"
    ],
    "files": [
      "src/main.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "example-dispatch-tree",
    "name": "Dispatch Tree",
    "icon": "🌳",
    "category": "dispatch",
    "desc": "Introduces the `dispatch_tree` feature that converts the subcommand list into a compile-time prefix trie for O(n) command lookup.\n",
    "tags": [
      "dispatch_tree"
    ],
    "files": [
      "src/main.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "example-enum-tag",
    "name": "Enum Tag",
    "icon": "🏷️",
    "category": "parsing",
    "desc": "Shows how to derive `EnumTag` on enums for parsing variants from CLI strings with renames and descriptions.\n",
    "tags": [
      "enum_tag",
      "Pickable"
    ],
    "files": [
      "src/main.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "example-error-handling",
    "name": "Error Handling",
    "icon": "⚠️",
    "category": "runtime",
    "desc": "Demonstrates how to define custom error types with `pack!` and route them to dedicated `#[renderer]` functions for user-friendly output.\n",
    "tags": [
      "Result"
    ],
    "files": [
      "src/main.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "example-exitcode",
    "name": "Exitcode",
    "icon": "🚪",
    "category": "runtime",
    "desc": "Shows how to set custom exit codes using `ExitCodeSetup` and the `finish` hook to signal success or failure to the shell.\n",
    "tags": [
      "ExitCode"
    ],
    "files": [
      "src/main.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "example-general-renderer",
    "name": "General Renderer",
    "icon": "📤",
    "category": "output",
    "desc": "Demonstrates how to render structured output in JSON or YAML using `GeneralRendererSetup` and the `general_renderer` feature.\n",
    "tags": [
      "general_renderer",
      "--json",
      "--yaml"
    ],
    "files": [
      "src/main.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "example-help",
    "name": "Help",
    "icon": "💡",
    "category": "ux",
    "desc": "Shows how to use the `#[help]` attribute to provide custom per-command help text that activates when the user passes `--help`.\n",
    "tags": [
      "#[help]"
    ],
    "files": [
      "src/main.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "example-hook",
    "name": "Hook",
    "icon": "🪝",
    "category": "runtime",
    "desc": "Demonstrates how to use Mingling's `ProgramHook` system to observe and debug every stage of the execution pipeline.\n",
    "tags": [
      "ProgramHook"
    ],
    "files": [
      "src/main.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "example-implicit-dispatcher",
    "name": "Implicit Dispatcher",
    "icon": "🫥",
    "category": "dispatch",
    "desc": "Shows the abbreviated `dispatcher!(\"cmd.path\")` syntax from `extra_macros` that auto-derives struct names from the command path.\n",
    "tags": [
      "implicit"
    ],
    "files": [
      "src/main.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "example-lazy-resources",
    "name": "Lazy Resources",
    "icon": "💤️",
    "category": "advanced",
    "desc": "Demonstrates how to use `LazyRes<T>` for lazily initialized resources that only allocate when first accessed.\n",
    "tags": [
      "LazyRes<Res>"
    ],
    "files": [
      "src/main.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "example-pack-err",
    "name": "pack_err!",
    "icon": "🛑",
    "category": "macros",
    "desc": "Demonstrates how to use the `pack_err!` macro to define error types with automatic `name` field (snake_case at compile time) and optional `info` field. Also shows `--json` serialization when `general_renderer` is enabled.\n",
    "tags": [
      "pack_err!",
      "extra_macros",
      "general_renderer",
      "--json"
    ],
    "files": [
      "src/main.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "example-panic-unwind",
    "name": "Panic Unwind",
    "icon": "💥",
    "category": "runtime",
    "desc": "Shows how to catch panics during program execution and display friendly error messages instead of a raw panic trace.\n",
    "tags": [
      "panic_unwind"
    ],
    "files": [
      "src/main.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "example-repl-basic",
    "name": "REPL Basic",
    "icon": "🔁",
    "category": "repl",
    "desc": "Demonstrates how to build an interactive REPL shell with Mingling using `exec_repl()`, custom prompts, and built-in setups.\n",
    "tags": [
      "repl"
    ],
    "files": [
      "src/main.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "example-resources",
    "name": "Resources",
    "icon": "📦",
    "category": "advanced",
    "desc": "Shows how to share global state across commands using `with_resource()` and inject `&T` or `&mut T` into chain and renderer functions.\n",
    "tags": [
      "Resources",
      "injection"
    ],
    "files": [
      "src/main.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "example-setup",
    "name": "Setup",
    "icon": "🏗️",
    "category": "core",
    "desc": "Demonstrates how to build a custom `ProgramSetup` with `#[program_setup]` for modular configuration of program behaviour.\n",
    "tags": [
      "#[setup]",
      "extra_macros"
    ],
    "files": [
      "src/main.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "example-unit-test",
    "name": "Unit Test",
    "icon": "🧪",
    "category": "testing",
    "desc": "Shows how to write unit tests for Chain and Renderer functions using the `entry!` macro and assertion helpers.\n",
    "tags": [
      "testing",
      "extra_macros"
    ],
    "files": [
      "src/main.rs",
      "Cargo.toml"
    ]
  },
  {
    "id": "full-todolist",
    "name": "Todo List",
    "icon": "📝",
    "category": "full",
    "desc": "This is a complete example project that demonstrates how to develop a todo list application using Mingling\n",
    "tags": [
      "todolist",
      "CRUD",
      "cliché example"
    ],
    "files": [
      "src/main.rs",
      "src/todolist.rs",
      "src/help.rs",
      "Cargo.toml"
    ]
  }
]