Change naming from --nerd-graph to --vertical-graph

This commit is contained in:
henry.potgieter 2023-03-27 11:57:01 -04:00
parent dc298e162a
commit e232eef156
3 changed files with 13 additions and 13 deletions

@ -61,7 +61,7 @@ std::string get_graph_by_value( unsigned value, unsigned max, unsigned len )
return bars; return bars;
} }
std::string get_graph_nerd( unsigned value ) std::string get_graph_vert( unsigned value )
{ {
static const std::map<unsigned, std::string> graph_chars = { static const std::map<unsigned, std::string> graph_chars = {
{ 0, " " }, { 10, "" }, { 20, "" }, { 30, "" }, { 40, "" }, { 0, " " }, { 10, "" }, { 20, "" }, { 30, "" }, { 40, "" },

@ -23,6 +23,6 @@
std::string get_graph_by_percentage( unsigned, unsigned len = 10 ); std::string get_graph_by_percentage( unsigned, unsigned len = 10 );
std::string get_graph_by_value( unsigned, unsigned, unsigned len = 10 ); std::string get_graph_by_value( unsigned, unsigned, unsigned len = 10 );
std::string get_graph_nerd( unsigned ); std::string get_graph_vert( unsigned );
#endif #endif

@ -37,7 +37,7 @@
std::string cpu_string( CPU_MODE cpu_mode, unsigned int cpu_usage_delay, unsigned int graph_lines, std::string cpu_string( CPU_MODE cpu_mode, unsigned int cpu_usage_delay, unsigned int graph_lines,
bool use_colors = false, bool use_colors = false,
bool use_powerline_left = false, bool use_powerline_right = false, bool use_nerd_graph = false) bool use_powerline_left = false, bool use_powerline_right = false, bool use_vert_graph = false)
{ {
float percentage; float percentage;
@ -80,10 +80,10 @@ std::string cpu_string( CPU_MODE cpu_mode, unsigned int cpu_usage_delay, unsigne
} }
} }
if( use_nerd_graph ) if( use_vert_graph )
{ {
oss << ""; oss << "";
oss << get_graph_nerd( unsigned( percentage ) ); oss << get_graph_vert( unsigned( percentage ) );
oss << ""; oss << "";
} }
else if( graph_lines > 0) else if( graph_lines > 0)
@ -129,8 +129,8 @@ void print_help()
<< "\tUse powerline left symbols throughout the output, enables --colors\n" << "\tUse powerline left symbols throughout the output, enables --colors\n"
<< "-q, --powerline-right\n" << "-q, --powerline-right\n"
<< "\tUse powerline right symbols throughout the output, enables --colors\n" << "\tUse powerline right symbols throughout the output, enables --colors\n"
<< "-n, --nerd-graph\n" << "-n, --vertical-graph\n"
<< "\tUse NerdFont symbols to render CPU graph as vertical bar chart\n" << "\tUse vertical bar chart for CPU graph\n"
<< "-i <value>, --interval <value>\n" << "-i <value>, --interval <value>\n"
<< "\tSet tmux status refresh interval in seconds. Default: 1 second\n" << "\tSet tmux status refresh interval in seconds. Default: 1 second\n"
<< "-g <value>, --graph-lines <value>\n" << "-g <value>, --graph-lines <value>\n"
@ -152,7 +152,7 @@ int main( int argc, char** argv )
bool use_colors = false; bool use_colors = false;
bool use_powerline_left = false; bool use_powerline_left = false;
bool use_powerline_right = false; bool use_powerline_right = false;
bool use_nerd_graph = false; bool use_vert_graph = false;
MEMORY_MODE mem_mode = MEMORY_MODE_DEFAULT; MEMORY_MODE mem_mode = MEMORY_MODE_DEFAULT;
CPU_MODE cpu_mode = CPU_MODE_DEFAULT; CPU_MODE cpu_mode = CPU_MODE_DEFAULT;
@ -166,7 +166,7 @@ int main( int argc, char** argv )
{ "colors", no_argument, NULL, 'c' }, { "colors", no_argument, NULL, 'c' },
{ "powerline-left", no_argument, NULL, 'p' }, { "powerline-left", no_argument, NULL, 'p' },
{ "powerline-right", no_argument, NULL, 'q' }, { "powerline-right", no_argument, NULL, 'q' },
{ "nerd-graph", no_argument, NULL, 'n' }, { "vertical-graph", no_argument, NULL, 'v' },
{ "interval", required_argument, NULL, 'i' }, { "interval", required_argument, NULL, 'i' },
{ "graph-lines", required_argument, NULL, 'g' }, { "graph-lines", required_argument, NULL, 'g' },
{ "mem-mode", required_argument, NULL, 'm' }, { "mem-mode", required_argument, NULL, 'm' },
@ -177,7 +177,7 @@ int main( int argc, char** argv )
int c; int c;
// while c != -1 // while c != -1
while( (c = getopt_long( argc, argv, "hi:cpqng:m:a:t:", long_options, NULL) ) != -1 ) while( (c = getopt_long( argc, argv, "hi:cpqvg:m:a:t:", long_options, NULL) ) != -1 )
{ {
switch( c ) switch( c )
{ {
@ -196,8 +196,8 @@ int main( int argc, char** argv )
use_colors = true; use_colors = true;
use_powerline_right = true; use_powerline_right = true;
break; break;
case 'n': // --nerd-graph case 'v': // --vertical-graph
use_nerd_graph = true; use_vert_graph = true;
break; break;
case 'i': // --interval, -i case 'i': // --interval, -i
if( atoi( optarg ) < 1 ) if( atoi( optarg ) < 1 )
@ -260,7 +260,7 @@ int main( int argc, char** argv )
MemoryStatus memory_status; MemoryStatus memory_status;
mem_status( memory_status ); mem_status( memory_status );
std::cout << mem_string( memory_status, mem_mode, use_colors, use_powerline_left, use_powerline_right ) std::cout << mem_string( memory_status, mem_mode, use_colors, use_powerline_left, use_powerline_right )
<< cpu_string( cpu_mode, cpu_usage_delay, graph_lines, use_colors, use_powerline_left, use_powerline_right, use_nerd_graph ) << cpu_string( cpu_mode, cpu_usage_delay, graph_lines, use_colors, use_powerline_left, use_powerline_right, use_vert_graph )
<< load_string( use_colors, use_powerline_left, use_powerline_right, averages_count ); << load_string( use_colors, use_powerline_left, use_powerline_right, averages_count );
std::cout << std::endl; std::cout << std::endl;