From d28fb387ca07ee7f418bf9a5f969f1cabb4171aa Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 20 Feb 2013 23:15:20 -0500 Subject: [PATCH] Improve indentation style consistency. --- tmux-mem-cpu-load.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tmux-mem-cpu-load.cpp b/tmux-mem-cpu-load.cpp index 94ffcb5..513ae3e 100644 --- a/tmux-mem-cpu-load.cpp +++ b/tmux-mem-cpu-load.cpp @@ -162,28 +162,28 @@ int main(int argc, char** argv) unsigned int cpu_usage_delay = 900000; unsigned int graph_lines = 10; try - { - istringstream iss; - iss.exceptions ( ifstream::failbit | ifstream::badbit ); - if( argc > 1 ) { + istringstream iss; + iss.exceptions ( ifstream::failbit | ifstream::badbit ); + if( argc > 1 ) + { iss.str( argv[1] ); unsigned int status_interval; iss >> status_interval; cpu_usage_delay = status_interval * 1000000 - 100000; + } + if( argc > 2 ) + { + iss.str( argv[2] ); + iss.clear(); + iss >> graph_lines; + } } - if( argc > 2 ) - { - iss.str( argv[2] ); - iss.clear(); - iss >> graph_lines; - } - } catch(const exception &e) - { + { cerr << "Usage: " << argv[0] << " [tmux_status-interval(seconds)] [graph lines]" << endl; return 1; - } + } std::cout << mem_string() << ' ' << cpu_string( cpu_usage_delay, graph_lines ) << ' ' << load_string();