diff --git a/src/main.cpp b/src/main.cpp index ca92d6d..f976363 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -39,7 +39,7 @@ int main(int argc, char** argv) std::cout << "git2cpp version " << GIT2CPP_VERSION_STRING << " (libgit2 " << LIBGIT2_VERSION << ")" << std::endl; } - if (app.get_subcommands().size() == 0) + if (app.get_subcommands().size() == 0 && !version) { std::cout << app.help() << std::endl; } diff --git a/test/test_git.py b/test/test_git.py index 67955ac..8bf5e4f 100644 --- a/test/test_git.py +++ b/test/test_git.py @@ -8,7 +8,8 @@ def test_version(git2cpp_path, arg): p = subprocess.run(cmd, capture_output=True) assert p.returncode == 0 assert p.stderr == b'' - assert p.stdout.startswith(b'git2cpp ') + assert p.stdout.startswith(b'git2cpp version ') + assert p.stdout.count(b'\n') == 1 def test_error_on_unknown_option(git2cpp_path):