Toby Chui vor 5 Jahren
Ursprung
Commit
10a16f34dd
3 geänderte Dateien mit 22 neuen und 3 gelöschten Zeilen
  1. 3 0
      autopush.bat
  2. BIN
      fsconv.exe
  3. 19 3
      main.go

+ 3 - 0
autopush.bat

@@ -0,0 +1,3 @@
+git add *
+git commit -m "auto-push"
+git push origin master

BIN
fsconv.exe


+ 19 - 3
main.go

@@ -26,6 +26,7 @@ import (
 	"strings"
 	"bytes"
 	"encoding/hex"
+	"flag"
 )
 
 //Commonly used functions
@@ -192,8 +193,13 @@ func main() {
 		fmt.Println("ArOZ Online UM File Naming Method Converter")
 		fmt.Println("Usage: \n./fsconv						Convert all files under current directory and its sub-directories into UTF-8 file naming method.")
 		fmt.Println("./fsconv -um 						Convert all files under current directory and its sub-directories into UM File Naming Method representation.")
-		fmt.Println("./fsconv -i {filepath_to_be_conv_to_UTF8}		Convert the given filename to UTF8")
-		fmt.Println("./fsconv -um {filepath_to_be_conv_to_UM-filenames	Convert the given filename to UM-filename")
+		fmt.Println("Flags")
+		fmt.Println("-r		Recirsive directory conversion, accept { true / false }")
+		fmt.Println("-i		Input file / directory path")
+		fmt.Println("-f 	Format, accept { default / umfilename } only")
+		fmt.Println("-m 	Conversion Mode, accept { file / folder / all} only")
+
+
 	}else if (len(os.Args) == 2 && os.Args[1] == "-um"){
 		//Convert all files and folder into um filenaming methods
 		folders, files := scan_recursive(dir, []string{os.Args[0]})
@@ -232,7 +238,17 @@ func main() {
 			
 		}
 	} else {
-		//Given target directory
+		//Given target directory with flags
+		var recursive = flag.Bool("r",false,"Enable recursive filename translation.")
+		var inputFile = flag.String("i","","Input filename.")
+		var format = flag.String("f","default","Conversion target format. Accept {default/umfilename}.")
+		var mode = flag.String("m","all","Conversion mode. Accept {file/folder/all}.")
+		flag.Parse()
+		fmt.Println("r:", *recursive)
+		fmt.Println("i:", *inputFile)
+		fmt.Println("f:", *format)
+		fmt.Println("m:", *mode)
+
 	}
 }