pkg icon indicating copy to clipboard operation
pkg copied to clipboard

pkg and quiet mode

Open andrejzverev opened this issue 11 years ago • 5 comments

currently pkg allow for example install and delete packages with quiet (-q) mode, but due interactive nature of pkg it will do nothing in this case.

Which way is right here:

  1. if user defined -q without -y throw error. (I like this one, since it will not hind the truth)
  2. if user defined -q pkg will auto define -y (hiding information form user is very bad)
  3. maybe something more?

andrejzverev avatar Aug 11 '14 15:08 andrejzverev

  1. and never 2) 3a) drop quite mode 3b) operate in quite mode only if no conflicts detected and log all operations and outputs to syslog

ohauer avatar Aug 13 '14 18:08 ohauer

3a) Without quite mode my scripts read lot of 1% 2% 3% ... 100% of progress. 3b) Mostly pkg made for people. People like reading and controlling such tools :-)

+1 for throw error.

andrejzverev avatar Aug 14 '14 03:08 andrejzverev

In my opinion quiet mode should everywhere default to

  1. throw an error if -y is not passed
  2. print the minimum aka to percent something when an action is started like "action..." and something when it is finished "done"
  3. We do need quiet mode scripts like portmaster, the ports tree and more do like the quiet mode :)

bapt avatar Sep 12 '14 06:09 bapt

On 12/09/2014 07:34, Baptiste Daroussin wrote:

In my opinion quiet mode should everywhere default to

  1. throw an error if -y is not passed

Why not make quiet mode imply 'yes'? Also should quiet mode be assumed if stdout is not a tty?

  1. print the minimum aka to percent something when an action is started like "action..." and something when it is finished "done"

Unless we're running a command like 'pkg info' or 'pkg query' that specifically asks for information, then I think quiet mode should produce no output on stdout. Error messages are allowable, but there's an argument for just logging the error to syslog and relying on the exit code to signal the problem to callers.

  1. We do need quiet mode scripts like portmaster, the ports tree and more do like the quiet mode :)

Exactly. 'Quiet mode' is really aimed at scripting use, and we should mention that explicitly in the documentaion.

Cheers,

Matthew

Dr Matthew J Seaman MA, D.Phil.

PGP: http://www.infracaninophile.co.uk/pgpkey JID: [email protected]

infracaninophile avatar Sep 12 '14 06:09 infracaninophile

… 'Quiet mode' is really aimed at scripting use, …

Ah.

I very frequently find the mode highly valuable in situations that do not involve scripting. Less verbose is often easier for a reader to understand, when providing support; and so on.

Diverse use cases require/desire different levels of quietness.

Food for thought:

So, maybe, have:

  • -q for a little more quiet than normal
  • -qq for much more quiet than normal
  • -qqq for close to silence
  • -qqqq for absolute silence

– and (kicking the ball around) I guess that -qqq might suit a majority of scripting use cases.

Also:

  • #1642

From https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=266630#c2:

pkg install --quiet mariadb106-server

I assumed, wrongly, that it would quietly install. It did not.

More specifically:

  • I made this assumption because I did not also specify -n
  • the absolute silence astonished me.

grahamperrin avatar Sep 27 '22 05:09 grahamperrin