• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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.
Support Development  • Practical CodeIgniter 3  • Vulcan - CLI Tools for CI4
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().
Support Development  • Practical CodeIgniter 3  • Vulcan - CLI Tools for CI4
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.