Skip to content

Commit f4f5c0f

Browse files
authored
Print version without help information (#27)
1 parent dbd11b0 commit f4f5c0f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ int main(int argc, char** argv)
3939
std::cout << "git2cpp version " << GIT2CPP_VERSION_STRING << " (libgit2 " << LIBGIT2_VERSION << ")" << std::endl;
4040
}
4141

42-
if (app.get_subcommands().size() == 0)
42+
if (app.get_subcommands().size() == 0 && !version)
4343
{
4444
std::cout << app.help() << std::endl;
4545
}

test/test_git.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ def test_version(git2cpp_path, arg):
88
p = subprocess.run(cmd, capture_output=True)
99
assert p.returncode == 0
1010
assert p.stderr == b''
11-
assert p.stdout.startswith(b'git2cpp ')
11+
assert p.stdout.startswith(b'git2cpp version ')
12+
assert p.stdout.count(b'\n') == 1
1213

1314

1415
def test_error_on_unknown_option(git2cpp_path):

0 commit comments

Comments
 (0)