@@ -9,8 +9,24 @@ import (
99 translator "go-googletrans"
1010)
1111
12+ const APP_VERSION string = "1.0"
13+
1214func Help (exitCode int ) {
13- fmt .Println ("Help menu" )
15+ fmt .Printf ("SubtitleTranslator v%s.\n " , APP_VERSION )
16+ fmt .Print ("\n " )
17+ fmt .Println ("Valid switches:" )
18+ fmt .Println ("-i, --in, --input\t \t Specify the input file path." )
19+ fmt .Println ("-o, --out, --output\t \t Specify the file path to ouput translated file." )
20+ fmt .Println ("-s, --src, --source\t \t Specify the source file's language. (Set to 'auto' by default)." )
21+ fmt .Println ("-d, --dst, --destination\t Specify the language to translate to. (Set to 'English (en)' by default)." )
22+ fmt .Println ("-q, --quiet\t \t \t Don't output translation results in terminal." )
23+ fmt .Print ("\n " )
24+ fmt .Println ("Valid usages:" )
25+ fmt .Println ("Convert from any language implicitly to English: 'SubtitleTranslator -i InputFile.srt -o OutputFile.srt'" )
26+ fmt .Println ("Convert explicitly from Turkish implicitly to English: 'SubtitleTranslator -i InputFile.srt -o OutputFile.srt -s tr" )
27+ fmt .Println ("Convert explicitly from Turkish implicitly to English: 'SubtitleTranslator -i InputFile.srt -o OutputFile.srt -s tr" )
28+ fmt .Println ("Convert explicitly from English explicitly to Urdu: 'SubtitleTranslator -i InputFile.srt -o OutputFile.srt -s en -d ur" )
29+
1430 os .Exit (exitCode )
1531}
1632
@@ -79,7 +95,7 @@ func main() {
7995 i ++
8096 SrcLanguage = os .Args [i ]
8197 validArgFound = true
82- case "-d" , "--dest " , "--destination" :
98+ case "-d" , "--dst " , "--destination" :
8399 Assert (i + 1 < len (os .Args ), "Switch " + "\" " + currentArg + "\" " + " is missing an argument!" )
84100 i ++
85101 DstLanguage = os .Args [i ]
0 commit comments