Skip to content
Snippets Groups Projects
Commit 8d3181a7 authored by David Huffman's avatar David Huffman
Browse files

Add warning message when --color | -c flag is used

parent ccfbb027
Branches
Tags
No related merge requests found
...@@ -3,6 +3,8 @@ extern crate rustc_serialize; ...@@ -3,6 +3,8 @@ extern crate rustc_serialize;
extern crate toml; extern crate toml;
extern crate yaml_rust; extern crate yaml_rust;
use std::io::prelude::*;
const MANIFEST: &'static str = include_str!("../Cargo.yaml"); const MANIFEST: &'static str = include_str!("../Cargo.yaml");
const USAGE: &'static str = " const USAGE: &'static str = "
...@@ -33,7 +35,7 @@ mod opt { ...@@ -33,7 +35,7 @@ mod opt {
arg_command: Option<String>, arg_command: Option<String>,
flag_manifest_path: Option<String>, flag_manifest_path: Option<String>,
flag_template_path: Option<String>, flag_template_path: Option<String>,
flag_color: Option<Color>, pub flag_color: Option<Color>,
flag_quiet: bool, flag_quiet: bool,
flag_verbose: bool, flag_verbose: bool,
pub flag_version: bool, pub flag_version: bool,
...@@ -190,7 +192,6 @@ fn version() -> String { ...@@ -190,7 +192,6 @@ fn version() -> String {
.to_string() .to_string()
} }
// TODO: --color WHEN warning message
// TODO: execute cargo subcommand upon completion (if provided) // TODO: execute cargo subcommand upon completion (if provided)
fn main() { fn main() {
let args: opt::Args = let args: opt::Args =
...@@ -205,8 +206,10 @@ fn main() { ...@@ -205,8 +206,10 @@ fn main() {
println!("{:?}", args); println!("{:?}", args);
let manifest_path = args.manifest_path(); let manifest_path = args.manifest_path();
let template_path = args.template_path(); let template_path = args.template_path();
// let color = args.color().is_enabled();
let verb = args.verbosity(); let verb = args.verbosity();
if args.flag_color.is_some() {
let _ = writeln!(std::io::stderr(), "WARNING: the `--color` option is currently ignored");
}
verb.if_normal(format_args!(" Generating new Cargo manifest")); verb.if_normal(format_args!(" Generating new Cargo manifest"));
verb.if_verbose(format_args!(" Reading YAML from {:?}", template_path)); verb.if_verbose(format_args!(" Reading YAML from {:?}", template_path));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment