openSUSE / zypper

World's most powerful command line package manager
http://en.opensuse.org/Portal:Zypper
Other
403 stars 110 forks source link

RFE: Make table style selection a config option #471

Open bertronika opened 1 year ago

bertronika commented 1 year ago

Zypper has the (little known) -s, --table-style argument for changing the characters used when a table is drawn in the command output. I currently set my table style with a shell alias, but doing so presents two problems:

I'm suggesting making the table style setting a config option (in zypper.conf). It would help with the discoverability of the setting, prevent conflicts with subcommands and unify zypper's appearance no matter how it is invoked.

luc14n0 commented 1 year ago

Out of curiosity, what shell are you using and how are you setting the alias.

bertronika commented 1 year ago

It's bash, with alias zypper='zypper -s 1' defined.

luc14n0 commented 1 year ago

OK, thanks.

I'm guessing that in order to having this as a configuration in zypp.conf, that limitation Zypper has about not supporting global options for sub-commands must be dealt with first. Zypper`s manpage states:

Using zypper global-options together with subcommands, as well as
executing subcommands in zypper shell is currently not supported.

Just like you see in the error message you're getting. But now I'm curious to now what are those limitations.

mlandres commented 1 year ago

You cant deal with this. A subcommand is a standalone program or shell script (like zypper-log). You can even write your own ones. We have no control about what options those programs support. We (the zypp-team) neither provide nor maintain most of them.

luc14n0 commented 1 year ago

That was the first thing that came to my mind, the "unknown" factor.

bertronika commented 1 year ago

We have no control about what options those programs support.

That's why I'm proposing a change, internal to zypper. I've picked zypper.conf because it already contains color configuration, and table style would complement it. By making it an entry in the configuration file, no more aliases with global options, which conflict with subcommands, would be necessary.

luc14n0 commented 1 year ago

Could that work out Michael? It kind of makes sense to have this as an option in zypper.conf to avoid that conflict IMO, since it wouldn't be Zypper outputting text, right?. How does Zypper handle sub-commands, is it just like a simple wrapper, or does it do something special?