forked from Alepha/Alepha
Use delimiter stream adaptor in some output.
This commit is contained in:
12
Console.cc
12
Console.cc
@ -22,8 +22,10 @@ static_assert( __cplusplus > 2020'99 );
|
||||
#include "Enum.h"
|
||||
#include "ProgramOptions.h"
|
||||
#include "string_algorithms.h"
|
||||
#include "delimited_list.h"
|
||||
#include "AutoRAII.h"
|
||||
|
||||
|
||||
/*
|
||||
* All of the terminal control code in this library uses ANSI escape sequences (https://en.wikipedia.org/wiki/ANSI_escape_code).
|
||||
* Instead of using termcap and curses, code can use this simpler library instead. The simple fact is that in 2022, there's
|
||||
@ -242,12 +244,14 @@ namespace Alepha::Hydrogen ::detail:: Console_m
|
||||
--"dump-color-env-var"_option << []
|
||||
{
|
||||
std::cout << "export " << colorsEnv() << "-\"";
|
||||
bool first= true;
|
||||
AutoRAII delimiters
|
||||
{
|
||||
[]{ std::cout << StartDelimitedList{ ":" }; },
|
||||
[]{ std::cout << EndDelimitedList; }
|
||||
};
|
||||
for( const auto &[ name, sgr ]: colorVariables() )
|
||||
{
|
||||
if( not first ) std::cout << ":";
|
||||
first= false;
|
||||
std::cout << name.name << "=" << sgr.code;
|
||||
std::cout << NextItem << name.name << "=" << sgr.code;
|
||||
}
|
||||
std::cout << "\"" << std::endl;
|
||||
::exit( EXIT_SUCCESS );
|
||||
|
Reference in New Issue
Block a user