예제 #1
0
파일: dataset.go 프로젝트: arv/noms-old
func NewFlagsWithPrefix(prefix string) DatasetFlags {
	return DatasetFlags{
		datas.NewFlagsWithPrefix(prefix),
		flag.String(prefix+"ds", "", "dataset id to store data for"),
	}
}
예제 #2
0
파일: shove.go 프로젝트: arv/noms-old
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
	}