aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorA Farzat <a@farzat.xyz>2026-03-01 16:52:14 +0300
committerA Farzat <a@farzat.xyz>2026-03-01 16:53:11 +0300
commitb0e66713529bd1cdac39d73fd06d37731b58882c (patch)
tree7a66f819f56645895bac69af1bd41ee3f671c78f /src
downloadoreilly-epub-b0e66713529bd1cdac39d73fd06d37731b58882c.tar.gz
oreilly-epub-b0e66713529bd1cdac39d73fd06d37731b58882c.zip
Init commit: setup project and cli parsing
Diffstat (limited to 'src')
-rw-r--r--src/main.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..998cc1f
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,28 @@
+use clap::Parser;
+
+/// Download and generate an EPUB from Safari Books Online.
+#[derive(Parser, Debug)]
+#[command(author, version, about, long_about = None)]
+struct Args {
+ /// The Book digits ID that you want to download.
+ #[arg(required = true)]
+ bookid: String,
+
+ /// Do not delete the log file on success.
+ #[arg(long = "preserve-log")]
+ preserve_log: bool,
+}
+
+fn main() {
+ // Parse the command line arguments
+ let args = Args::parse();
+
+ println!("Welcome to SafariBooks Rust Port!");
+ println!("Target Book ID: {}", args.bookid);
+
+ if args.preserve_log {
+ println!("Logs will be preserved");
+ }
+
+ // TODO: Proceed to load cookies and setup the HTTP client...
+}