Skip to content
This repository has been archived by the owner on May 20, 2020. It is now read-only.

Implement --quiet flag #166

Merged
merged 4 commits into from
Aug 27, 2017
Merged

Implement --quiet flag #166

merged 4 commits into from
Aug 27, 2017

Conversation

euclio
Copy link
Contributor

@euclio euclio commented Aug 25, 2017

cc #128

Also lays the groundwork for --verbose once we figure out how we want it to work.

src/cargo.rs Outdated
let (mut libs, mut bins): (Vec<_>, Vec<_>) =
targets.into_iter().partition(|target| match target.kind {
TargetKind::Library => true,
TargetKind::Binary => false,
});

if !libs.is_empty() {
println!("Documenting the library.");
ui.warn(
"Found more than one target to document. Documenting the library.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be good to say which library

Copy link
Contributor

@mgattozzi mgattozzi Aug 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually disregard you can only have one library, but having the actual name would be useful

use serde_json;

use error::*;
use ui::Ui;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

Copy link
Owner

@steveklabnik steveklabnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks great to me! one thought about levels, and that's it.

src/lib.rs Outdated
@@ -56,14 +60,15 @@ impl Config {
/// ## Arguments
///
/// - `manifest_path`: The path to the `Cargo.toml` of the crate being documented
pub fn new(manifest_path: PathBuf, assets: Vec<Asset>) -> Result<Config> {
pub fn new(quiet: bool, manifest_path: PathBuf, assets: Vec<Asset>) -> Result<Config> {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this should be an enum of levels instead; quiet, verbose, and normal?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. What if in the future we want -vvv? Having an enum would make that easier and is more type safe. It'll express what it does better.

@euclio
Copy link
Contributor Author

euclio commented Aug 26, 2017

Comments addressed.

@steveklabnik steveklabnik merged commit 65879f1 into steveklabnik:master Aug 27, 2017
@steveklabnik
Copy link
Owner

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants