1#![doc(html_favicon_url = "https://zng-ui.github.io/res/zng-logo-icon.png")]
2#![doc(html_logo_url = "https://zng-ui.github.io/res/zng-logo.png")]
3#![doc = include_str!(concat!("../", std::env!("CARGO_PKG_README")))]
9#![warn(unused_extern_crates)]
10#![warn(missing_docs)]
11
12#[macro_use]
13mod util;
14mod fmt;
15mod l10n;
16mod new;
17mod res;
18mod trace;
19
20pub mod res_tool_util {
24 pub use crate::res::built_in::{
25 ZR_APP, ZR_CACHE_DIR, ZR_CRATE_NAME, ZR_DESCRIPTION, ZR_FINAL, ZR_HELP, ZR_HOMEPAGE, ZR_LICENSE, ZR_ORG, ZR_PKG_AUTHORS,
26 ZR_PKG_NAME, ZR_QUALIFIER, ZR_REQUEST, ZR_REQUEST_DD, ZR_SOURCE_DIR, ZR_TARGET, ZR_TARGET_DD, ZR_TARGET_DIR, ZR_VERSION,
27 ZR_WORKSPACE_DIR, display_path, path,
28 };
29}
30
31use clap::*;
32
33#[derive(Parser)] #[command(name = "cargo")]
35#[command(bin_name = "cargo")]
36enum CargoCli {
37 Zng(Zng),
38}
39
40#[derive(Args, Debug)]
41#[command(author, version, about, long_about = None)]
42#[command(propagate_version = true)]
43struct Zng {
44 #[command(subcommand)]
46 pub command: Command,
47}
48
49#[derive(Subcommand, Debug)]
50enum Command {
51 Fmt(fmt::FmtArgs),
55 New(new::NewArgs),
57 L10n(l10n::L10nArgs),
61
62 Res(res::ResArgs),
67
68 Trace(trace::TraceArgs),
72}
73
74fn main() {
75 res::built_in::run();
76
77 let CargoCli::Zng(cli) = CargoCli::parse();
78
79 match cli.command {
80 Command::Fmt(args) => fmt::run(args),
81 Command::New(args) => new::run(args),
82 Command::L10n(args) => l10n::run(args),
83 Command::Res(args) => res::run(args),
84 Command::Trace(args) => trace::run(args),
85 }
86
87 crate::util::exit();
88}