appwrite / sdk-for-cli

[READ-ONLY] Official Appwrite CLI >_
BSD 3-Clause "New" or "Revised" License
90 stars 27 forks source link

Hard wrap STDOUT past 100-120 columns #3

Closed kodumbeats closed 3 years ago

kodumbeats commented 3 years ago

As an example, appwrite help produces a list of services. Zero of these lines are under 80 columns, ["storage", "users"] are the only under 100 (the current linux kernel standard), and the longest line teams is 149 columns.

Just a style preference, but it's a pain point to resize my terminal every time I use the CLI.

christyjacob4 commented 3 years ago

@kodumbeats thank you for raising this. I was just working on this today.

Do you have any suggestions to tackle this?

kodumbeats commented 3 years ago

My first thoughts after perusing these scripts:

christyjacob4 commented 3 years ago

I'll experiment with wordwrap() and let you know. I was thinking of moving this logic of calculating the padding etc to Parser.php since Manipulators.php is specific to the jc21 table library that we are using.

Parser.php was intended to abstract all the logic for printing / formatting etc.

kodumbeats commented 3 years ago

Aha, Parser.php looks like a better place. :) Most of the necessary abstraction logic is already in parseResponse it seems.

christyjacob4 commented 3 years ago

Screenshot 2021-02-23 at 10 09 52 PM @kodumbeats

christyjacob4 commented 3 years ago

https://github.com/appwrite/sdk-generator/pull/112