diff --git a/CHANGELOG.md b/CHANGELOG.md index f464d5e604..dc8c658f1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,7 +52,7 @@ Note that 3.1.0 will be the first API stable release and interfaces in this rele * `seqan3::argument_parser::add_line` * `seqan3::argument_parser::add_list_item` Note that other `seqan3::argument_parser::option_spec`s like `REQUIRED` are ignored. -* We expanded the `seqan3::output_file_validator`, with a parameter `seqan3::output_file_open_mode` to allow overwriting +* We expanded the `seqan3::output_file_validator`, with a parameter `seqan3::output_file_open_options` to allow overwriting output files ([\#2009](https://github.com/seqan/seqan3/pull/2009)). #### I/O diff --git a/doc/tutorial/argument_parser/index.md b/doc/tutorial/argument_parser/index.md index c5fee397da..240cc59c98 100644 --- a/doc/tutorial/argument_parser/index.md +++ b/doc/tutorial/argument_parser/index.md @@ -390,7 +390,7 @@ of the parsed option value. The validator throws a seqan3::validation_error exception whenever a given filename's extension is not in the given list of valid extensions. In addition, the seqan3::input_file_validator checks if the file exists, is a regular file and is readable. -Moreover, you have to add an additional flag seqan3::output_file_open_mode to the seqan3::output_file_validator, +Moreover, you have to add an additional flag seqan3::output_file_open_options to the seqan3::output_file_validator, which you can use to indicate whether you want to allow the output files to be overwritten. \note If you want to allow any extension just use a default constructed file validator. diff --git a/doc/tutorial/read_mapper/read_mapper_indexer_step1.cpp b/doc/tutorial/read_mapper/read_mapper_indexer_step1.cpp index 82ab675e01..51b94f6cd4 100644 --- a/doc/tutorial/read_mapper/read_mapper_indexer_step1.cpp +++ b/doc/tutorial/read_mapper/read_mapper_indexer_step1.cpp @@ -24,7 +24,7 @@ void initialise_argument_parser(seqan3::argument_parser & parser, cmd_arguments seqan3::input_file_validator{{"fa","fasta"}}); parser.add_option(args.index_path, 'o', "output", "The output index file path.", seqan3::option_spec::DEFAULT, - seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive, {"index"}}); + seqan3::output_file_validator{seqan3::output_file_open_options::create_new, {"index"}}); } //![main] diff --git a/doc/tutorial/read_mapper/read_mapper_indexer_step2.cpp b/doc/tutorial/read_mapper/read_mapper_indexer_step2.cpp index 87e825088d..7cb38adf97 100644 --- a/doc/tutorial/read_mapper/read_mapper_indexer_step2.cpp +++ b/doc/tutorial/read_mapper/read_mapper_indexer_step2.cpp @@ -51,7 +51,7 @@ void initialise_argument_parser(seqan3::argument_parser & parser, cmd_arguments seqan3::input_file_validator{{"fa","fasta"}}); parser.add_option(args.index_path, 'o', "output", "The output index file path.", seqan3::option_spec::DEFAULT, - seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive, {"index"}}); + seqan3::output_file_validator{seqan3::output_file_open_options::create_new, {"index"}}); } int main(int argc, char const ** argv) diff --git a/doc/tutorial/read_mapper/read_mapper_indexer_step3.cpp b/doc/tutorial/read_mapper/read_mapper_indexer_step3.cpp index 630d00daf1..e756acdf32 100644 --- a/doc/tutorial/read_mapper/read_mapper_indexer_step3.cpp +++ b/doc/tutorial/read_mapper/read_mapper_indexer_step3.cpp @@ -66,7 +66,7 @@ void initialise_argument_parser(seqan3::argument_parser & parser, cmd_arguments seqan3::input_file_validator{{"fa","fasta"}}); parser.add_option(args.index_path, 'o', "output", "The output index file path.", seqan3::option_spec::DEFAULT, - seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive, {"index"}}); + seqan3::output_file_validator{seqan3::output_file_open_options::create_new, {"index"}}); } int main(int argc, char const ** argv) diff --git a/doc/tutorial/read_mapper/read_mapper_step1.cpp b/doc/tutorial/read_mapper/read_mapper_step1.cpp index 497e695025..f22d99b94a 100644 --- a/doc/tutorial/read_mapper/read_mapper_step1.cpp +++ b/doc/tutorial/read_mapper/read_mapper_step1.cpp @@ -39,7 +39,7 @@ void initialise_argument_parser(seqan3::argument_parser & parser, cmd_arguments seqan3::input_file_validator{{"index"}}); parser.add_option(args.sam_path, 'o', "output", "The output SAM file path.", seqan3::option_spec::DEFAULT, - seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive, {"sam"}}); + seqan3::output_file_validator{seqan3::output_file_open_options::create_new, {"sam"}}); parser.add_option(args.errors, 'e', "error", "Maximum allowed errors.", seqan3::option_spec::DEFAULT, seqan3::arithmetic_range_validator{0, 4}); diff --git a/doc/tutorial/read_mapper/read_mapper_step2.cpp b/doc/tutorial/read_mapper/read_mapper_step2.cpp index c7499a6ccf..1d7adb557b 100644 --- a/doc/tutorial/read_mapper/read_mapper_step2.cpp +++ b/doc/tutorial/read_mapper/read_mapper_step2.cpp @@ -103,7 +103,7 @@ void initialise_argument_parser(seqan3::argument_parser & parser, cmd_arguments seqan3::input_file_validator{{"index"}}); parser.add_option(args.sam_path, 'o', "output", "The output SAM file path.", seqan3::option_spec::DEFAULT, - seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive, {"sam"}}); + seqan3::output_file_validator{seqan3::output_file_open_options::create_new, {"sam"}}); parser.add_option(args.errors, 'e', "error", "Maximum allowed errors.", seqan3::option_spec::DEFAULT, seqan3::arithmetic_range_validator{0, 4}); diff --git a/doc/tutorial/read_mapper/read_mapper_step3.cpp b/doc/tutorial/read_mapper/read_mapper_step3.cpp index cf05fcb79c..200168b385 100644 --- a/doc/tutorial/read_mapper/read_mapper_step3.cpp +++ b/doc/tutorial/read_mapper/read_mapper_step3.cpp @@ -126,7 +126,7 @@ void initialise_argument_parser(seqan3::argument_parser & parser, cmd_arguments seqan3::input_file_validator{{"index"}}); parser.add_option(args.sam_path, 'o', "output", "The output SAM file path.", seqan3::option_spec::DEFAULT, - seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive, {"sam"}}); + seqan3::output_file_validator{seqan3::output_file_open_options::create_new, {"sam"}}); parser.add_option(args.errors, 'e', "error", "Maximum allowed errors.", seqan3::option_spec::DEFAULT, seqan3::arithmetic_range_validator{0, 4}); diff --git a/doc/tutorial/read_mapper/read_mapper_step4.cpp b/doc/tutorial/read_mapper/read_mapper_step4.cpp index 6011819011..6e15a735ab 100644 --- a/doc/tutorial/read_mapper/read_mapper_step4.cpp +++ b/doc/tutorial/read_mapper/read_mapper_step4.cpp @@ -134,7 +134,7 @@ void initialise_argument_parser(seqan3::argument_parser & parser, cmd_arguments seqan3::input_file_validator{{"index"}}); parser.add_option(args.sam_path, 'o', "output", "The output SAM file path.", seqan3::option_spec::DEFAULT, - seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive, {"sam"}}); + seqan3::output_file_validator{seqan3::output_file_open_options::create_new, {"sam"}}); parser.add_option(args.errors, 'e', "error", "Maximum allowed errors.", seqan3::option_spec::DEFAULT, seqan3::arithmetic_range_validator{0, 4}); diff --git a/include/seqan3/argument_parser/validators.hpp b/include/seqan3/argument_parser/validators.hpp index 3fc4fbdec9..b1195822e6 100644 --- a/include/seqan3/argument_parser/validators.hpp +++ b/include/seqan3/argument_parser/validators.hpp @@ -575,12 +575,12 @@ class input_file_validator : public file_validator_base }; //!\brief Mode of an output file: Determines whether an existing file is accepted for writing. -enum output_file_open_mode +enum output_file_open_options { //!\brief Allow to overwrite the output file - overwritable, + open_or_create, //!\brief Forbid overwriting the output file - exclusive + create_new }; /*!\brief A validator that checks if a given path is a valid output file. @@ -611,7 +611,7 @@ class output_file_validator : public file_validator_base { private: //!\brief Stores the current mode of whether it is valid to overwrite the output file. - output_file_open_mode mode; + output_file_open_options mode; public: static_assert(std::same_as || detail::has_type_valid_formats, @@ -639,7 +639,7 @@ class output_file_validator : public file_validator_base * This constructor is only available if `file_t` does not name a valid seqan3 file type that contains a * static member `valid_formats`. */ - explicit output_file_validator(output_file_open_mode const mode) : file_validator_base{}, mode{mode} + explicit output_file_validator(output_file_open_options const mode) : file_validator_base{}, mode{mode} { if constexpr (!std::same_as) file_validator_base::extensions = detail::valid_file_extensions(); @@ -654,7 +654,7 @@ class output_file_validator : public file_validator_base * This constructor is only available if `file_t` does not name a valid seqan3 file type that contains a * static member `valid_formats`. */ - explicit output_file_validator(output_file_open_mode const mode, std::vector extensions) + explicit output_file_validator(output_file_open_options const mode, std::vector extensions) //!\cond requires std::same_as //!\endcond @@ -679,7 +679,7 @@ class output_file_validator : public file_validator_base { try { - if ((mode == exclusive) && std::filesystem::exists(file)) + if ((mode == create_new) && std::filesystem::exists(file)) throw validation_error{detail::to_string("The file ", file, " already exists!")}; // Check if file has any write permissions. @@ -700,9 +700,9 @@ class output_file_validator : public file_validator_base //!\brief Returns a message that can be appended to the (positional) options help page info. std::string get_help_page_message() const { - if (mode == overwritable) + if (mode == open_or_create) return "Write permissions must be granted." + valid_extensions_help_page_message(); - else // mode == exclusive + else // mode == create_new return "The output file must not exist already and write permissions must be granted." + valid_extensions_help_page_message(); } diff --git a/test/snippet/argument_parser/validators_output_directory.cpp b/test/snippet/argument_parser/validators_output_directory.cpp index 97b5b13fbd..a70aed7476 100644 --- a/test/snippet/argument_parser/validators_output_directory.cpp +++ b/test/snippet/argument_parser/validators_output_directory.cpp @@ -11,7 +11,7 @@ int main(int argc, const char ** argv) myparser.add_option(mydir, 'd', "dir", "The output directory for storing the files.", seqan3::option_spec::DEFAULT, - seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive}); + seqan3::output_file_validator{seqan3::output_file_open_options::create_new}); //! [validator_call] // an exception will be thrown if the user specifies a directory that cannot be created by the filesystem either diff --git a/test/snippet/argument_parser/validators_output_file.cpp b/test/snippet/argument_parser/validators_output_file.cpp index 571fcb5337..31c540aec9 100644 --- a/test/snippet/argument_parser/validators_output_file.cpp +++ b/test/snippet/argument_parser/validators_output_file.cpp @@ -9,12 +9,12 @@ int main(int argc, const char ** argv) //! [validator_call] std::filesystem::path myfile{}; - // Add the output_file_open_mode, to allow overwriting existing files, or to avoid this. + // Add the output_file_open_options, to allow overwriting existing files, or to avoid this. myparser.add_option(myfile,'f',"file","Output file containing the processed sequences.", seqan3::option_spec::DEFAULT, - seqan3::output_file_validator{seqan3::output_file_open_mode::overwritable, {"fa","fasta"}}); + seqan3::output_file_validator{seqan3::output_file_open_options::open_or_create, {"fa","fasta"}}); // or - // seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive, {"fa","fasta"}}); + // seqan3::output_file_validator{seqan3::output_file_open_options::create_new, {"fa","fasta"}}); //! [validator_call] // an exception will be thrown if the user specifies a filename diff --git a/test/snippet/argument_parser/validators_output_file_ext_from_file.cpp b/test/snippet/argument_parser/validators_output_file_ext_from_file.cpp index 3bd9c937e2..f24c85efba 100644 --- a/test/snippet/argument_parser/validators_output_file_ext_from_file.cpp +++ b/test/snippet/argument_parser/validators_output_file_ext_from_file.cpp @@ -5,16 +5,18 @@ int main(int argc, const char ** argv) { // Default constructed validator has an empty extension list. - seqan3::output_file_validator validator1{seqan3::output_file_open_mode::exclusive}; + seqan3::output_file_validator validator1{seqan3::output_file_open_options::create_new}; seqan3::debug_stream << validator1.get_help_page_message() << "\n"; // Specify your own extensions for the output file. - seqan3::output_file_validator validator2{seqan3::output_file_open_mode::exclusive, + seqan3::output_file_validator validator2{seqan3::output_file_open_options::create_new, std::vector{std::string{"exe"}, std::string{"fasta"}}}; seqan3::debug_stream << validator2.get_help_page_message() << "\n"; // Give the seqan3 file type as a template argument to get all valid extensions for this file. - seqan3::output_file_validator> validator3{seqan3::output_file_open_mode::exclusive}; + seqan3::output_file_validator> validator3{ + seqan3::output_file_open_options::create_new + }; seqan3::debug_stream << validator3.get_help_page_message() << "\n"; return 0; diff --git a/test/unit/argument_parser/format_parse_validators_test.cpp b/test/unit/argument_parser/format_parse_validators_test.cpp index da396cb700..a7bbb1c489 100644 --- a/test/unit/argument_parser/format_parse_validators_test.cpp +++ b/test/unit/argument_parser/format_parse_validators_test.cpp @@ -209,14 +209,14 @@ TEST(validator_test, output_file) { // single file { // empty list of file. - seqan3::output_file_validator my_validator{seqan3::output_file_open_mode::exclusive}; + seqan3::output_file_validator my_validator{seqan3::output_file_open_options::create_new}; EXPECT_NO_THROW(my_validator(tmp_name.get_path())); } { // file does not exist remove(tmp_name_2.get_path()); std::filesystem::path not_existing_path{tmp_name_2.get_path()}; - seqan3::output_file_validator my_validator{seqan3::output_file_open_mode::exclusive}; + seqan3::output_file_validator my_validator{seqan3::output_file_open_options::create_new}; my_validator(not_existing_path); EXPECT_NO_THROW(my_validator(not_existing_path)); } @@ -224,26 +224,26 @@ TEST(validator_test, output_file) { // file does exist but allow to overwrite it (without given formats to the validator) std::ofstream tmp_file_2(tmp_name_2.get_path()); std::filesystem::path existing_path{tmp_name_2.get_path()}; - seqan3::output_file_validator my_validator{seqan3::output_file_open_mode::overwritable}; + seqan3::output_file_validator my_validator{seqan3::output_file_open_options::open_or_create}; EXPECT_NO_THROW(my_validator(existing_path)); } { // file does exist & overwriting is prohibited std::ofstream tmp_file_2(tmp_name_2.get_path()); std::filesystem::path existing_path{tmp_name_2.get_path()}; - seqan3::output_file_validator my_validator{seqan3::output_file_open_mode::exclusive, formats}; + seqan3::output_file_validator my_validator{seqan3::output_file_open_options::create_new, formats}; EXPECT_THROW(my_validator(existing_path), seqan3::validation_error); } { // file does exist but allow to overwrite it std::ofstream tmp_file_2(tmp_name_2.get_path()); std::filesystem::path existing_path{tmp_name_2.get_path()}; - seqan3::output_file_validator my_validator{seqan3::output_file_open_mode::overwritable, formats}; + seqan3::output_file_validator my_validator{seqan3::output_file_open_options::open_or_create, formats}; EXPECT_NO_THROW(my_validator(existing_path)); } { // file has wrong format. - seqan3::output_file_validator my_validator{seqan3::output_file_open_mode::exclusive, + seqan3::output_file_validator my_validator{seqan3::output_file_open_options::create_new, std::vector{std::string{"sam"}}}; EXPECT_THROW(my_validator(tmp_name.get_path()), seqan3::validation_error); } @@ -251,14 +251,14 @@ TEST(validator_test, output_file) { // file has no extension. std::filesystem::path no_extension{tmp_name.get_path()}; no_extension.replace_extension(); - seqan3::output_file_validator my_validator{seqan3::output_file_open_mode::exclusive, formats}; + seqan3::output_file_validator my_validator{seqan3::output_file_open_options::create_new, formats}; EXPECT_THROW(my_validator(no_extension), seqan3::validation_error); } { // read from file // ToDo this is should throw an error: seqan3::output_file_validator my_validator{}; // And: seqan3::output_file_validator{}; - seqan3::output_file_validator my_validator{seqan3::output_file_open_mode::exclusive}; + seqan3::output_file_validator my_validator{seqan3::output_file_open_options::create_new}; EXPECT_NO_THROW(my_validator(tmp_name.get_path())); } @@ -271,7 +271,7 @@ TEST(validator_test, output_file) test_accessor::set_terminal_width(parser, 80); parser.add_option(file_out_path, 'o', "out-option", "desc", seqan3::option_spec::DEFAULT, - seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive, formats}); + seqan3::output_file_validator{seqan3::output_file_open_options::create_new, formats}); EXPECT_NO_THROW(parser.parse()); EXPECT_EQ(file_out_path.string(), path); @@ -288,7 +288,7 @@ TEST(validator_test, output_file) seqan3::argument_parser parser{"test_parser", 3, argv, false}; test_accessor::set_terminal_width(parser, 80); parser.add_positional_option(output_files, "desc", - seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive, formats}); + seqan3::output_file_validator{seqan3::output_file_open_options::create_new, formats}); EXPECT_NO_THROW(parser.parse()); EXPECT_EQ(output_files.size(), 2u); @@ -303,7 +303,7 @@ TEST(validator_test, output_file) seqan3::argument_parser parser{"test_parser", 2, argv, false}; test_accessor::set_terminal_width(parser, 80); parser.add_positional_option(path, "desc", - seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive, formats}); + seqan3::output_file_validator{seqan3::output_file_open_options::create_new, formats}); testing::internal::CaptureStdout(); EXPECT_EXIT(parser.parse(), ::testing::ExitedWithCode(EXIT_SUCCESS), ""); @@ -329,7 +329,7 @@ TEST(validator_test, output_file) seqan3::argument_parser parser{"test_parser", 2, argv, false}; test_accessor::set_terminal_width(parser, 80); parser.add_positional_option(path, "desc", - seqan3::output_file_validator{seqan3::output_file_open_mode::overwritable, + seqan3::output_file_validator{seqan3::output_file_open_options::open_or_create, formats}); testing::internal::CaptureStdout(); @@ -353,19 +353,19 @@ TEST(validator_test, output_file) TEST(validator_test, output_file_ext_from_file) { // Give as a template argument the seqan3 file type to get all valid extensions for this file. - seqan3::output_file_validator validator1{seqan3::output_file_open_mode::exclusive}; + seqan3::output_file_validator validator1{seqan3::output_file_open_options::create_new}; EXPECT_EQ(validator1.get_help_page_message(), "The output file must not exist already and write permissions must " "be granted. Valid file extensions are: [fa, fasta, sam, bam]."); - seqan3::output_file_validator validator2{seqan3::output_file_open_mode::overwritable}; + seqan3::output_file_validator validator2{seqan3::output_file_open_options::open_or_create}; EXPECT_EQ(validator2.get_help_page_message(), "Write permissions must be granted. Valid file extensions are: [fa, " "fasta, sam, bam]."); - seqan3::output_file_validator validator3{seqan3::output_file_open_mode::exclusive}; + seqan3::output_file_validator validator3{seqan3::output_file_open_options::create_new}; EXPECT_EQ(validator3.get_help_page_message(), "The output file must not exist already and write permissions must " "be granted."); - seqan3::output_file_validator validator4{seqan3::output_file_open_mode::overwritable}; + seqan3::output_file_validator validator4{seqan3::output_file_open_options::open_or_create}; EXPECT_EQ(validator4.get_help_page_message(), "Write permissions must be granted."); } @@ -569,7 +569,7 @@ TEST(validator_test, outputfile_not_writable) seqan3::test::tmp_filename tmp_name{"my_file.test"}; std::filesystem::path tmp_file{tmp_name.get_path()}; - EXPECT_NO_THROW(seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive}(tmp_file)); + EXPECT_NO_THROW(seqan3::output_file_validator{seqan3::output_file_open_options::create_new}(tmp_file)); // Parent path is not writable. std::filesystem::permissions(tmp_file.parent_path(), @@ -579,7 +579,7 @@ TEST(validator_test, outputfile_not_writable) if (!write_access(tmp_file)) { - EXPECT_THROW(seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive}(tmp_file), + EXPECT_THROW(seqan3::output_file_validator{seqan3::output_file_open_options::create_new}(tmp_file), seqan3::validation_error); } @@ -596,7 +596,7 @@ TEST(validator_test, outputdir_not_writable) seqan3::test::tmp_filename tmp_name{"dir"}; std::filesystem::path tmp_dir{tmp_name.get_path()}; - EXPECT_NO_THROW(seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive}(tmp_dir)); + EXPECT_NO_THROW(seqan3::output_file_validator{seqan3::output_file_open_options::create_new}(tmp_dir)); EXPECT_FALSE(std::filesystem::exists(tmp_dir)); // Parent path is not writable. std::filesystem::permissions(tmp_dir.parent_path(), @@ -606,7 +606,7 @@ TEST(validator_test, outputdir_not_writable) if (!write_access(tmp_dir)) { - EXPECT_THROW(seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive}(tmp_dir), + EXPECT_THROW(seqan3::output_file_validator{seqan3::output_file_open_options::create_new}(tmp_dir), seqan3::validation_error); } @@ -632,7 +632,7 @@ TEST(validator_test, outputdir_not_writable) if (!write_access(tmp_dir)) { - EXPECT_THROW(seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive}(tmp_dir), + EXPECT_THROW(seqan3::output_file_validator{seqan3::output_file_open_options::create_new}(tmp_dir), seqan3::validation_error); } @@ -1134,7 +1134,7 @@ TEST(validator_test, chaining_validators) std::string option_value{}; std::vector option_vector{}; seqan3::regex_validator absolute_path_validator{"(/[^/]+)+/.*\\.[^/\\.]+$"}; - seqan3::output_file_validator my_file_ext_validator{seqan3::output_file_open_mode::exclusive, {"sa", "so"}}; + seqan3::output_file_validator my_file_ext_validator{seqan3::output_file_open_options::create_new, {"sa", "so"}}; seqan3::test::tmp_filename tmp_name{"file.sa"}; std::filesystem::path invalid_extension{tmp_name.get_path()}; @@ -1186,7 +1186,7 @@ TEST(validator_test, chaining_validators) parser.add_option(option_value, 's', "string-option", "desc", seqan3::option_spec::DEFAULT, seqan3::regex_validator{"(/[^/]+)+/.*\\.[^/\\.]+$"} | - seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive, {"sa", "so"}}); + seqan3::output_file_validator{seqan3::output_file_open_options::create_new, {"sa", "so"}}); testing::internal::CaptureStderr(); EXPECT_NO_THROW(parser.parse()); @@ -1203,7 +1203,7 @@ TEST(validator_test, chaining_validators) parser.add_option(option_value, 's', "string-option", "desc", seqan3::option_spec::DEFAULT, seqan3::regex_validator{"(/[^/]+)+/.*\\.[^/\\.]+$"} | - seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive, {"sa", "so"}} | + seqan3::output_file_validator{seqan3::output_file_open_options::create_new, {"sa", "so"}} | seqan3::regex_validator{".*"}); testing::internal::CaptureStderr(); @@ -1221,7 +1221,7 @@ TEST(validator_test, chaining_validators) parser.add_option(option_value, 's', "string-option", "desc", seqan3::option_spec::DEFAULT, seqan3::regex_validator{"(/[^/]+)+/.*\\.[^/\\.]+$"} | - seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive, {"sa", "so"}} | + seqan3::output_file_validator{seqan3::output_file_open_options::create_new, {"sa", "so"}} | seqan3::regex_validator{".*"}); testing::internal::CaptureStdout(); @@ -1250,7 +1250,7 @@ TEST(validator_test, chaining_validators) parser.add_option(option_value, 's', "string-option", "desc", seqan3::option_spec::DEFAULT, seqan3::regex_validator{"(/[^/]+)+/.*\\.[^/\\.]+$"} | - seqan3::output_file_validator{seqan3::output_file_open_mode::overwritable, {"sa", "so"}} | + seqan3::output_file_validator{seqan3::output_file_open_options::open_or_create, {"sa", "so"}} | seqan3::regex_validator{".*"}); testing::internal::CaptureStdout(); @@ -1279,7 +1279,7 @@ TEST(validator_test, chaining_validators) parser.add_option(option_list_value, 's', "string-option", "desc", seqan3::option_spec::DEFAULT, seqan3::regex_validator{"(/[^/]+)+/.*\\.[^/\\.]+$"} | - seqan3::output_file_validator{seqan3::output_file_open_mode::exclusive, {"sa", "so"}}); + seqan3::output_file_validator{seqan3::output_file_open_options::create_new, {"sa", "so"}}); testing::internal::CaptureStderr(); EXPECT_NO_THROW(parser.parse());