Commit Graph

151 Commits

Author SHA1 Message Date
Matt McCormick
d07e07ba01 Merge pull request #16 from thewtex/OSX-travis
Also run an OSX Travis build.
2015-01-27 23:04:05 -05:00
Matt McCormick
9dbf8086d4 Also run an OSX Travis build. 2015-01-26 15:57:36 -05:00
Matt McCormick
360ef2e9f2 Version bump to 3.0.0. v3.0.0 2015-01-20 08:11:40 -05:00
Matt McCormick
3e0789b3d3 CMakeLists.txt formatting. 2015-01-20 08:11:20 -05:00
Matt McCormick
68ab061cb4 Rename tmux-mem-cpu-load.cc to main.cc. 2015-01-20 08:05:28 -05:00
Matt McCormick
9498e06ac4 Collect top level code files into common directory.
A little more organized.
2015-01-20 08:04:02 -05:00
Matt McCormick
5132f338fd Merge pull request #14 from thewtex/option-compatibility
Option compatibility
2015-01-20 07:53:48 -05:00
Matt McCormick
040857a4e8 Fix unused expression result warnings on OSX. 2015-01-19 23:28:38 -05:00
Matt McCormick
ea0e620a46 Update the README for new usage. 2015-01-19 23:02:48 -05:00
Matt McCormick
fa4a5b5c2b Print error message to std::cerr. 2015-01-19 23:02:48 -05:00
Matt McCormick
1bfda9484a 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.
2015-01-19 23:02:04 -05:00
Matt McCormick
4c00be77ff Fix trailing whitespace. 2015-01-19 22:17:36 -05:00
Matt McCormick
5cd5a2468b Change tmux-mem-cpu-load extension to .cc for consistency. 2015-01-19 22:16:23 -05:00
Matt McCormick
05d226964a Fix trailing whitespace. 2015-01-19 22:14:36 -05:00
Matt McCormick
7e72e47d2c Fix authors name spelling. 2015-01-19 21:59:13 -05:00
Matt McCormick
17dbdfe9ea More consistent spacing in CMakeLists.txt. 2015-01-19 21:54:35 -05:00
Matt McCormick
87a92fa108 Use message(STATUS for OS detection messages.
Changes message output.  Preceeds with "--" for CMake status messages.
2015-01-19 21:50:47 -05:00
Matt McCormick
ca82149c10 Merge pull request #13 from l0ner/master
Pull l0ner/master into upstream.
2015-01-19 21:47:04 -05:00
Pawel "l0ner" Soltys
e459d40228 note about vim modelines and lower-case in CMake files 2015-01-19 18:01:53 +01:00
Pawel "l0ner" Soltys
ec6b1c6cc7 remove leftover argParse.cc reference from CMakeList.txt 2015-01-19 17:55:29 +01:00
Pawel "l0ner" Soltys
dd8253e6df added CONTRIBUTING file with instructions for eventual contributors 2015-01-19 17:51:40 +01:00
Pawel "l0ner" Soltys
08bc9b7ecf replaced argParser with getopt_long based one
Solves issue:
28040b61da (commitcomment-9327906)

No GPL2-based code anymore in the codebase.
2015-01-19 17:17:38 +01:00
Pawel "l0ner" Soltys
eb338d92c5 rename config.h back to version.h since it contains only version after last commit 2015-01-18 20:04:28 +01:00
Pawel "l0ner" Soltys
2fb24571ef use inline function for unit conversion instead of macros 2015-01-18 20:02:46 +01:00
Pawel "l0ner" Soltys
7c883b924a restore parsing of /proc/meminfo to get memory usage
See issue:
e7f2dd25e8 (commitcomment-9327932)

Unfortunately we can't pull info about cached memory from sysinfo.
Thus we need stick to /proc/meminfo parsing. See code for more comments.
2015-01-18 19:20:55 +01:00
Pawel "l0ner" Soltys
ed8ed793bf renamed bsd/common.h to getsysctl.h to better reflect it's function 2015-01-18 17:27:08 +01:00
Pawel "l0ner" Soltys
a53bbddef8 added cmake generated config.h file to gitignore 2015-01-18 17:24:17 +01:00
Pawel "l0ner" Soltys
d3eb9e3187 use macros from config.h to calculate megabyes
instead of using hard coded divisions to calculate ram stats it's better to use
macros defined in config.h. BSD port was doing this already, using macros
defined in it's common.h header. I pulled those macros out and applied them to
all platforms.
File version.h.in got renamed into config.h.in since it doesn't caontain only
the version anymore.
2015-01-18 17:21:19 +01:00
Pawel "l0ner" Soltys
b2084ea3b3 better c++11 detection
2cc9efb187 (commitcomment-9327965)

Instead of checking for compiler version or whether it supports c++ features
through target_compile_features test whether compiler supports one of the c++11
flags (-std=c++11 or -std=c++0x). Cleaner and simplier code. And we can make it
fail loudly if comiler does not support c++11
2015-01-18 16:59:19 +01:00
Pawel "l0ner" Soltys
ae4e160ede added test case for graph_lines = 0 2015-01-18 15:07:11 +01:00
Pawel "l0ner" Soltys
89a4b0c048 version defines prefixed with name, full version
now the version variables will be prefixed with 'tmux-mem-cpu-load'. This way we
won't clash with any future dependency that might redefine those variables.
This is exactly how CMake does it in their code, see:

f3e92d2816/Source/CMakeVersion.cmake
6ae98ee18f/Source/cmVersionConfig.h.in
6ae98ee18f/Source/CMakeVersionCompute.cmake

the only difference is that they have functions that return the versions and I
use those variables directly.

6ae98ee18f/Source/cmVersion.cxx

Since the partial version variables are not used anywhere in the code we might
as well remove them from version.h.in. I've deciced to leave them for now, since
we might need them in the future.
2015-01-18 15:04:09 +01:00
Pawel "l0ner" Soltys
51f85ba032 code syntax style, vim modelines, license
* Use std::sting instead of char[] in the graph drawing functions. This is the
  only change to the code. Rest is just styling.
* Corrected whole code to follow Allman/GNU coding style, with 2 spaces for each
  indentation step.
* Added license headers to all code files
* Added vim modelines to all files. They sit on the first line and enable the
  following settings: 2 space indentation, tab expansion to spaces, line at
  80th column, automatic line breaking on "\ !@*+-;:,./?" characters, automatic
  line break if line exceeds 80 colums. This should keep the code nice and tidy.
2015-01-18 14:36:59 +01:00
Pawel "l0ner" Soltys
d5506ac797 added myself (l0ner) to contributors list 2015-01-18 14:30:38 +01:00
Pawel "l0ner" Soltys
3f4647a278 added AUTHORS file to store all contributors 2015-01-18 14:27:30 +01:00
Pawel "l0ner" Soltys
f2b75f7531 graph.cc: coding style fixes 2015-01-17 23:48:54 +01:00
Pawel "l0ner" Soltys
1cc6b0c9ef CMake style corrections 2015-01-17 23:23:21 +01:00
Pawel "l0ner" Soltys
5fdb0e6227 remove merge leftovers from README 2015-01-17 17:15:01 +01:00
Pawel "l0ner" Soltys
acaf9b0b2b fixed typo in CMakeLists.txt 2015-01-17 16:46:33 +01:00
Pawel "l0ner" Soltys
3475328dc4 added note to README about C++11 reqirement 2015-01-17 16:37:45 +01:00
Pawel "l0ner" Soltys
2cc9efb187 added compiler (and it's version) detection
This should fix problems with different flags for c++11 across different gcc
versions. Should compile on Clang and gcc >= 4.6. Lower versions of gcc are
untested. I don't even know wheteher they support c++11 (gcc 4.2.1 on OpenBSD
5.7 does not).
2015-01-17 16:30:31 +01:00
Pawel "l0ner" Soltys
7151b70c70 Fixed typos in linux/load.cc 2015-01-17 16:23:55 +01:00
Pawel "l0ner" Soltys
ee39fccc65 Merge remote-tracking branch 'upstream/master'
Conflicts:
	CMakeLists.txt
	README.rst
	tmux-mem-cpu-load.cpp
2015-01-17 16:21:56 +01:00
Pawel "l0ner" Soltys
d692eeaf93 added missing include "load.h" 2015-01-12 15:58:31 +01:00
Pawel "l0ner" Soltys
f073450edd OSX: removed useless includes 2015-01-12 15:57:41 +01:00
Pawel "l0ner" Soltys
8264c6e2a2 drop OpenBSD support. See bsd/openBSD.txt for info 2015-01-12 15:21:43 +01:00
Pawel "l0ner" Soltys
a2df46dae5 colorized output on *BSD systems 2015-01-11 18:27:08 +01:00
Pawel "l0ner" Soltys
e8dd4b442f fixed functions headers to account for use_colors 2015-01-11 18:05:08 +01:00
Pawel "l0ner" Soltys
a2e8459457 fixed uncorrect ram usage
While (as per specification) size of total ram reported by sysctl should be
64 bits it's actually 32.
2015-01-11 18:03:22 +01:00
Pawel "l0ner" Soltys
df5d66fdbf fixed incorrect cpu usage
While (as for manual) correct size of cpu states variable sould be 64 bits,
the systctl actually return 32 bits for kern.cp_time.
2015-01-11 18:01:13 +01:00
Pawel "l0ner" Soltys
dba56f1b56 Merge branch 'l0ner' of github.com:l0ner/tmux-mem-cpu-load into l0ner 2015-01-10 18:39:45 +01:00