Bug 100826 - Libreoffice command line help is unusable under Windows
Summary: Libreoffice command line help is unusable under Windows
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
3.4.0 release
Hardware: All Windows (All)
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:5.3.0 target:5.4.0
Keywords:
: 103255 (view as bug list)
Depends on:
Blocks: Commandline
  Show dependency treegraph
 
Reported: 2016-07-10 01:50 UTC by Mike Kaganski
Modified: 2018-11-21 05:57 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshots of help dialogs from different versions (82.00 KB, application/x-zip-compressed)
2016-07-10 01:50 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2016-07-10 01:50:59 UTC
Created attachment 126143 [details]
Screenshots of help dialogs from different versions

Under Windows, starting LibreOffice with --help (-h, -?) switch outputs the information to a dialog, instead of console. 

Given rather large amount of information there, this dialog is unusable because:
1. It cannot be resized, and there is no scroll bars there to enable view of parts outside of initially displayed part (both horizontally and vertically)
2. It doesn't enable copying text from it (neither using Ctrl+C, not selecting by mouse)
3. Since 5.0, it doesn't allow closing clicking "Close" button by mouse (Bug 91622, supposedly because the text overlaps the button, thus click happens to the text instead of the button).

It is unclear why would this help text need to be in a dialog in the first place, because its intent is to enable user to use command line, which implies console usage, so outputting this to console could be fine.
But if it's necessary (e.g., because console is unavailable to the program, or no console experience is implied), then the dialog should be made usable by making the text both scrollable and selectable/copiable, and not overlapping "Close" button.

Attached are screenshots from different versions, where it's apparent that even on older versions, where the text vertically fit the dialog, it still doesn't fit horizontally. In recent versions, it doesn't fit both directions.
Comment 1 Buovjaga 2016-07-18 11:09:13 UTC
There is bug 76932 for the lack of scrolling.
Comment 2 Yousuf Philips (jay) (retired) 2016-10-17 03:01:28 UTC
*** Bug 103255 has been marked as a duplicate of this bug. ***
Comment 3 Yousuf Philips (jay) (retired) 2016-10-17 03:03:32 UTC
My duplicate, bug 103255, also suggests the complete elimination of the dialog for other commandline arguments like version.
Comment 4 Mike Kaganski 2016-11-22 00:03:51 UTC
A patch is submitted for review: https://gerrit.libreoffice.org/31059
Comment 5 Commit Notification 2016-11-23 16:48:58 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=24a24e65cafffe137d76de0a6eb5270ea88ebffd

tdf#100826: use console for -h and --version also on Windows

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Mike Kaganski 2016-11-28 18:11:34 UTC
A follow-up patch is in gerrit: https://gerrit.libreoffice.org/31187 that allows to output the --help into caller console if available.
Comment 7 Commit Notification 2016-12-23 04:56:04 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=601bdc416b6ef17498c94fec49164b1b4c38528d

tdf#100826: Use parent console for output if possible

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2017-02-18 20:37:42 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=12899c07be2f927776ae12ea1abcefdc4bea8346

tdf#100826 related: initialize stdout/stdin/strerr properly

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Xisco Faulí 2017-04-13 09:03:25 UTC
Hello,
Is this bug fixed?
If so, could you please close it as RESOLVED FIXED?
Comment 10 Martin Zbořil 2018-02-16 15:35:15 UTC
I tested this on windows with LibreOffice Version: 5.4.5.1 (x64)
Build ID: 79c9829dd5d8054ec39a82dc51cd9eff340dbee8

I needed this to programatically find a version number for LibreOffice (also versions <5 so I will have to find another way to do this.)
bellow are three examples which I tried with described results and code snippet to reproduce my findings


cmd did only return a newline

C:\Users\user>"C:\Program Files\LibreOffice 5\program\scalc.exe" --version

powershell spawned a separate commandline window listed in taskmanager as soffice.bin with version information.

PS C:\Users\user> Start-Process -FilePath "C:\Program Files\LibreOffice 5\program\scalc.exe" -ArgumentList "--headless --version"

python, using subprocess module, returned the version information.

C:\Users\user>python3.exe
>>> import subprocess
>>> result = subprocess.run(['C:\Program Files\LibreOffice 5\program\soffice.exe', '--version'], stdout=subprocess.PIPE)
>>> print(result.stdout)
b'LibreOffice 5.4.5.1 79c9829dd5d8054ec39a82dc51cd9eff340dbee8\r\n\r\n'