copyright messgae and verbose mode
This commit is contained in:
parent
916f8b8795
commit
a3270f399d
12 changed files with 40 additions and 6 deletions
12
dump.go
12
dump.go
|
|
@ -1,3 +1,5 @@
|
|||
// Copyright (C) 2017 Marius Schellenberger
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
|
@ -17,6 +19,12 @@ type DumpArticle struct {
|
|||
Public bool `json:"public"`
|
||||
}
|
||||
|
||||
func verboseLog(prefix, title string) {
|
||||
if verbose {
|
||||
fmt.Fprintln(os.Stderr, prefix, title)
|
||||
}
|
||||
}
|
||||
|
||||
func dumpWiki() error {
|
||||
index, err := bleve.OpenUsing(bleveStore, map[string]interface{}{"read_only": true})
|
||||
if err != nil {
|
||||
|
|
@ -38,7 +46,7 @@ func dumpWiki() error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Fprintln(os.Stderr, "dump:", art.Title)
|
||||
verboseLog("dump:", art.Title)
|
||||
arts = append(arts, DumpArticle{
|
||||
Title: art.Title,
|
||||
LinkTitle: art.LinkTitle,
|
||||
|
|
@ -68,7 +76,7 @@ func restoreWiki() (err error) {
|
|||
return
|
||||
}
|
||||
for _, art := range arts {
|
||||
fmt.Fprintln(os.Stderr, "restore:", art.Title)
|
||||
verboseLog("restore:", art.Title)
|
||||
err = engine.Restore(art)
|
||||
if err != nil {
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue