aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-11-11 20:17:18 +0100
committerTeddy Wing2018-11-11 20:17:18 +0100
commita89f69e713e66535abc38b36e7de6ebfee9f650d (patch)
tree910505118b72f87982ed34f4f444b8e60db11a62
parent394151a2d0a433c6c5b72e23b36c4725ee2ab6bf (diff)
downloaddome-key-web-a89f69e713e66535abc38b36e7de6ebfee9f650d.tar.bz2
Add `src/bin/aquatic-prime.rs`
Binary to generate a license plist.
-rw-r--r--license-generator/Cargo.lock3
-rw-r--r--license-generator/Cargo.toml3
-rw-r--r--license-generator/src/bin/aquatic-prime.rs33
3 files changed, 39 insertions, 0 deletions
diff --git a/license-generator/Cargo.lock b/license-generator/Cargo.lock
index 4540e25..11725de 100644
--- a/license-generator/Cargo.lock
+++ b/license-generator/Cargo.lock
@@ -282,12 +282,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "license-generator"
version = "0.0.1"
dependencies = [
+ "aquatic-prime 0.0.1",
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fastcgi 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"mysql 14.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"paddle 0.0.1",
"rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
+ "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
"sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"simplelog 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
diff --git a/license-generator/Cargo.toml b/license-generator/Cargo.toml
index b50bec1..80c1963 100644
--- a/license-generator/Cargo.toml
+++ b/license-generator/Cargo.toml
@@ -3,6 +3,7 @@ name = "license-generator"
version = "0.0.1"
[dependencies]
+aquatic-prime = { path = "aquatic-prime" }
error-chain = "0.12.0"
fastcgi = "1.0.0"
log = "0.4.6"
@@ -10,6 +11,8 @@ mysql = "14.1.1"
paddle = { path = "paddle" }
rand = "0.5.5"
sha1 = { version = "0.6.0", features = ["std"] }
+serde = "1.0.80"
+serde_derive = "1.0.80"
simplelog = "0.5.3"
url = "1.7.2"
diff --git a/license-generator/src/bin/aquatic-prime.rs b/license-generator/src/bin/aquatic-prime.rs
new file mode 100644
index 0000000..5864a01
--- /dev/null
+++ b/license-generator/src/bin/aquatic-prime.rs
@@ -0,0 +1,33 @@
+extern crate aquatic_prime;
+extern crate serde;
+
+#[macro_use]
+extern crate serde_derive;
+
+use std::env;
+
+use aquatic_prime::AquaticPrime;
+
+#[derive(Serialize)]
+struct LicenseData<'a> {
+ #[serde(rename = "Name")]
+ name: &'a str,
+
+ #[serde(rename = "Email")]
+ email: &'a str,
+}
+
+fn main() {
+ let args: Vec<String> = env::args().collect();
+
+ let aquatic_prime = AquaticPrime::new(&args[1], &args[2]);
+
+ let license_data = LicenseData {
+ name: &args[3],
+ email: &args[4],
+ };
+
+ let plist = aquatic_prime.plist(license_data).unwrap();
+
+ println!("{}", plist);
+}