Detect old option specification fail informatively.
Print the information message to std::cout so it gets printed on the tmux status line so users of 2.X know how to update their configuration.
This commit is contained in:
parent
4c00be77ff
commit
1bfda9484a
@ -115,8 +115,13 @@ if(BUILD_TESTING)
|
|||||||
COMMAND tmux-mem-cpu-load --graph_lines -2
|
COMMAND tmux-mem-cpu-load --graph_lines -2
|
||||||
)
|
)
|
||||||
|
|
||||||
|
add_test(NAME old_option_specification
|
||||||
|
COMMAND tmux-mem-cpu-load 2 8
|
||||||
|
)
|
||||||
|
|
||||||
set_tests_properties(usage
|
set_tests_properties(usage
|
||||||
invalid_status_interval
|
invalid_status_interval
|
||||||
invalid_graph_lines
|
invalid_graph_lines
|
||||||
|
old_option_specification
|
||||||
PROPERTIES WILL_FAIL TRUE)
|
PROPERTIES WILL_FAIL TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
@ -159,6 +159,14 @@ int main( int argc, char** argv )
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Detect old option specification and return and error message.
|
||||||
|
if( argc > optind )
|
||||||
|
{
|
||||||
|
std::cout <<
|
||||||
|
"The interval and graph lines options are now specified with flags.\n\n";
|
||||||
|
print_help();
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
std::cout << mem_string( use_colors ) << ' '
|
std::cout << mem_string( use_colors ) << ' '
|
||||||
<< cpu_string( cpu_usage_delay, graph_lines, use_colors ) << ' '
|
<< cpu_string( cpu_usage_delay, graph_lines, use_colors ) << ' '
|
||||||
|
Loading…
Reference in New Issue
Block a user