yduchesne / sapia

Automatically exported from code.google.com/p/sapia
0 stars 0 forks source link

Enhancement Req - Allow any coruscli output to be outputted on single lines #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
To allow us to parse coriscli output correctly programmatically, we need the 
ability to output information on a single line per item.

For example, currently the output for conf ls looks like this:

Name        Range            Available                 Active
--------------------------------------------------------------------------------
 tomcat.ajp  [8008 - 8010]    [8008, 8009, 8010]        []
--------------------------------------------------------------------------------
 tomcat.htt  [9097 - 9099]    [9097, 9098, 9099]        []
 p
--------------------------------------------------------------------------------
 tomcat.jmx  [4000 - 4009]    [4000, 4001, 4002, 4003,  []
                              4004, 4005, 4006, 4007,
                              4008, 4009]'

Due to how each column is breaking onto a second line, and having no form of 
delimiter, or predictable line length, it's hard to parse the information 
presented.

If we could for example, have a new parameter such as 'conf ls -raw' that 
allows this information to be presented in an regex friendly manner, with some 
form of delimiters, this would be of great help. For example:

Name   |     Range    |        Available       |          Active
--------------------------------------------------------------------------------
 tomcat.ajp |  [8008 - 8010]  |  [8008, 8009, 8010]   |    []
--------------------------------------------------------------------------------
 tomcat.http | [9097 - 9099]  |  [9097, 9098, 9099]    |    []
--------------------------------------------------------------------------------
 tomcat.jmx | [4000 - 4009]  |  [4000, 4001, 4002, 4003,4004, 4005, 4006, 4007,4008, 4009]' | []

Thanks.
Karl.

Original issue reported on code.google.com by k...@karl0r.co.uk on 16 Jul 2014 at 4:23

GoogleCodeExporter commented 9 years ago
Two edged sword.  I agree that the way column wrapping is now it can be 
confusing but you get used to it.  As this request is to help automation, is it 
worth investing time, or more looking at the API side of things to move toward 
REST?  The other alternative short-term (until API/REST) is available, is 
instead of worrying about one-line instead of multi-line - if the data in the 
code is held in arrays/hashes - convert that to json, and add a -json switch to 
the commands so you can get data that way?

These are all ideas only, not hard requirements :)

Original comment by c...@maxnet.eu.org on 18 Jul 2014 at 7:24

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Well I'm assuming the API itself will take a little while to write, compared to 
a simple prettiness remover flag. Though if writing a -json flag is just as 
quick, that would work better here for the short term.

Original comment by k...@karl0r.co.uk on 18 Jul 2014 at 7:40

GoogleCodeExporter commented 9 years ago
Added in 4.2: new switch allowing to specify display width (also, if switch is 
not specified, auto-detection is attempted and coruscli display takes the whole 
width of the command-line terminal).

Original comment by yanickdu...@gmail.com on 4 Aug 2014 at 2:23