Exemple #1
0
func NewFlagsWithPrefix(prefix string) ClientFlags {
	return ClientFlags{
		dataset.NewFlagsWithPrefix(prefix),
		flag.Int(prefix+"concurrency", 100, "degree of concurrency"),
		flag.String(prefix+"progress-file", "", "file for logging progress"),
		nil,
	}
}
Exemple #2
0
import (
	"flag"
	"log"
	"runtime"

	"github.com/attic-labs/noms/clients/util"
	"github.com/attic-labs/noms/d"
	"github.com/attic-labs/noms/datas"
	"github.com/attic-labs/noms/dataset"
	"github.com/attic-labs/noms/ref"
)

var (
	p                = flag.Uint("p", 512, "parallelism")
	sinkDsFlags      = dataset.NewFlagsWithPrefix("sink-")
	sourceStoreFlags = datas.NewFlagsWithPrefix("source-")
	sourceObject     = flag.String("source", "", "source object to sync - either a dataset name or a ref")
)

func main() {
	cpuCount := runtime.NumCPU()
	runtime.GOMAXPROCS(cpuCount)

	flag.Parse()

	sourceStore, ok := sourceStoreFlags.CreateDataStore()
	sink := sinkDsFlags.CreateDataset()
	if !ok || sink == nil || *p == 0 || *sourceObject == "" {
		flag.Usage()
		return