File tree 4 files changed +16
-5
lines changed
4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -143,8 +143,8 @@ jobs:
143
143
- name : Get number of CPU cores
144
144
uses : SimenB/github-actions-cpu-cores@v2
145
145
146
- - name : Install mamba
147
- uses : mamba-org/setup-micromamba@v1
146
+ - name : Install micromamba
147
+ uses : mamba-org/setup-micromamba@v2
148
148
with :
149
149
environment-file : environment-wasm-build.yml
150
150
environment-name : xeus-wasm-build
Original file line number Diff line number Diff line change @@ -24,7 +24,16 @@ namespace xeus
24
24
{
25
25
XEUS_API std::string get_start_message (const xconfiguration& config);
26
26
27
- XEUS_API std::string extract_filename (int argc, char * argv[]);
27
+ /* *
28
+ * @brief Extracts the filename from the command-line arguments and adjusts argc/argv.
29
+ *
30
+ * Searches for the "-f" flag in the arguments, extracts the following filename, and
31
+ * removes both from the argument list. `argc` is updated to reflect the changes.
32
+ * @param argc Reference to the argument count, modified if "-f" is found.
33
+ * @param argv Argument list, potentially modified.
34
+ * @return The extracted filename, or an empty string if not found.
35
+ */
36
+ XEUS_API std::string extract_filename (int &argc, char * argv[]);
28
37
29
38
XEUS_API bool should_print_version (int argc, char * argv[]);
30
39
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ namespace xeus
30
30
return kernel_info;
31
31
}
32
32
33
- std::string extract_filename (int argc, char * argv[])
33
+ std::string extract_filename (int & argc, char * argv[])
34
34
{
35
35
std::string res = " " ;
36
36
for (int i = 0 ; i < argc; ++i)
Original file line number Diff line number Diff line change @@ -55,11 +55,13 @@ namespace xeus
55
55
56
56
TEST_CASE (" extract_filename" )
57
57
{
58
+ int argc = 3 ;
58
59
char * argv[2 ];
59
60
argv[0 ] = (char *)" -f" ;
60
61
argv[1 ] = (char *)" connection.json" ;
61
- std::string file_name = extract_filename (3 , argv);
62
+ std::string file_name = extract_filename (argc , argv);
62
63
REQUIRE_EQ (file_name, " connection.json" );
64
+ REQUIRE_EQ (argc, 1 );
63
65
}
64
66
65
67
TEST_CASE (" should_print_version" )
You can’t perform that action at this time.
0 commit comments