From 392eb85c8a0010022f26744b696b14918881071d Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Mon, 12 Feb 2024 12:41:07 +0100 Subject: [PATCH 1/3] [MISC] Positional options never have ID --- include/sharg/detail/format_tdl.hpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/sharg/detail/format_tdl.hpp b/include/sharg/detail/format_tdl.hpp index 1b9b612a..6d544fef 100644 --- a/include/sharg/detail/format_tdl.hpp +++ b/include/sharg/detail/format_tdl.hpp @@ -304,10 +304,6 @@ class format_tdl : format_base .tags = {}, .value = tdl::StringValue{}, }); - if (!config.long_id.empty()) - { - info.cliMapping.emplace_back("--" + config.long_id, config.long_id); - } }); } From c0a3f6c591b910a81362702d287c2c8f8986c5ee Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Mon, 12 Feb 2024 12:42:06 +0100 Subject: [PATCH 2/3] [FIX] CWL/CTD: positional options are required positional list options are optional --- include/sharg/detail/format_tdl.hpp | 19 +++++++++++++------ test/unit/detail/format_ctd_test.cpp | 4 ++-- test/unit/detail/format_cwl_test.cpp | 8 ++++---- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/include/sharg/detail/format_tdl.hpp b/include/sharg/detail/format_tdl.hpp index 6d544fef..418ae3ac 100644 --- a/include/sharg/detail/format_tdl.hpp +++ b/include/sharg/detail/format_tdl.hpp @@ -298,12 +298,19 @@ class format_tdl : format_base ++positional_option_count; auto description = config.description + default_message + validator_message; - parameters.push_back(tdl::Node{ - .name = id, - .description = description, - .tags = {}, - .value = tdl::StringValue{}, - }); + parameters.push_back(tdl::Node{.name = id, .description = description}); + + auto & node = parameters.back(); + + if constexpr (detail::is_container_option) + { + node.value = tdl::StringValueList{}; + } + else + { + node.value = tdl::StringValue{}; + node.tags.insert("required"); + } }); } diff --git a/test/unit/detail/format_ctd_test.cpp b/test/unit/detail/format_ctd_test.cpp index b6d5a66f..0a78b814 100644 --- a/test/unit/detail/format_ctd_test.cpp +++ b/test/unit/detail/format_ctd_test.cpp @@ -45,9 +45,9 @@ struct format_ctd_test : public ::testing::Test "\n" R"del( )del" "\n" - R"del( )del" + R"del( )del" "\n" - R"del( )del" + R"del( )del" "\n" R"del( )del" "\n" diff --git a/test/unit/detail/format_cwl_test.cpp b/test/unit/detail/format_cwl_test.cpp index dcbed405..88c01c3c 100644 --- a/test/unit/detail/format_cwl_test.cpp +++ b/test/unit/detail/format_cwl_test.cpp @@ -85,10 +85,10 @@ TEST(format_cwl_test, full_information) "inputs:\n" " positional_0:\n" " doc: this is a positional option.\n" - " type: string?\n" + " type: string\n" " positional_1:\n" " doc: \"this is a positional option. Default: []\"\n" - " type: string?\n" + " type: string[]?\n" " int:\n" " doc: \"this is a int option. Default: 5\"\n" " type: long?\n" @@ -215,10 +215,10 @@ TEST(format_cwl_test, subparser) "inputs:\n" " positional_0:\n" " doc: this is a positional option.\n" - " type: string?\n" + " type: string\n" " positional_1:\n" " doc: \"this is a positional option. Default: []\"\n" - " type: string?\n" + " type: string[]?\n" " int:\n" " doc: \"this is a int option. Default: 5\"\n" " type: long?\n" From fb246f55731ef537be55d62fe92f871f3bdb39b2 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Wed, 14 Feb 2024 12:35:41 +0100 Subject: [PATCH 3/3] [TEST] API patches --- .../1.1.1/0001-API-Update-TDL.patch | 4 +- .../0002-API-Quoted-strings-and-paths.patch | 4 +- .../1.1.1/0003-NOAPI-Update-copyright.patch | 4 +- .../1.1.1/0004-INFRA-Update-TDL.patch | 4 +- .../0005-INFRA-Use-seqan3-main-branch.patch | 4 +- ...PI-FIX-positional-options-in-CWL-CTD.patch | 59 +++++++++++++++++++ ...ositional-options-in-CWL-CTD.patch.license | 3 + 7 files changed, 72 insertions(+), 10 deletions(-) create mode 100644 test/api_stability/1.1.1/0006-API-FIX-positional-options-in-CWL-CTD.patch create mode 100644 test/api_stability/1.1.1/0006-API-FIX-positional-options-in-CWL-CTD.patch.license diff --git a/test/api_stability/1.1.1/0001-API-Update-TDL.patch b/test/api_stability/1.1.1/0001-API-Update-TDL.patch index a8667a6a..760d0ce5 100644 --- a/test/api_stability/1.1.1/0001-API-Update-TDL.patch +++ b/test/api_stability/1.1.1/0001-API-Update-TDL.patch @@ -1,7 +1,7 @@ -From ace25c7fffccdac9ccaf81329ada87f60021b5f9 Mon Sep 17 00:00:00 2001 +From 769620513bcc59d257119aacfa06020df7ca45a6 Mon Sep 17 00:00:00 2001 From: Simon Gene Gottlieb Date: Thu, 5 Oct 2023 13:43:30 +0200 -Subject: [PATCH 1/5] [API] Update TDL +Subject: [PATCH 1/6] [API] Update TDL --- test/unit/detail/format_ctd_test.cpp | 2 +- diff --git a/test/api_stability/1.1.1/0002-API-Quoted-strings-and-paths.patch b/test/api_stability/1.1.1/0002-API-Quoted-strings-and-paths.patch index e892bb1f..eea4a98a 100644 --- a/test/api_stability/1.1.1/0002-API-Quoted-strings-and-paths.patch +++ b/test/api_stability/1.1.1/0002-API-Quoted-strings-and-paths.patch @@ -1,7 +1,7 @@ -From 7bf847b4991636a59f26ca89977e94f51edfbf11 Mon Sep 17 00:00:00 2001 +From 9d8035baa8b0ff4accd6ba2e60a22f779986483d Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Mon, 5 Feb 2024 16:02:03 +0100 -Subject: [PATCH 2/5] [API] Quoted strings and paths +Subject: [PATCH 2/6] [API] Quoted strings and paths --- test/snippet/readme_sneak_peek.out | 6 ++--- diff --git a/test/api_stability/1.1.1/0003-NOAPI-Update-copyright.patch b/test/api_stability/1.1.1/0003-NOAPI-Update-copyright.patch index 23aa68da..a1ae6647 100644 --- a/test/api_stability/1.1.1/0003-NOAPI-Update-copyright.patch +++ b/test/api_stability/1.1.1/0003-NOAPI-Update-copyright.patch @@ -1,7 +1,7 @@ -From f02ddb2f31a47da16742dbf612d780b328e7602b Mon Sep 17 00:00:00 2001 +From a4fffdf64380b018822b13a9ad72586f0564385f Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Wed, 7 Feb 2024 13:31:22 +0100 -Subject: [PATCH 3/5] [NOAPI] Update copyright +Subject: [PATCH 3/6] [NOAPI] Update copyright --- test/unit/detail/format_help_test.cpp | 10 +++++----- diff --git a/test/api_stability/1.1.1/0004-INFRA-Update-TDL.patch b/test/api_stability/1.1.1/0004-INFRA-Update-TDL.patch index 34fc025d..10c9b6e7 100644 --- a/test/api_stability/1.1.1/0004-INFRA-Update-TDL.patch +++ b/test/api_stability/1.1.1/0004-INFRA-Update-TDL.patch @@ -1,7 +1,7 @@ -From 9f040f8ccb8d304841d24d8ac4d67db0d06c370f Mon Sep 17 00:00:00 2001 +From 1481f5dfdc68d2d5e04cb5abbec45fab7f15fbcd Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 9 Feb 2024 16:17:21 +0100 -Subject: [PATCH 4/5] [INFRA] Update TDL +Subject: [PATCH 4/6] [INFRA] Update TDL --- test/unit/detail/format_cwl_test.cpp | 28 +++++++++++++++++++++++++++- diff --git a/test/api_stability/1.1.1/0005-INFRA-Use-seqan3-main-branch.patch b/test/api_stability/1.1.1/0005-INFRA-Use-seqan3-main-branch.patch index f2e61487..3adb36ab 100644 --- a/test/api_stability/1.1.1/0005-INFRA-Use-seqan3-main-branch.patch +++ b/test/api_stability/1.1.1/0005-INFRA-Use-seqan3-main-branch.patch @@ -1,7 +1,7 @@ -From 3a7dfd8103806e97af6376e9173d686b67fb5b52 Mon Sep 17 00:00:00 2001 +From 085bc1fd63f3c48999610e0a9a916895a7cf9207 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 9 Feb 2024 18:13:36 +0100 -Subject: [PATCH 5/5] [INFRA] Use seqan3 main branch +Subject: [PATCH 5/6] [INFRA] Use seqan3 main branch --- test/unit/detail/CMakeLists.txt | 2 +- diff --git a/test/api_stability/1.1.1/0006-API-FIX-positional-options-in-CWL-CTD.patch b/test/api_stability/1.1.1/0006-API-FIX-positional-options-in-CWL-CTD.patch new file mode 100644 index 00000000..af02ddb9 --- /dev/null +++ b/test/api_stability/1.1.1/0006-API-FIX-positional-options-in-CWL-CTD.patch @@ -0,0 +1,59 @@ +From c84f8aeeba0895677c64d9740f4df908674cd0be Mon Sep 17 00:00:00 2001 +From: Enrico Seiler +Date: Wed, 14 Feb 2024 12:34:40 +0100 +Subject: [PATCH 6/6] [API][FIX] positional options in CWL/CTD + +--- + test/unit/detail/format_ctd_test.cpp | 4 ++-- + test/unit/detail/format_cwl_test.cpp | 8 ++++---- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/test/unit/detail/format_ctd_test.cpp b/test/unit/detail/format_ctd_test.cpp +index eb14047..4e9261a 100644 +--- a/test/unit/detail/format_ctd_test.cpp ++++ b/test/unit/detail/format_ctd_test.cpp +@@ -42,9 +42,9 @@ struct format_ctd_test : public ::testing::Test + "\n" + R"del( )del" + "\n" +- R"del( )del" ++ R"del( )del" + "\n" +- R"del( )del" ++ R"del( )del" + "\n" + R"del( )del" + "\n" +diff --git a/test/unit/detail/format_cwl_test.cpp b/test/unit/detail/format_cwl_test.cpp +index eaf0cad..52079db 100644 +--- a/test/unit/detail/format_cwl_test.cpp ++++ b/test/unit/detail/format_cwl_test.cpp +@@ -82,10 +82,10 @@ TEST(format_cwl_test, full_information) + "inputs:\n" + " positional_0:\n" + " doc: this is a positional option.\n" +- " type: string?\n" ++ " type: string\n" + " positional_1:\n" + " doc: \"this is a positional option. Default: []\"\n" +- " type: string?\n" ++ " type: string[]?\n" + " int:\n" + " doc: \"this is a int option. Default: 5\"\n" + " type: long?\n" +@@ -212,10 +212,10 @@ TEST(format_cwl_test, subparser) + "inputs:\n" + " positional_0:\n" + " doc: this is a positional option.\n" +- " type: string?\n" ++ " type: string\n" + " positional_1:\n" + " doc: \"this is a positional option. Default: []\"\n" +- " type: string?\n" ++ " type: string[]?\n" + " int:\n" + " doc: \"this is a int option. Default: 5\"\n" + " type: long?\n" +-- +2.43.0 + diff --git a/test/api_stability/1.1.1/0006-API-FIX-positional-options-in-CWL-CTD.patch.license b/test/api_stability/1.1.1/0006-API-FIX-positional-options-in-CWL-CTD.patch.license new file mode 100644 index 00000000..706402f5 --- /dev/null +++ b/test/api_stability/1.1.1/0006-API-FIX-positional-options-in-CWL-CTD.patch.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin +SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik +SPDX-License-Identifier: BSD-3-Clause