summaryrefslogtreecommitdiff
path: root/src/bin/subplot.rs
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2021-09-05 14:46:49 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2021-09-05 14:46:49 +0100
commit38cfe0b12b45d703375682cce5b45fbbbe2fce07 (patch)
treea3395f0cdcd371123f2f4472a230d7337cc21534 /src/bin/subplot.rs
parent52293448680bbbd81c78bc7b6c1350d034d6b660 (diff)
downloadsubplot-38cfe0b12b45d703375682cce5b45fbbbe2fce07.tar.gz
resources: Hidden subcommand to list internal resources
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'src/bin/subplot.rs')
-rw-r--r--src/bin/subplot.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/bin/subplot.rs b/src/bin/subplot.rs
index d4685da..b8524e1 100644
--- a/src/bin/subplot.rs
+++ b/src/bin/subplot.rs
@@ -55,6 +55,7 @@ enum Cmd {
Metadata(Metadata),
Docgen(Docgen),
Codegen(Codegen),
+ Resources(Resources),
}
impl Cmd {
@@ -65,6 +66,7 @@ impl Cmd {
Cmd::Metadata(m) => m.run(),
Cmd::Docgen(d) => d.run(),
Cmd::Codegen(c) => c.run(),
+ Cmd::Resources(r) => r.run(),
}
}
@@ -75,6 +77,7 @@ impl Cmd {
Cmd::Metadata(m) => m.doc_path(),
Cmd::Docgen(d) => d.doc_path(),
Cmd::Codegen(c) => c.doc_path(),
+ Cmd::Resources(r) => r.doc_path(),
}
}
}
@@ -107,6 +110,22 @@ fn long_version() -> Result<String> {
}
#[derive(Debug, StructOpt)]
+/// Examine embedded resources built into Subplot
+#[structopt(setting = structopt::clap::AppSettings::Hidden)]
+struct Resources {}
+
+impl Resources {
+ fn doc_path(&self) -> Option<&Path> {
+ None
+ }
+ fn run(&self) -> Result<()> {
+ for (name, bytes) in subplot::resource::embedded_files() {
+ println!("{} {} bytes", name, bytes.len());
+ }
+ Ok(())
+ }
+}
+#[derive(Debug, StructOpt)]
/// Extract embedded files from a subplot document
///
/// If no embedded filenames are provided, this will