Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
0e825b2f
Commit
0e825b2f
authored
Apr 21, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
098dbccd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
5 deletions
+83
-5
t/neo/zodb/cmd/zodb/zodb.go
t/neo/zodb/cmd/zodb/zodb.go
+10
-5
t/neo/zodb/zodbtools/command.go
t/neo/zodb/zodbtools/command.go
+1
-0
t/neo/zodb/zodbtools/help.go
t/neo/zodb/zodbtools/help.go
+72
-0
No files found.
t/neo/zodb/cmd/zodb/zodb.go
View file @
0e825b2f
...
...
@@ -39,7 +39,6 @@ Usage:
The commands are:
`
)
// TODO print commands
for
_
,
cmd
:=
range
zodbtools
.
AllCommands
()
{
fmt
.
Fprintf
(
w
,
"
\t
%-11s %s
\n
"
,
cmd
.
Name
,
cmd
.
Summary
)
}
...
...
@@ -50,14 +49,17 @@ The commands are:
Use "zodb help [command]" for more information about a command.
Additional help topics:
`
)
// TODO print help topics
for
_
,
topic
:=
range
zodbtools
.
AllHelpTopics
()
{
fmt
.
Fprintf
(
w
,
"
\t
%-11s %s
\n
"
,
topic
.
Name
,
topic
.
Summary
)
}
fmt
.
Fprintf
(
w
,
`
Use "zodb help [topic]" for more information about that topic.
`
)
}
...
...
@@ -78,8 +80,11 @@ func help(argv []string) {
os
.
Exit
(
0
)
}
// TODO topic
helpTopic
:=
zodbtools
.
LookupHelpTopic
(
topic
)
if
helpTopic
!=
nil
{
fmt
.
Println
(
helpTopic
.
Text
)
os
.
Exit
(
0
)
}
fmt
.
Fprintf
(
os
.
Stderr
,
"Unknown help topic `%s`. Run 'zodb help'.
\n
"
,
topic
)
os
.
Exit
(
2
)
...
...
t/neo/zodb/zodbtools/command.go
View file @
0e825b2f
...
...
@@ -16,6 +16,7 @@
// See COPYING file for full licensing terms.
package
zodbtools
// registry for all commands
import
(
"io"
...
...
t/neo/zodb/zodbtools/help.go
0 → 100644
View file @
0e825b2f
// Copyright (C) 2017 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
// This program is free software: you can Use, Study, Modify and Redistribute
// it under the terms of the GNU General Public License version 3, or (at your
// option) any later version, as published by the Free Software Foundation.
//
// You can also Link and Combine this program with other software covered by
// the terms of any of the Open Source Initiative approved licenses and Convey
// the resulting work. Corresponding source of such a combination shall include
// the source code for all other software used.
//
// This program is distributed WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// See COPYING file for full licensing terms.
package
zodbtools
// registry for all help topics
type
HelpTopic
struct
{
Name
string
Summary
string
Text
string
}
const
helpZURL
=
`Almost every zodb command works with a database.
A database can be specified by way of providing URL for its storage.
The most general way to specify a storage is via preparing file with
ZConfig-based storage definition, e.g.
%import neo.client
<NEOStorage>
master_nodes ...
name ...
</NEOStorage>
and using path to that file with zconfig:// schema:
zconfig://<path-to-zconfig-storage-definition>
There are also following simpler ways:
- neo://<db>@<master> for a NEO database
- zeo://<host>:<port> for a ZEO database
- /path/to/file for a FileStorage database
Please see zodburi documentation for full details:
http://docs.pylonsproject.org/projects/zodburi/
`
var
helpv
=
[]
HelpTopic
{
{
"zurl"
,
"specifying database URL"
,
helpZURL
},
}
// LookupHelpTopic returns HelpTopic with corresponding name or nil
func
LookupHelpTopic
(
topic
string
)
*
HelpTopic
{
for
i
:=
range
helpv
{
if
helpv
[
i
]
.
Name
==
topic
{
return
&
helpv
[
i
]
}
}
return
nil
}
// AllHelpTopics returns list of all zodbtools help topics
func
AllHelpTopics
()
[]
HelpTopic
{
return
helpv
}
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