Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
agent
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
simmctic
agent
Commits
e9adcf32
There was a problem fetching the pipeline summary.
Commit
e9adcf32
authored
7 years ago
by
Rafael S Castilho
Browse files
Options
Downloads
Patches
Plain Diff
Issue #37: Finished testing uninstalling agent
parent
2c7c581d
No related branches found
No related tags found
2 merge requests
!51
Merge development to master
,
!43
Issue #37: Finished testing uninstalling agent
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/agent/main.h
+1
-11
1 addition, 11 deletions
include/agent/main.h
src/agent/main.cpp
+8
-2
8 additions, 2 deletions
src/agent/main.cpp
with
9 additions
and
13 deletions
include/agent/main.h
+
1
−
11
View file @
e9adcf32
...
@@ -8,17 +8,7 @@
...
@@ -8,17 +8,7 @@
#include
<boost/date_time/posix_time/posix_time.hpp>
#include
<boost/date_time/posix_time/posix_time.hpp>
#include
<boost/program_options/parsers.hpp>
#include
<boost/program_options/parsers.hpp>
#include
<boost/program_options/variables_map.hpp>
#include
<boost/program_options/variables_map.hpp>
/* in case we need this for future modifications on the parsing from command line (e.g define print from command line)
#include
<boost/filesystem/fstream.hpp>
* #include <boost/program_options/cmdline.hpp>
* #include <boost/program_options/environment_iterator.hpp>
* #include <boost/program_options/eof_iterator.hpp>
* #include <boost/program_options/errors.hpp>
* #include <boost/program_options/option.hpp>
* #include <boost/program_options/options_description.hpp>
* #include <boost/program_options/positional_options.hpp>
* #include <boost/program_options/value_semantic.hpp>
* #include <boost/program_options/version.hpp>
*/
#include
<sys/utsname.h>
#include
<sys/utsname.h>
#include
<cpr/cpr.h>
#include
<cpr/cpr.h>
...
...
This diff is collapsed.
Click to expand it.
src/agent/main.cpp
+
8
−
2
View file @
e9adcf32
...
@@ -28,6 +28,7 @@ namespace po = boost::program_options;
...
@@ -28,6 +28,7 @@ namespace po = boost::program_options;
namespace
asio
=
boost
::
asio
;
namespace
asio
=
boost
::
asio
;
namespace
pholders
=
boost
::
asio
::
placeholders
;
namespace
pholders
=
boost
::
asio
::
placeholders
;
namespace
sys
=
boost
::
system
;
namespace
sys
=
boost
::
system
;
namespace
fs
=
boost
::
filesystem
;
int
run_agent
(
const
sys
::
error_code
&
/*e*/
,
pt
::
ptime
begin
,
bool
print
)
{
int
run_agent
(
const
sys
::
error_code
&
/*e*/
,
pt
::
ptime
begin
,
bool
print
)
{
pt
::
ptime
now
;
pt
::
ptime
now
;
...
@@ -78,7 +79,7 @@ int parse_command_line(int ac, char* av[], int *increment, int *lim,
...
@@ -78,7 +79,7 @@ int parse_command_line(int ac, char* av[], int *increment, int *lim,
(
"help"
,
"produce help message"
)
(
"help"
,
"produce help message"
)
(
"once"
,
"run agent only once"
)
(
"once"
,
"run agent only once"
)
(
"print"
,
"set print JSON to true"
);
(
"print"
,
"set print JSON to true"
);
//
("
dummy", "dummy option for testing purpose
");
(
"
uninstall"
,
"uninstall agent and all associated files
"
);
po
::
variables_map
vm
;
po
::
variables_map
vm
;
po
::
store
(
po
::
parse_command_line
(
ac
,
av
,
desc
),
vm
);
po
::
store
(
po
::
parse_command_line
(
ac
,
av
,
desc
),
vm
);
...
@@ -91,13 +92,18 @@ int parse_command_line(int ac, char* av[], int *increment, int *lim,
...
@@ -91,13 +92,18 @@ int parse_command_line(int ac, char* av[], int *increment, int *lim,
if
(
vm
.
count
(
"once"
))
{
if
(
vm
.
count
(
"once"
))
{
*
lim
=
0
;
*
lim
=
0
;
}
}
if
(
vm
.
count
(
"print"
))
{
if
(
vm
.
count
(
"print"
))
{
*
print
=
true
;
*
print
=
true
;
}
else
{
}
else
{
*
print
=
false
;
*
print
=
false
;
}
}
return
(
0
);
return
(
0
);
if
(
vm
.
count
(
"uninstall"
))
{
fs
::
remove_all
(
"../../agent"
);
return
(
1
);
}
return
(
0
);
}
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
...
...
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