From 3b29caaa54b1af81c9930831f0782c9fd8be9c8c Mon Sep 17 00:00:00 2001 From: tastytea Date: Fri, 9 Aug 2019 13:01:54 +0200 Subject: [PATCH] Changed error codes again. --- CMakeLists.txt | 2 +- man/remwharead.1.adoc | 14 +++++++------- src/cli/main.cpp | 11 +++++------ 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c3b0041..fb98630 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ if(${CMAKE_VERSION} VERSION_LESS 3.12) endif() project(remwharead - VERSION 0.7.1 + VERSION 0.7.2 LANGUAGES CXX) # DESCRIPTION was introduced in version 3.9. if(NOT (${CMAKE_VERSION} VERSION_LESS 3.9)) diff --git a/man/remwharead.1.adoc b/man/remwharead.1.adoc index ad5a725..ba76af4 100644 --- a/man/remwharead.1.adoc +++ b/man/remwharead.1.adoc @@ -2,7 +2,7 @@ :doctype: manpage :Author: tastytea :Email: tastytea@tastytea.de -:Date: 2019-08-08 +:Date: 2019-08-09 :Revision: 0.0.0 :man source: remwharead :man manual: General Commands Manual @@ -160,12 +160,12 @@ proxy support yet, sorry. == ERROR CODES [options="header",cols=">,<,<"] -|=================================================================== -| Code | Error name | Explanation -| 5 | EIO | File / database could not be opened. -| 22 | EINVAL | Missing options / Argument not understood. -| 113 | EHOSTUNREACH | Could not fetch URI. -|=================================================================== +|==================================================== +| Code | Explanation +| 1 | Missing options / Argument not understood. +| 2 | File / database could not be opened. +| 3 | Could not fetch URI. +|==================================================== == SEE ALSO diff --git a/src/cli/main.cpp b/src/cli/main.cpp index eef9087..f8058b8 100644 --- a/src/cli/main.cpp +++ b/src/cli/main.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include "sqlite.hpp" #include "remwharead_cli.hpp" #include "uri.hpp" @@ -55,7 +54,7 @@ int App::main(const std::vector &args) { if (_argument_error) { - return EINVAL; + return 1; } if (args.size() > 0) { @@ -64,7 +63,7 @@ int App::main(const std::vector &args) if (_uri.empty() && _format == export_format::undefined) { cerr << "Error: You have to specify either an URI or --export.\n"; - return EINVAL; + return 1; } } @@ -72,7 +71,7 @@ int App::main(const std::vector &args) if (!db) { cerr << "Error: Database could not be opened.\n"; - return EIO; + return 2; } if (!_uri.empty()) @@ -83,7 +82,7 @@ int App::main(const std::vector &args) { cerr << "Error: Could not fetch page.\n"; cerr << page.error << endl; - return EHOSTUNREACH; + return 3; } archive_answer archive; if (_archive) @@ -105,7 +104,7 @@ int App::main(const std::vector &args) if (!file.good()) { cerr << "Error: Could not open file: " << _file << endl; - return EIO; + return 2; } }