Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

main.rs 742 B

You have to be logged in to leave a comment. Sign In
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
  1. mod error;
  2. mod cleaning;
  3. mod tsv;
  4. mod db;
  5. mod logging;
  6. mod commands;
  7. use structopt::StructOpt;
  8. use std::io;
  9. use std::fs::File;
  10. use std::path::PathBuf;
  11. use indicatif::{ProgressBar, ProgressStyle};
  12. use error::Result;
  13. use logging::LogOpts;
  14. use commands::pcat;
  15. /// BookData import tools
  16. #[derive(StructOpt, Debug)]
  17. #[structopt(name="bookdata")]
  18. struct Opt {
  19. #[structopt(flatten)]
  20. logging: LogOpts,
  21. #[structopt(subcommand)]
  22. command: Command
  23. }
  24. #[derive(StructOpt, Debug)]
  25. #[allow(non_camel_case_types)]
  26. enum Command {
  27. /// Output a file with a progress bar
  28. pcat(pcat::Options)
  29. }
  30. fn main() -> Result<()> {
  31. let opt = Opt::from_args();
  32. opt.logging.init()?;
  33. match opt.command {
  34. Command::pcat(opts) => pcat::exec(opts)
  35. }
  36. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...