|
@@ -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)
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|