diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a96d89..35e5c88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (mastodon-cpp - VERSION 0.1.0 + VERSION 0.1.1 LANGUAGES CXX ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") diff --git a/README.md b/README.md index 591a439..3659cfd 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ All versions below 1.0.0 (SOVERSION 0) are considered insecure, unstable and can ### Development version - git clone https://… + git clone https://github.com/tastytea/mastodon-cpp.git ## Compile @@ -25,7 +25,7 @@ All versions below 1.0.0 (SOVERSION 0) are considered insecure, unstable and can cmake .. make -If you want to compile a debug build, use `cmake -DCMAKE_BUILD_TYPE=Debug` +If you want to compile a debug build, use `cmake -DCMAKE_BUILD_TYPE=Debug ..` instead. # Usage @@ -50,16 +50,16 @@ If you use a debug build, you get more verbose error messages. # TODO * Version 0.1.0 - * [x] Implement all GET methods + * [x] Implement all GET calls * [x] Usable error handling * [x] Network stuff * [x] Comprehensive example * Version 0.2.0 - * [ ] Implement all PATCH methods - * [ ] Implement all POST methods - * [ ] Implement all DELETE methods + * [ ] Implement all PATCH calls + * [ ] Implement all POST calls + * [ ] Implement all DELETE calls * Version 0.3.0 - * [ ] Handling HTTP statuses 301 & 302 + * [ ] Handle HTTP statuses 301 & 302 * Later * [ ] Escape user input * [ ] Asynchronous I/O diff --git a/src/api_get.cpp b/src/api_get.cpp index cb9c880..bf6615c 100644 --- a/src/api_get.cpp +++ b/src/api_get.cpp @@ -17,6 +17,7 @@ #include #include #include +#include "macros.hpp" #include "mastodon-cpp.hpp" using namespace Mastodon; @@ -74,7 +75,7 @@ const std::uint16_t API::get(const Mastodon::API::v1 &call, strcall = "/api/v1/timelines/public"; break; default: - cerr << "ERROR: Invalid call.\n"; + ttdebug << "ERROR: Invalid call.\n"; return 1; break; } @@ -168,7 +169,7 @@ const std::uint16_t API::get(const Mastodon::API::v1 &call, strcall = "/api/v1/timelines/list/" + argument; break; default: - cerr << "ERROR: Invalid call.\n"; + ttdebug << "ERROR: Invalid call.\n"; return 1; break; } diff --git a/src/example/example.cpp b/src/example/example.cpp index f28cc55..f37a0c7 100644 --- a/src/example/example.cpp +++ b/src/example/example.cpp @@ -32,8 +32,7 @@ int main(int argc, char *argv[]) "only_media=1" }; - ret = masto.get(API::v1::accounts_id_statuses, uid, - parameters, answer); + ret = masto.get(API::v1::accounts_id_statuses, uid,parameters, answer); if (ret == 0) { std::cout << answer << '\n'; @@ -64,6 +63,11 @@ int main(int argc, char *argv[]) return ret; } } + else + { + std::cerr << "Error code: " << ret << '\n'; + return ret; + } return 0; }