cli-ux icon indicating copy to clipboard operation
cli-ux copied to clipboard

table documentation

Open piersmacdonald opened this issue 6 years ago • 1 comments

The table feature is somewhat complex and the documentation is scattered.

The example code contains data from here https://jsonplaceholder.typicode.com/users which doesn't match the sample out put provided here

$ example-cli users
Name   Team
Jordan Sales
Jamie  Engineering

...

The second arg in the example (table options) doesn't match the definition of the Table.Options above it.

Lastly there's no high-level explanation of how the feature works. Does the table render itself? Do I have to use the printLine and printRow functions explicitly? What's the difference between a line and a row?I've spent 3 hours mucking around and still can't get a table to draw.

piersmacdonald avatar Feb 01 '19 06:02 piersmacdonald

Hey @piersmacdonald

I've updated the README with the output from https://jsonplaceholder.typicode.com/users. And oclif.io will be updated shortly.

All the documentation for cli.table is in the README. The example folder and oclif.io contain the same documentation/example.

Table.Options is the third argument. Table.Columns is the second.

printLine, as stated, is a custom logger and optional. You can ignore it.

I'm not sure what printRow is. Can you elaborate? The project has no such function.

Be sure you are using v5 cli.table and not v4.

RasPhilCo avatar Feb 01 '19 21:02 RasPhilCo