Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aevol-eukaryotes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LUISELLI Juliette
aevol-eukaryotes
Commits
531dc99b
Commit
531dc99b
authored
1 year ago
by
David Parsons
Browse files
Options
Downloads
Patches
Plain Diff
get rid of global cmd-line option variables
# Conflicts: # src/aevol_create.cpp
parent
470640be
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/aevol_create.cpp
+10
-7
10 additions, 7 deletions
src/aevol_create.cpp
with
10 additions
and
7 deletions
src/aevol_create.cpp
+
10
−
7
View file @
531dc99b
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#include
<list>
#include
<list>
#include
<sstream>
#include
<sstream>
#include
<string>
#include
<string>
#include
<tuple>
#include
"legacy/ExpManager.h"
#include
"legacy/ExpManager.h"
#include
"aevol_version.h"
#include
"aevol_version.h"
...
@@ -47,15 +48,11 @@ using namespace aevol;
...
@@ -47,15 +48,11 @@ using namespace aevol;
// Helper functions
// Helper functions
void
print_help
(
char
*
prog_path
);
void
print_help
(
char
*
prog_path
);
void
interpret_cmd_line_options
(
int
argc
,
char
*
argv
[]);
std
::
tuple
<
std
::
string
,
std
::
string
>
interpret_cmd_line_options
(
int
argc
,
char
*
argv
[]);
std
::
list
<
std
::
string
>
read_sequence_file
(
const
std
::
string
&
chromosome_file_name
);
std
::
list
<
std
::
string
>
read_sequence_file
(
const
std
::
string
&
chromosome_file_name
);
// Command-line option variables
static
std
::
string
param_file_name
;
static
std
::
string
chromosome_file_name
;
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
interpret_cmd_line_options
(
argc
,
argv
);
const
auto
[
param_file_name
,
chromosome_file_name
]
=
interpret_cmd_line_options
(
argc
,
argv
);
// Print the hash and date of the commit used to compile this executable
// Print the hash and date of the commit used to compile this executable
printf
(
"Running aevol version %s
\n
"
,
version_string
);
printf
(
"Running aevol version %s
\n
"
,
version_string
);
...
@@ -124,7 +121,11 @@ void print_help(char* prog_path) {
...
@@ -124,7 +121,11 @@ void print_help(char* prog_path) {
printf
(
"
\t
load chromosome from given text file instead of generating it
\n
"
);
printf
(
"
\t
load chromosome from given text file instead of generating it
\n
"
);
}
}
void
interpret_cmd_line_options
(
int
argc
,
char
*
argv
[])
{
std
::
tuple
<
std
::
string
,
std
::
string
>
interpret_cmd_line_options
(
int
argc
,
char
*
argv
[])
{
// Command-line option variables
std
::
string
param_file_name
;
std
::
string
chromosome_file_name
;
// Define allowed options
// Define allowed options
const
char
*
options_list
=
"hVf:C:r:"
;
const
char
*
options_list
=
"hVf:C:r:"
;
static
struct
option
long_options_list
[]
=
{
static
struct
option
long_options_list
[]
=
{
...
@@ -168,6 +169,8 @@ void interpret_cmd_line_options(int argc, char* argv[]) {
...
@@ -168,6 +169,8 @@ void interpret_cmd_line_options(int argc, char* argv[]) {
if
(
param_file_name
.
length
()
==
0
)
{
if
(
param_file_name
.
length
()
==
0
)
{
param_file_name
=
DEFAULT_PARAM_FILE_NAME
;
param_file_name
=
DEFAULT_PARAM_FILE_NAME
;
}
}
return
std
::
make_tuple
(
param_file_name
,
chromosome_file_name
);
}
}
auto
read_sequence
(
std
::
ifstream
&
chromosome_file
,
const
std
::
string
&
chromosome_file_name
)
{
auto
read_sequence
(
std
::
ifstream
&
chromosome_file
,
const
std
::
string
&
chromosome_file_name
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment