Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
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
savoirfairelinux
opendht
Commits
30a484cb
Commit
30a484cb
authored
9 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
dhtnode: move help to it's own function
parent
20378ef3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/dhtnode.cpp
+23
-19
23 additions, 19 deletions
tools/dhtnode.cpp
with
23 additions
and
19 deletions
tools/dhtnode.cpp
+
23
−
19
View file @
30a484cb
...
...
@@ -56,6 +56,28 @@ void print_node_info(const DhtRunner& dht, const dht_params& params) {
std
::
cout
<<
"Public key ID "
<<
dht
.
getId
()
<<
std
::
endl
;
}
void
print_help
()
{
std
::
cout
<<
"OpenDht command line interface (CLI)"
<<
std
::
endl
;
std
::
cout
<<
"Possible commands:"
<<
std
::
endl
<<
" h, help Print this help message."
<<
std
::
endl
<<
" q, quit Quit the program."
<<
std
::
endl
<<
" log Print the full DHT log."
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
<<
"Node information:"
<<
std
::
endl
<<
" ll Print basic information and stats about the current node."
<<
std
::
endl
<<
" ls Print basic information about current searches."
<<
std
::
endl
<<
" ld Print basic information about currenty stored values on this node."
<<
std
::
endl
<<
" lr Print the full current routing table of this node"
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
<<
"Operations on the DHT:"
<<
std
::
endl
<<
" g [key] Get values at [key]."
<<
std
::
endl
<<
" l [key] Listen for value changes at [key]."
<<
std
::
endl
<<
" p [key] [str] Put string value at [key]."
<<
std
::
endl
<<
" s [key] [str] Put string value at [key], signed with our generated private key."
<<
std
::
endl
<<
" e [key] [dest] [str] Put string value at [key], encrypted for [dest] with its public key (if found)."
<<
std
::
endl
<<
std
::
endl
;
}
int
main
(
int
argc
,
char
**
argv
)
{
...
...
@@ -103,25 +125,7 @@ main(int argc, char **argv)
if
(
std
::
cin
.
eof
()
||
op
==
"x"
||
op
==
"q"
||
op
==
"exit"
||
op
==
"quit"
)
{
break
;
}
else
if
(
op
==
"h"
||
op
==
"help"
)
{
std
::
cout
<<
"OpenDht command line interface (CLI)"
<<
std
::
endl
;
std
::
cout
<<
"Possible commands:"
<<
std
::
endl
;
std
::
cout
<<
" h, help Print this help message."
<<
std
::
endl
;
std
::
cout
<<
" q, quit Quit the program."
<<
std
::
endl
;
std
::
cout
<<
" log Print the full DHT log."
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
<<
"Node information:"
<<
std
::
endl
;
std
::
cout
<<
" ll Print basic information and stats about the current node."
<<
std
::
endl
;
std
::
cout
<<
" ls Print basic information about current searches."
<<
std
::
endl
;
std
::
cout
<<
" ld Print basic information about currenty stored values on this node."
<<
std
::
endl
;
std
::
cout
<<
" lr Print the full current routing table of this node"
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
<<
"Operations on the DHT:"
<<
std
::
endl
;
std
::
cout
<<
" g [key] Get values at [key]."
<<
std
::
endl
;
std
::
cout
<<
" l [key] Listen for value changes at [key]."
<<
std
::
endl
;
std
::
cout
<<
" p [key] [str] Put string value at [key]."
<<
std
::
endl
;
std
::
cout
<<
" s [key] [str] Put string value at [key], signed with our generated private key."
<<
std
::
endl
;
std
::
cout
<<
" e [key] [dest] [str] Put string value at [key], encrypted for [dest] with its public key (if found)."
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
;
print_help
();
continue
;
}
else
if
(
op
==
"ll"
)
{
print_node_info
(
dht
,
params
);
...
...
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