You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lib.rs 691B

6 years ago
5 years ago
1234567891011121314151617181920212223242526272829303132
  1. #[macro_use]
  2. extern crate serde_derive;
  3. extern crate chrono;
  4. extern crate globset;
  5. extern crate toml;
  6. #[macro_use]
  7. extern crate lazy_static;
  8. extern crate syntect;
  9. #[macro_use]
  10. extern crate errors;
  11. extern crate utils;
  12. mod config;
  13. pub mod highlighting;
  14. mod theme;
  15. pub use config::{Config, Language, Taxonomy};
  16. use std::path::Path;
  17. /// Get and parse the config.
  18. /// If it doesn't succeed, exit
  19. pub fn get_config(path: &Path, filename: &str) -> Config {
  20. match Config::from_file(path.join(filename)) {
  21. Ok(c) => c,
  22. Err(e) => {
  23. println!("Failed to load {}", filename);
  24. println!("Error: {}", e);
  25. ::std::process::exit(1);
  26. }
  27. }
  28. }