Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
taganaka committed Jun 7, 2016
1 parent 72d4029 commit 0aa2e2b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ cmake_minimum_required(VERSION 2.6)
project(SpeedTest)

set (SpeedTest_VERSION_MAJOR 1)
set (SpeedTest_VERSION_MINOR 1)
set (SpeedTest_VERSION_MINOR 2)
set (SpeedTest_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR})
set (SpeedTest_SYSTEM ${CMAKE_SYSTEM})

set (SpeedTest_AUTHOR "Francesco Laurita <francesco.laurita@gmail.com>")
set (SpeedTest_HOME_PAGE "https://github.com/taganaka/SpeedTest")
set (SpeedTest_USER_AGENT "Mozilla/5.0 ${CMAKE_SYSTEM}; U; ${CMAKE_SYSTEM_PROCESSOR}; en-us (KHTML, like Gecko) SpeedTest++/${SpeedTest_VERSION_MAJOR}.${SpeedTest_VERSION_MINOR}")
set (SpeedTest_SERVER_LIST_URL "http://www.speedtest.net/speedtest-servers-static.php")
set (SpeedTest_IP_INFO_API_URL "http://speedtest.ookla.com/api/ipaddress.php")
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ $ make install

```
$ SpeedTest --help
SpeedTest++ version 1.0
speedtest.net command line interface
SpeedTest++ version 1.2
Speedtest.net command line interface
Info: https://github.com/taganaka/SpeedTest
Author: Francesco Laurita <francesco.laurita@gmail.com>
usage: SpeedTest [--latency] [--download] [--upload] [--help]
usage: ./SpeedTest [--latency] [--download] [--upload] [--help] [--share]
optional arguments:
--help Show this message and exit
--latency Perform latency test only
Expand Down
1 change: 1 addition & 0 deletions SpeedTestConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#define SpeedTest_SYSTEM_PROCESSOR "@SpeedTest_SYSTEM_PROCESSOR@"
#define SpeedTest_SYSTEM "@SpeedTest_SYSTEM@"
#define SpeedTest_AUTHOR "@SpeedTest_AUTHOR@"
#define SpeedTest_HOME_PAGE "@SpeedTest_HOME_PAGE@"

#define SPEED_TEST_USER_AGENT "@SpeedTest_USER_AGENT@"
#define SPEED_TEST_SERVER_LIST_URL "@SpeedTest_SERVER_LIST_URL@"
Expand Down
7 changes: 4 additions & 3 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@

void banner(){
std::cout << "SpeedTest++ version " << SpeedTest_VERSION_MAJOR << "." << SpeedTest_VERSION_MINOR << std::endl;
std::cout << "speedtest.net command line interface" << std::endl;
std::cout << "Speedtest.net command line interface" << std::endl;
std::cout << "Info: " << SpeedTest_HOME_PAGE << std::endl;
std::cout << "Author: " << SpeedTest_AUTHOR << std::endl;
}

void usage(const char* name){
std::cout << "usage: " << name << " ";
std::cout << "[--latency] [--download] [--upload] [--help]" << std::endl;
std::cout << "[--latency] [--download] [--upload] [--help] [--share]" << std::endl;
std::cout << "optional arguments:" << std::endl;
std::cout << "\t--help Show this message and exit\n";
std::cout << "\t--latency Perform latency test only\n";
Expand Down Expand Up @@ -86,7 +87,7 @@ int main(const int argc, const char **argv) {
if (sp.jitter(serverInfo, tjitter)){
std::cout << tjitter << " ms." << std::endl;
} else {
std::cout << "Jitter measurement is unable at this time." << std::endl;
std::cout << "Jitter measurement is unavailable at this time." << std::endl;
}

if (latency_only)
Expand Down

0 comments on commit 0aa2e2b

Please sign in to comment.