@@ -15,7 +15,7 @@ import (
1515)
1616
1717// Main function is the entrypoint for the 'asdf set' command
18- func Main (_ io.Writer , stderr io.Writer , args []string , home bool , parent bool , homeFunc func () (string , error )) error {
18+ func Main (_ io.Writer , stderr io.Writer , args []string , home bool , parents bool , homeFunc func () (string , error )) error {
1919 if len (args ) < 1 {
2020 return printError (stderr , "tool and version must be provided as arguments" )
2121 }
@@ -24,8 +24,8 @@ func Main(_ io.Writer, stderr io.Writer, args []string, home bool, parent bool,
2424 return printError (stderr , "version must be provided as an argument" )
2525 }
2626
27- if home && parent {
28- return printError (stderr , "home and parent flags cannot both be specified; must be one location or the other" )
27+ if home && parents {
28+ return printError (stderr , "home and parents flags cannot both be specified; must be one location or the other" )
2929 }
3030
3131 conf , err := config .LoadConfig ()
@@ -70,11 +70,11 @@ func Main(_ io.Writer, stderr io.Writer, args []string, home bool, parent bool,
7070 return printError (stderr , fmt .Sprintf ("unable to get current directory: %s" , err ))
7171 }
7272
73- if parent {
74- // locate file in parent dir and update it
75- path , found := findVersionFileInParentDir (conf , currentDir )
73+ if parents {
74+ // locate file in parents dir and update it
75+ path , found := findVersionFileInParentDirs (conf , currentDir )
7676 if ! found {
77- return printError (stderr , fmt .Sprintf ("No %s version file found in parent directory " , conf .DefaultToolVersionsFilename ))
77+ return printError (stderr , fmt .Sprintf ("No %s version file found in parent directories " , conf .DefaultToolVersionsFilename ))
7878 }
7979
8080 err = toolversions .WriteToolVersionsToFile (path , []toolversions.ToolVersions {tv })
@@ -94,7 +94,7 @@ func printError(stderr io.Writer, msg string) error {
9494 return errors .New (msg )
9595}
9696
97- func findVersionFileInParentDir (conf config.Config , directory string ) (string , bool ) {
97+ func findVersionFileInParentDirs (conf config.Config , directory string ) (string , bool ) {
9898 directory = filepath .Dir (directory )
9999
100100 for {
0 commit comments