rust/hg-core/src/config/layer.rs
changeset 48732 d4a5c2197208
parent 48451 4a983b69e519
child 48733 39c447e03dbc
equal deleted inserted replaced
48731:f591b377375f 48732:d4a5c2197208
   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