Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
65f00656
Commit
65f00656
authored
Jan 01, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Help text
parent
30f3b4d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
db_query_interface.go
db_query_interface.go
+6
-3
No files found.
db_query_interface.go
View file @
65f00656
...
@@ -32,9 +32,6 @@ func (i *DbInterface) ValidateInput(action string, argumentLength int) error {
...
@@ -32,9 +32,6 @@ func (i *DbInterface) ValidateInput(action string, argumentLength int) error {
case
action
==
"get"
&&
argumentLength
!=
1
:
case
action
==
"get"
&&
argumentLength
!=
1
:
err
=
true
err
=
true
expArgCount
=
1
expArgCount
=
1
case
(
action
==
"quit"
||
action
==
"exit"
)
&&
argumentLength
!=
0
:
err
=
true
expArgCount
=
0
}
}
if
err
{
if
err
{
...
@@ -73,6 +70,11 @@ func (i *DbInterface) ParseInput(input string) bool {
...
@@ -73,6 +70,11 @@ func (i *DbInterface) ParseInput(input string) bool {
fmt
.
Println
(
i
.
trie
.
Get
(
tokens
[
1
]))
fmt
.
Println
(
i
.
trie
.
Get
(
tokens
[
1
]))
case
"exit"
,
"quit"
,
"q"
:
case
"exit"
,
"quit"
,
"q"
:
return
false
return
false
case
"help"
:
fmt
.
Println
(
`query commands:
update KEY VALUE
get KEY
`
)
default
:
default
:
fmt
.
Println
(
"Unknown command:"
,
tokens
[
0
])
fmt
.
Println
(
"Unknown command:"
,
tokens
[
0
])
}
}
...
@@ -82,6 +84,7 @@ func (i *DbInterface) ParseInput(input string) bool {
...
@@ -82,6 +84,7 @@ func (i *DbInterface) ParseInput(input string) bool {
}
}
func
(
i
*
DbInterface
)
Start
()
{
func
(
i
*
DbInterface
)
Start
()
{
fmt
.
Printf
(
"DB Query tool. Type (help) for help
\n
"
)
reader
:=
bufio
.
NewReader
(
os
.
Stdin
)
reader
:=
bufio
.
NewReader
(
os
.
Stdin
)
for
{
for
{
fmt
.
Printf
(
"db >>> "
)
fmt
.
Printf
(
"db >>> "
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment