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.

31 lines
660B

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