pkg icon indicating copy to clipboard operation
pkg copied to clipboard

pkg -y install ... -> pkg install -y ...

Open cemeyer opened this issue 11 years ago • 9 comments

It would be nice if pkg(1) forwarded common flags like -y to subcommands that accepted them.

cemeyer avatar Oct 28 '14 13:10 cemeyer

how about ASSUME_ALWAYS_YES=YES pkg whatever ?

kaworu avatar Nov 26 '14 17:11 kaworu

I don't think ASSUME_ALWAYS_YES has anything to do with this issue.

cemeyer avatar Nov 26 '14 17:11 cemeyer

Well as far as I understand ASSUME_ALWAYS_YES cover every use case you provided, so maybe some clarifications and well chosen examples could help. Also note that it's pkg(8), not pkg(1).

kaworu avatar Nov 27 '14 12:11 kaworu

@cemeyer Could you please explain why @kAworu's answer does not satisfy you? In the end, you get the result you want. Or maybe you want a -y flag, in which case you should state this more explicitly.

rolinh avatar Nov 27 '14 12:11 rolinh

pkg-fetch, pkg-install, pkg-delete all take -y flags; but pkg -y <install|fetch|delete> does the wrong thing.

pkg-install, pkg-update, and pkg-delete all take -f|--force flags, but pkg -f <install|update|delete> does the wrong thing.

Do you need more examples or does that make sense? A -y flag to pkg would improve things, but it isn't a complete fix. ASSUME_ALWAYS_YES isn't related.

cemeyer avatar Nov 27 '14 14:11 cemeyer

I am using the -o ... flag to "simulate" -y, something like pkg -o ASSUME_ALWAYS_YES=true install <pkg_name>, this fits my needs nicely. However in the pkg.conf manpage (FBSD12) this option is decribed like this:

ASSUME_ALWAYS_YES: boolean When this option is enabled pkg(1) will automatically assume "yes" to all questions which require user confirmation before doing anything, as if it the -y flag was specified. Default: NO.

This sounds as if there is a -y flag, but it is not mentioned in the pkg manpage. I could not find anything in the sourcecode either.

mjakob-gh avatar Apr 14 '19 14:04 mjakob-gh

i just discovered, there is the flag -y, --yes mentioned in the pkg-update, pkg-delete, pkg-upgrade manpages. And my comment has not much in common with the topic of the ticket itself, sorry.

mjakob-gh avatar Apr 22 '19 10:04 mjakob-gh

I don't really understand what is being asked for here? do you ask to have global options aka pkg for options that are commonly found in some commands like -y, -n or -f ? I am missing some more?

bapt avatar Dec 08 '20 17:12 bapt

@bapt yes, and (or?) that pkg forwards those to sub-commands that understand them

igalic avatar Dec 08 '20 22:12 igalic