{
SF_CRUSH = 1<<0, //< truncate lhs, then rhs
SF_SPLIT = 1<<1, //< split line across two
- SF_EXPAND = 1<<2 //< expand short lines
+ SF_EXPAND = 1<<2 //< expand short lines iff stdout is a tty
};
ZYPP_DECLARE_FLAGS( SplitFlags, SplitFlag );
using namespace std;
-#define SF_EXPAND_IF_TTY ( _isatty ? TermLine::SF_EXPAND : TermLine::SplitFlags() )
-
OutNormal::OutNormal(Verbosity verbosity)
: Out(TYPE_NORMAL, verbosity),
_use_colors(false), _isatty(isatty(STDOUT_FILENO)), _newline(true), _oneup(false)
if (_isatty)
{
- TermLine outstr( TermLine::SF_CRUSH | SF_EXPAND_IF_TTY, '-' );
+ TermLine outstr( TermLine::SF_CRUSH | TermLine::SF_EXPAND, '-' );
outstr.lhs << s << ' ';
// dont display percents if invalid
if (_isatty)
{
- TermLine outstr( TermLine::SF_CRUSH | SF_EXPAND_IF_TTY, '-' );
+ TermLine outstr( TermLine::SF_CRUSH | TermLine::SF_EXPAND, '-' );
++cursor;
outstr.lhs << s << ' ';
outstr.rhs << '[' << cursor.current() << ']';
if (!error && _use_colors)
cout << get_color(COLOR_CONTEXT_MSG_STATUS);
- TermLine outstr( TermLine::SF_CRUSH | SF_EXPAND_IF_TTY, '.' );
+ TermLine outstr( TermLine::SF_CRUSH | TermLine::SF_EXPAND, '.' );
if (_isatty)
{
if(_oneup)
if (_isatty)
cout << CLEARLN;
- TermLine outstr( TermLine::SF_CRUSH | SF_EXPAND_IF_TTY, '-' );
+ TermLine outstr( TermLine::SF_CRUSH | TermLine::SF_EXPAND, '-' );
outstr.lhs << _("Retrieving:") << ' ';
if (verbosity() == DEBUG)
outstr.lhs << uri;
cout << CLEARLN << CURSORUP(1);
cout << CLEARLN;
- TermLine outstr( TermLine::SF_CRUSH | SF_EXPAND_IF_TTY, '-' );
+ TermLine outstr( TermLine::SF_CRUSH | TermLine::SF_EXPAND, '-' );
outstr.lhs << _("Retrieving:") << " ";
if (verbosity() == DEBUG)
outstr.lhs << uri;
if (!error && _use_colors)
cout << get_color(COLOR_CONTEXT_MSG_STATUS);
- TermLine outstr( TermLine::SF_CRUSH | SF_EXPAND_IF_TTY, '.' );
+ TermLine outstr( TermLine::SF_CRUSH | TermLine::SF_EXPAND, '.' );
if (_isatty)
{
if(_oneup)