Rename -fix to -f

This commit is contained in:
Evan Su 2024-04-25 23:25:53 -04:00 committed by GitHub
parent c73fba2250
commit 613ab8232d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -84,7 +84,7 @@ func work() int {
} }
paranoid := flag.Bool("p", false, "") paranoid := flag.Bool("p", false, "")
reedsolo := flag.Bool("r", false, "") reedsolo := flag.Bool("r", false, "")
fix := flag.Bool("fix", false, "") fix := flag.Bool("f", false, "")
flag.Parse() flag.Parse()
mode := "" mode := ""
@ -108,7 +108,7 @@ func work() int {
} }
} }
for _, v := range flag.Args() { for _, v := range flag.Args() {
if v == "-p" || v == "-r" || v == "-fix" { if v == "-p" || v == "-r" || v == "-f" {
fmt.Println("Flags are only accepted before arguments!") fmt.Println("Flags are only accepted before arguments!")
return 1 return 1
} }
@ -580,11 +580,11 @@ func work() int {
fin.Close() fin.Close()
fout.Close() fout.Close()
os.Remove(fout_) os.Remove(fout_)
fmt.Println("The input volume is damaged or modified.") fmt.Println("\nThe input volume is damaged or modified.")
if *reedsolo { if *reedsolo {
if !(*fix) { if !(*fix) {
fmt.Println("Fortunately, this volume is encoded with Reed-Solomon.") fmt.Println("Fortunately, this volume is encoded with Reed-Solomon.")
fmt.Println("Try again using the -fix flag to repair the corruption.") fmt.Println("Try again using the '-f' flag to repair the corruption.")
} else { } else {
fmt.Println("The corruption could not be fixed with Reed-Solomon.") fmt.Println("The corruption could not be fixed with Reed-Solomon.")
} }