diversicon-kb / divercli

Command Line Interface for Diversicon
http://diversicon-kb.eu/tools
Other
0 stars 0 forks source link

adapt Usage description to fit whole display #1

Open DavidLeoni opened 8 years ago

DavidLeoni commented 8 years ago

Unfortunately jCommander doesn't adapt usage text to console width. To get console width jLine2 library can be used:

            terminalWidth = jline.TerminalFactory.get().getWidth();
            jcom.setColumnSize(terminalWidth);

but JCommander.setColumnSize() constrains only usage but not options, i.e.:

    import-xml      Imports into the db lexical resources in UBY-LMF XML format.
      Usage: import-xml [options] a space separated list of XML files in UBY-LMF format. Lexical resources must have a 'name' attribute. If there are already present resources with the same name, content will be merged.
        Options:
        * --author, -a
             The author of the operations on the db.
             Default: <empty string>
        * --description, -d
             The description of the operation being performed on the db.
             Default: <empty string>
          --skip-augment, -s
             Skips augmenting the db graph to speed up  operations requiring the
             transitive closure.
             Default: false

Also doesn't allow to