Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
cargo-yaml
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
6
Snippets
Groups
Projects
Show more breadcrumbs
David Huffman
cargo-yaml
Commits
8d3181a7
Commit
8d3181a7
authored
8 years ago
by
David Huffman
Browse files
Options
Downloads
Patches
Plain Diff
Add warning message when --color | -c flag is used
parent
ccfbb027
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.rs
+6
-3
6 additions, 3 deletions
src/main.rs
with
6 additions
and
3 deletions
src/main.rs
+
6
−
3
View file @
8d3181a7
...
@@ -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
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment