Skip to content

Commit b37a03a

Browse files
committed
[FIX] warnings
1 parent eb0d19f commit b37a03a

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ If you are working in the field of sequence analysis, we recommend using the
9595

9696
An application with one option parsing an integer from the command line can be written in only 5 lines of code:
9797

98-
<!-- MARKDOWN-AUTO-DOCS:START (CODE:src=./test/snippet/readme_sneak_peek.cpp&lines=3-13) -->
98+
<!-- MARKDOWN-AUTO-DOCS:START (CODE:src=./test/snippet/readme_sneak_peek.cpp&lines=3-15) -->
9999
<!-- The below code snippet is automatically added from ./test/snippet/readme_sneak_peek.cpp -->
100100
```cpp
101101
#include <sharg/all.hpp>

include/sharg/detail/format_base.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ class format_help_base : public format_base
212212
format_help_base(std::vector<std::string> const & names,
213213
update_notifications const version_updates,
214214
bool const advanced) :
215+
version_check_dev_decision{version_updates},
215216
command_names{names},
216-
show_advanced_options{advanced},
217-
version_check_dev_decision{version_updates}
217+
show_advanced_options{advanced}
218218
{}
219219
//!\}
220220

test/snippet/readme_sneak_peek.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ int main(int argc, char ** argv)
1010
parser.add_subsection("Eating Numbers");
1111
parser.add_option(val, sharg::config{.short_id = 'i', .long_id = "int", .description = "Desc."});
1212
parser.parse();
13+
14+
return 0;
1315
}
1416

1517
#undef main
1618

17-
int main(int argc, char ** argv)
19+
int main()
1820
{
19-
char * test_argv[] = {"./Eat-Me-App", "-h"};
20-
int const test_argc = sizeof(test_argv) / sizeof(*test_argv);
21-
return test(test_argc, test_argv);
21+
std::string argv1{"./Eat-Me-App"}, argv2{"-h"};
22+
std::array argv{argv1.data(), argv2.data()};
23+
24+
return test(argv.size(), argv.data());
2225
}

0 commit comments

Comments
 (0)