pkg
pkg copied to clipboard
pkg and quiet mode
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:
- if user defined -q without -y throw error. (I like this one, since it will not hind the truth)
- if user defined -q pkg will auto define -y (hiding information form user is very bad)
- maybe something more?
- 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
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.
In my opinion quiet mode should everywhere default to
- throw an error if -y is not passed
- print the minimum aka to percent something when an action is started like "action..." and something when it is finished "done"
- We do need quiet mode scripts like portmaster, the ports tree and more do like the quiet mode :)
On 12/09/2014 07:34, Baptiste Daroussin wrote:
In my opinion quiet mode should everywhere default to
- 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?
- 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.
- 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]
… '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:
- FreeBSD bug 266581 – ports-mgmt/pkg: pkg(8) should mention --debug verbosity increases with -dd, -ddd and -dddd
So, maybe, have:
-qfor a little more quiet than normal-qqfor much more quiet than normal-qqqfor close to silence-qqqqfor 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-serverI 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.