Changed error codes, fixed documentation

This commit is contained in:
tastytea 2018-02-18 15:10:53 +01:00
parent 0daf373d3c
commit 84f5503954
Signed by: tastytea
GPG Key ID: 59346E0EA35C67E5
4 changed files with 4 additions and 8 deletions

View File

@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.7)
include(GNUInstallDirs) include(GNUInstallDirs)
project (mastorss project (mastorss
VERSION 0.2.3 VERSION 0.2.4
LANGUAGES CXX LANGUAGES CXX
) )

View File

@ -50,11 +50,7 @@ The profile can't be named "global".
| 0 | No error | | 0 | No error |
| 1 | Invalid call | | 1 | Invalid call |
| 2 | Not implemented | | 2 | Not implemented |
| 16 | Connection failed | | 10 | Wrong number of arguments |
| 17 | TLS error |
| 18 | Invalid response from server |
| 32 | Wrong number of arguments |
| 33 | File not found |
| 100 - 999 | HTTP status codes | | 100 - 999 | HTTP status codes |
| 65535 | Unknown exception | | 65535 | Unknown exception |

View File

@ -45,7 +45,7 @@ int main(int argc, char *argv[])
if (argc < 2) if (argc < 2)
{ {
cerr << "usage: " << argv[0] << " <profile> [max size]\n"; cerr << "usage: " << argv[0] << " <profile> [max size]\n";
return 32; return 10;
} }
if (argc == 3) if (argc == 3)

View File

@ -99,12 +99,12 @@ std::vector<string> parse_website(const string &profile, const string &xml)
str = std::regex_replace(str, relt, "<"); str = std::regex_replace(str, relt, "<");
str = std::regex_replace(str, regt, ">"); str = std::regex_replace(str, regt, ">");
str = std::regex_replace(str, std::regex("[\\n\\r]+"), "\n"); // remove excess newlines
str = std::regex_replace(str, reparagraph, "\n\n"); str = std::regex_replace(str, reparagraph, "\n\n");
str = std::regex_replace(str, recdata1, ""); str = std::regex_replace(str, recdata1, "");
str = std::regex_replace(str, recdata2, ""); str = std::regex_replace(str, recdata2, "");
str = std::regex_replace(str, restrip, ""); str = std::regex_replace(str, restrip, "");
str = std::regex_replace(str, reindyfuckup, ""); str = std::regex_replace(str, reindyfuckup, "");
str = std::regex_replace(str, std::regex("[\\n\\r]+"), "\n"); // remove excess newlines
for (const string &hashtag : watchwords) for (const string &hashtag : watchwords)
{ {