equal
deleted
inserted
replaced
299 pub enum ConfigOrigin { |
299 pub enum ConfigOrigin { |
300 /// From a configuration file |
300 /// From a configuration file |
301 File(PathBuf), |
301 File(PathBuf), |
302 /// From a `--config` CLI argument |
302 /// From a `--config` CLI argument |
303 CommandLine, |
303 CommandLine, |
|
304 /// From a `--color` CLI argument |
|
305 CommandLineColor, |
304 /// From environment variables like `$PAGER` or `$EDITOR` |
306 /// From environment variables like `$PAGER` or `$EDITOR` |
305 Environment(Vec<u8>), |
307 Environment(Vec<u8>), |
306 /* TODO cli |
308 /* TODO defaults (configitems.py) |
307 * TODO defaults (configitems.py) |
|
308 * TODO extensions |
309 * TODO extensions |
309 * TODO Python resources? |
310 * TODO Python resources? |
310 * Others? */ |
311 * Others? */ |
311 } |
312 } |
312 |
313 |
316 out: &mut dyn std::io::Write, |
317 out: &mut dyn std::io::Write, |
317 ) -> std::io::Result<()> { |
318 ) -> std::io::Result<()> { |
318 match self { |
319 match self { |
319 ConfigOrigin::File(p) => out.write_all(&get_bytes_from_path(p)), |
320 ConfigOrigin::File(p) => out.write_all(&get_bytes_from_path(p)), |
320 ConfigOrigin::CommandLine => out.write_all(b"--config"), |
321 ConfigOrigin::CommandLine => out.write_all(b"--config"), |
|
322 ConfigOrigin::CommandLineColor => out.write_all(b"--color"), |
321 ConfigOrigin::Environment(e) => write_bytes!(out, b"${}", e), |
323 ConfigOrigin::Environment(e) => write_bytes!(out, b"${}", e), |
322 } |
324 } |
323 } |
325 } |
324 } |
326 } |
325 |
327 |