[yast-devel] Starting YaST modules in bash without using return
Hello, if you have bash-completion installed, several YaST modules can be started by typing yast2 $module <tab><tab> without pressing return. Background: when pressing <tab><tab>, bash completion runs yast2 $module --help in the background to find out which commandline options are available. Affected modules: a) modules that simply get started by yast2 $module --help alternatives auth-client fonts journal krb-server ldapkrb ldap-server partitioner virt-install vpn b) modules that show a window for a second and then print the help (wrong order in the code): users samba-client samba-server c) special case nis - asks to install the "ypbind" package, then exits and prints the help. Also a case of wrong order in the code. I don't have all YaST modules installed, therefore I'd recommend that you test yourself: for mod in `yast2 -l | sed 1d` ; do echo === trying $mod yast2 $mod --help echo === done $mod echo done Can/will you fix this based on this mail, or should I open a bugreport for each affected module? Each module should at least have enough commandline handling to print This YaST2 module does not support the command line interface. (Ideally using exactly this text, because it's already translated.) Regards, Christian Boltz --
vorweg: Hier war gerade Stromausfall. Da hat der Sturm wohl irgendwo einen Baum auf die Leitung geworfen... ext3 hat mich zwar anscheinend vor größeren Schäden bewahrt. Mit reiserfs stände der Baum noch. :-) [> Christian Boltz und Ratti in fontlinge-devel]
-- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On Sun, 31 May 2020 16:30:37 +0200 Christian Boltz <opensuse@cboltz.de> wrote:
Hello,
if you have bash-completion installed, several YaST modules can be started by typing yast2 $module <tab><tab> without pressing return.
Background: when pressing <tab><tab>, bash completion runs yast2 $module --help in the background to find out which commandline options are available.
Affected modules:
a) modules that simply get started by yast2 $module --help alternatives auth-client fonts journal krb-server ldapkrb ldap-server partitioner virt-install vpn
b) modules that show a window for a second and then print the help (wrong order in the code): users samba-client samba-server
c) special case nis - asks to install the "ypbind" package, then exits and prints the help. Also a case of wrong order in the code.
I don't have all YaST modules installed, therefore I'd recommend that you test yourself:
for mod in `yast2 -l | sed 1d` ; do echo === trying $mod yast2 $mod --help echo === done $mod echo done
Can/will you fix this based on this mail, or should I open a bugreport for each affected module?
Hi Christian, thanks for report. This is obviously bug. Please create just one bug report listing all modules you already found as buggy. I can at least comment case you mention as "wrong code order" - it is caused by fact that not all API calls handle properly command line mode, so it tries to call UI in such case and result is that window is opened.
Each module should at least have enough commandline handling to print This YaST2 module does not support the command line interface. (Ideally using exactly this text, because it's already translated.)
Yes, it is there. Sadly it is in command line (code ) module, so each yast module need to call that command line module even just to mention that it is not handled. Maybe we will come with more generic solution that handle even case when module does not handle CLI at all and just print that help text. Josef
Regards,
Christian Boltz
-- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
Hello, Am Montag, 1. Juni 2020, 09:07:11 CEST schrieb josef Reidinger:
On Sun, 31 May 2020 16:30:37 +0200 Christian Boltz wrote:
if you have bash-completion installed, several YaST modules can be started by typing
yast2 $module <tab><tab>
Can/will you fix this based on this mail, or should I open a bugreport for each affected module?
Hi Christian, thanks for report. This is obviously bug. Please create just one bug report listing all modules you already found as buggy.
Done, https://bugzilla.opensuse.org/show_bug.cgi?id=1172340
I can at least comment case you mention as "wrong code order" - it is caused by fact that not all API calls handle properly command line mode, so it tries to call UI in such case and result is that window is opened.
Still, I'd guess that handling commandline parameters first (before doing API calls) should be a valid fix ;-) BTW: Feel free to mention me in the pull requests fixing this (I'm "cboltz" on github). I probably won't comment on them, but I always enjoy reading a good diff ;-) Regards, Christian Boltz -- I'll attach a xorg.log.old so you can check if this is the same crash or a new, better one. [Stefan Seyfried in https://bugzilla.novell.com/show_bug.cgi?id=147608] -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
Here is the pull request for yast-hello-world: https://github.com/dwbenjamin/yast-hello-world/pull/12 Does this satisfy Christian's request? Thanks, David.
Christian Boltz <opensuse@cboltz.de> 05/31/20 8:30 AM >>> Hello,
if you have bash-completion installed, several YaST modules can be started by typing yast2 $module <tab><tab> without pressing return. Background: when pressing <tab><tab>, bash completion runs yast2 $module --help in the background to find out which commandline options are available. Affected modules: a) modules that simply get started by yast2 $module --help alternatives auth-client fonts journal krb-server ldapkrb ldap-server partitioner virt-install vpn b) modules that show a window for a second and then print the help (wrong order in the code): users samba-client samba-server c) special case nis - asks to install the "ypbind" package, then exits and prints the help. Also a case of wrong order in the code. I don't have all YaST modules installed, therefore I'd recommend that you test yourself: for mod in `yast2 -l | sed 1d` ; do echo === trying $mod yast2 $mod --help echo === done $mod echo done Can/will you fix this based on this mail, or should I open a bugreport for each affected module? Each module should at least have enough commandline handling to print This YaST2 module does not support the command line interface. (Ideally using exactly this text, because it's already translated.) Regards, Christian Boltz --
vorweg: Hier war gerade Stromausfall. Da hat der Sturm wohl irgendwo einen Baum auf die Leitung geworfen... ext3 hat mich zwar anscheinend vor greren Schden bewahrt. Mit reiserfs stnde der Baum noch. :-) [> Christian Boltz und Ratti in fontlinge-devel]
-- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
participants (3)
-
Christian Boltz
-
David Benjamin
-
josef Reidinger