Commit deb3bdd2 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 8b52bfbd
......@@ -22,12 +22,12 @@ package neotools
import "lab.nexedi.com/kirr/neo/go/zodb/zodbtools"
var Commands = zodbtools.CommandRegistry{
var commands = zodbtools.CommandRegistry{
{"master", masterSummary, masterUsage, masterMain},
{"storage", storageSummary, storageUsage, storageMain},
}
var HelpTopics = zodbtools.HelpRegistry{
var helpTopics = zodbtools.HelpRegistry{
// XXX for now empty
}
......@@ -35,6 +35,6 @@ var HelpTopics = zodbtools.HelpRegistry{
var Prog = zodbtools.MainProg{
Name: "neo",
Summary: "Neo is a tool for running NEO services and commands",
Commands: Commands,
HelpTopics: HelpTopics,
Commands: commands,
HelpTopics: helpTopics,
}
......@@ -22,12 +22,12 @@ package fs1tools
import "lab.nexedi.com/kirr/neo/go/zodb/zodbtools"
var Commands = zodbtools.CommandRegistry{
var commands = zodbtools.CommandRegistry{
{"tail", tailSummary, tailUsage, tailMain},
// {"reindex", reindexSummary, reindexUsage, reindexMain},
{"reindex", reindexSummary, reindexUsage, reindexMain},
}
var HelpTopics = zodbtools.HelpRegistry{
var helpTopics = zodbtools.HelpRegistry{
// XXX for now empty
}
......@@ -35,6 +35,6 @@ var HelpTopics = zodbtools.HelpRegistry{
var Prog = zodbtools.MainProg{
Name: "fs1",
Summary: "Fs1 is a tool for managing and maintaining ZODB FileStorage v1 databases",
Commands: Commands,
HelpTopics: HelpTopics,
Commands: commands,
HelpTopics: helpTopics,
}
// 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 Free Software licenses or 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.
// See https://www.nexedi.com/licensing for rationale and options.
package fs1tools
import (
"flag"
"fmt"
"io"
"os"
"log"
)
// XXX text
func Reindex(path string) error {
// TODO
return nil
}
// ----------------------------------------
const reindexSummary = "dump last few transactions of a database"
func reindexUsage(w io.Writer) {
fmt.Fprintf(w,
`Usage: fs1 reindex [options] <storage>
Dump transactions from a FileStorage in reverse order XXX
<storage> is a path to FileStorage
options:
-h --help this help text.
-verify verify that existing index is correct; don't overwrite it
`, ntxnDefault)
}
func reindexMain(argv []string) {
flags := flag.FlagSet{Usage: func() { reindexUsage(os.Stderr) }}
flags.Init("", flag.ExitOnError)
// XXX -verify
flags.Parse(argv[1:])
argv = flags.Args()
if len(argv) < 1 {
flags.Usage()
os.Exit(2)
}
storPath := argv[0]
err := Reindex(storPath)
if err != nil {
log.Fatal(err)
}
}
......@@ -57,7 +57,7 @@ const helpXid =
// TODO dump format
var HelpTopics = HelpRegistry{
var helpTopics = HelpRegistry{
{"zurl", "specifying database URL", helpZURL},
{"xid", "specifying object address", helpXid},
}
......@@ -21,7 +21,7 @@
package zodbtools
// registry of all zodbtools commands
var Commands = CommandRegistry{
var commands = CommandRegistry{
// NOTE the order commands are listed here is the order how they will appear in help
// TODO analyze ?
// TODO cmp
......@@ -34,6 +34,6 @@ var Commands = CommandRegistry{
var Prog = MainProg{
Name: "zodb",
Summary: "Zodb is a tool for managing ZODB databases",
Commands: Commands,
HelpTopics: HelpTopics,
Commands: commands,
HelpTopics: helpTopics,
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment