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

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?

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

... genius.

`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

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().

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.

Theme © iAndrew 2016 - Forum software by © MyBB