diff --git a/src/cli/CMakeLists.txt b/src/cli/CMakeLists.txt index 4456cbeaa..70dd420d5 100644 --- a/src/cli/CMakeLists.txt +++ b/src/cli/CMakeLists.txt @@ -28,4 +28,5 @@ target_link_libraries(keepassxc-cli keepassx_core Qt5::Core ${GCRYPT_LIBRARIES} + ${GPGERROR_LIBRARIES} ${ZLIB_LIBRARIES}) diff --git a/src/cli/keepassxc-cli.cpp b/src/cli/keepassxc-cli.cpp index 78b111647..7df4d7d87 100644 --- a/src/cli/keepassxc-cli.cpp +++ b/src/cli/keepassxc-cli.cpp @@ -57,20 +57,18 @@ int main(int argc, char **argv) QString commandName = args.at(0); for (int i = 1; i < argc - 1; ++i) { - argv[i] = argv[i+1]; + argv[i] = argv[i + 1]; } argv[argc - 1] = nullptr; - argc--; + --argc; - if (commandName == "merge") - { - argv[0] = const_cast("keepassxc-cli merge"); + if (commandName == "merge") { + argv[0] = const_cast("keepassxc-cli merge"); return Merge::execute(argc, argv); } - if (commandName == "extract") - { - argv[0] = const_cast("keepassxc-cli extract"); + if (commandName == "extract") { + argv[0] = const_cast("keepassxc-cli extract"); return Extract::execute(argc, argv); }