mirror of
https://github.com/itchyny/mmv.git
synced 2026-01-08 07:07:29 +08:00
check source duplication
This commit is contained in:
parent
1bb8c86761
commit
33a796548f
1 changed files with 7 additions and 0 deletions
|
|
@ -71,6 +71,13 @@ Options:
|
|||
}
|
||||
|
||||
func rename(args []string) error {
|
||||
xs := make(map[string]bool, len(args))
|
||||
for _, src := range args {
|
||||
if xs[src] {
|
||||
return fmt.Errorf("duplicate source: %s", src)
|
||||
}
|
||||
xs[src] = true
|
||||
}
|
||||
f, err := ioutil.TempFile("", name+"-")
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue