Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

"kpm restore --quiet" hides HTTP requests/cache information #578

Merged
merged 1 commit into from
Aug 27, 2014

Conversation

ChengTian
Copy link
Contributor

parent #577

An interesting usage mentioned by @davidfowl is kpm --verbose restore --quiet. For my implementation, in this case, --verbose wins and here is the reason:
If --quiet wins, kpm restore blocks without showing HTTP requests/cache information. So the user might not notice that he mistakenly specified --verbose and --quiet together because he might think that kpm restore is blocking for some silent operations.
If --verbose wins, we show a bunch of HTTP request/cache information instantly after the user hit Enter key. So the user can easily notice he specified --verbose. The basic idea is that we make the behavior obvious & quick enough to draw users' attention.

@Eilon , do you like the idea above? Or we can give an error saying --verbose and --quiet are mutually exclusive.

@ChengTian
Copy link
Contributor Author

Some background knowledge:

  1. kpm --verbose restore shows all information
  2. kpm restore hides Attempting to resolve "{0}" and dependency graph
  3. kpm restore --quiet hides Attempting to resolve "{0}", dependency graph and HTTP request/cache information

@@ -62,6 +62,7 @@ public int Main(string[] args)
CommandOptionType.SingleValue);
var optNoCache = c.Option("--no-cache", "Do not use local cache", CommandOptionType.NoValue);
var optPackageFolder = c.Option("--packages", "Path to restore packages", CommandOptionType.SingleValue);
var optQuiet = c.Option("--quiet", "Do not show HTTP request/cache information", CommandOptionType.NoValue);
Copy link
Member

Choose a reason for hiding this comment

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

I recommend making the description a bit more generic (we might eventually have more information beyond HTTP stuff).

E.g.:
Do not show output such as HTTP request/cache information

@Eilon
Copy link
Member

Eilon commented Aug 26, 2014

The logic makes sense to me (verbose vs. quiet) so I'm fine with this.

@ChengTian ChengTian force-pushed the kpm-quiet-option-hides-http-requests-during-restore branch from def876e to 8081af8 Compare August 26, 2014 17:57
@ChengTian
Copy link
Contributor Author

Changed based on @Eilon 's feedbacks. Now the Reports class has 3 properties: Information, Verbose and Quiet. If you want the WriteLine() operation to be affected by --verbose, pass in Verbose. If you want the WriteLine() operation to be affected by --quiet, pass in Quiet. The values of Verbose and Quiet are determined ahead of time, so there is no decision making logic in later methods.

@davidfowl
Copy link
Member

:shipit:

/cc @pranavkm Lets change our build scripts to use this.

@ChengTian ChengTian merged commit 8081af8 into dev Aug 27, 2014
@ChengTian ChengTian deleted the kpm-quiet-option-hides-http-requests-during-restore branch August 27, 2014 05:01
@Eilon
Copy link
Member

Eilon commented Aug 28, 2014

Sorry for the delay - looks much nicer!

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.

None yet

3 participants