commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] Reopened: (CLI-166) Terminal width detection
Date Wed, 27 May 2009 20:59:45 GMT


Sebb reopened CLI-166:

The code change in r778895 assumes that all non-Windows systems support stty, which is not
the case.

Also, the autoWidth variable should be private.

I think the Javadoc for setAutoWidth() should mention that it may run a system command.

However, I'm not sure that it's a good idea to include system calls in library code at all.

Also, it's not very secure to rely on the PATH to find commands such as sh.

> Terminal width detection
> ------------------------
>                 Key: CLI-166
>                 URL:
>             Project: Commons CLI
>          Issue Type: New Feature
>          Components: Help formatter
>            Reporter: Emmanuel Bourg
>            Assignee: Jim Jagielski
>             Fix For: 1.3
> HelpFormatter could be improved by adjusting automatically its width to the width of
the terminal. The width of the terminal can be retrieved by the stty command on unix systems,
on Windows it requires a native call. The JLine project on SourceForge already implements
this logic.
> I suggest to add a setAutoWidth(boolean) method in HelpFormatter that will try to get
the terminal width. If it fails it'll fall back to the width provided by getWidth().

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message