Ejemplo n.º 1
0
func main() {
	ct := build.Default
	var err error

	const pref = "github.com/pbberlin/tools/"

	tasks := [][]string{
		[]string{"htmlpb/", "pbhtml/"},
		[]string{"stringspb/", "stringspb/"},
		[]string{"ancestored_.../", "dsu/ancestored_.../"},
	}

	for idx, task := range tasks {
		fmt.Printf("%v: %v\n", idx, task)
		if len(task) != 2 {
			panic("need src and dst entry")
		}
		err = rename.Move(&ct, pref+task[0], pref+task[1], "git mv {{.Src}} {{.Dst}}")
		if err != nil {
			fmt.Printf("\t%v\n", err)
		}

	}

}
Ejemplo n.º 2
0
func main() {
	flag.Parse()

	if len(flag.Args()) > 0 {
		fmt.Fprintln(os.Stderr, "gomvpkg: surplus arguments.")
		os.Exit(1)
	}

	if *helpFlag || *fromFlag == "" || *toFlag == "" {
		fmt.Println(Usage)
		return
	}

	if err := rename.Move(&build.Default, *fromFlag, *toFlag, *vcsMvCmdFlag); err != nil {
		fmt.Fprintf(os.Stderr, "gomvpkg: %s.\n", err)
		os.Exit(1)
	}
}