Skip to content

Commit

Permalink
fix duplicate version in argparse
Browse files Browse the repository at this point in the history
  • Loading branch information
GreatV committed Jun 2, 2024
1 parent d1c1eac commit 5a3e879
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
13 changes: 11 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,20 @@
#include "version.h"

int main(int argc, char *argv[]) {
argparse::ArgumentParser parser("labelme++");
parser.add_argument("-V", "--version")
argparse::ArgumentParser parser("labelme++", "0.0",
argparse::default_arguments::none);
parser.add_argument("--version", "-v")
.default_value(false)
.implicit_value(true)
.help("show version");
parser.add_argument("--reset-config")
.default_value(false)
.implicit_value(true)
.help("reset qt config");
parser.add_argument("--logger-level")
.default_value(std::string{"debug"})
.choices("debug", "info", "warning", "fatal", "error")
.help("logger level");

try {
parser.parse_args(argc, argv);
Expand Down
5 changes: 2 additions & 3 deletions widgets/label_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ class LabelDialog : public QDialog {
public:
explicit LabelDialog(const QString& text = "Enter object label",
QWidget* parent = nullptr,
const QStringList& labels = {},
const bool sort_labels = true,
const bool show_text_field = true,
const QStringList& labels = {}, bool sort_labels = true,
bool show_text_field = true,
const QString& completion = "startwith",
const std::map<QString, bool>& fit_to_content = {},
const std::map<QString, bool>& flags = {});
Expand Down

0 comments on commit 5a3e879

Please sign in to comment.