Welcome Guest, Not a member yet? Register   Sign In
CLI No Newline
#1

I'd love a way to suppress the newline character from CLI::write, so you can do things like:
Generating new widget...

then in a bit:
Generating new widget... Done!

CLI:write is already pretty darn loaded with parameters, so maybe a new command?
Reply
#2

You can use CLI::color() to do that.
Reply
#3

... genius.
Reply
#4

`CLI:color()` doesn't appear to be doing anything on its own:

PHP Code:
CLI::write("Sample from `write` command");
CLI::color("Sample from `color` command"'black');
CLI::write("Wrapping up"); 

Results in:

Sample from `write` command
Wrapping up
Reply
#5

Doh! You're right, it doesn't. Not sure why I was remembering that.

Anyway - I just pushed up a new command that does just what you're looking for: print().
Reply
#6

Woohoo! Custom methods, on demand! Boy, do I have a list for you Smile
You're not imagining, the docs still state: "you can use the color() method to make a string fragment that can be used in the same way, except that it will not force an EOL after printing. This allows you to create multiple outputs on the same row". I can PR that out tomorrow if nobody has gotten to it yet.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB