diff --git a/OBM.go b/OBM.go index 9a83838..ba70ed0 100644 --- a/OBM.go +++ b/OBM.go @@ -43,7 +43,7 @@ func init() { // parse for `-beatmap` argument flag.Parse() - // if `-showOrder` is checked - show the message + // if `-showOrder` is checked - show the message and exit if *showOrder == true { fmt.Print(orderMessage) os.Exit(0) diff --git a/README.md b/README.md index 099443c..08b2214 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ To run - `./OBM` in terminal (on Unix) || `OBM` in command line (on Windows) (a 1. Start the utility again. If it has found the settings file - it will perform the magic according to provided rules -### Flags (starting from version 1.3.4) +### Flags Right now there are 2 arguments that you can specify before running the program - "beatmap" and "showOrder". "-beatmap" flag takes a string; it will tell the program to do its work **ONLY** on beatmaps with specified name; others will be ignored. The names of beatmaps in Osu! consist an id, artist and the name of the soundtrack, so you can diff --git a/manager/parse.go b/manager/parse.go index cf95453..9588781 100644 --- a/manager/parse.go +++ b/manager/parse.go @@ -12,7 +12,7 @@ import ( // parses given .osu file and returns the filename of its background // NOTE: Osu! beatmap (as whole) can have multiple backgrounds for each .osu file // the perfect example : https://osu.ppy.sh/beatmapsets/43701#osu/137122 -// this is why this functions asks for a certain difficulty (.osu filename) to be sure +// this is why this function asks for a certain difficulty (.osu filename) to be sure // to return the correct background name func (BEATMAP *Beatmap) GetBackgroundName(diff string) (string, error) { beatmapBytes, err := os.ReadFile(filepath.Join(BEATMAP.Path, diff)) diff --git a/util/checks.go b/util/checks.go index 70a6313..a9f4668 100644 --- a/util/checks.go +++ b/util/checks.go @@ -5,6 +5,7 @@ import ( "strings" ) +// checks if given path is a directory func IsDir(path string) bool { info, err := os.Stat(path) if err != nil { @@ -45,6 +46,7 @@ func IsImage(filename string) bool { return false } +// checks if given directory/file does exist func DoesExist(path string) bool { _, err := os.Stat(path) if err != nil { diff --git a/worker.go b/worker.go index 50d70d4..e35b26c 100644 --- a/worker.go +++ b/worker.go @@ -37,6 +37,7 @@ func worker(jobs <-chan job, results chan result, WG *sync.WaitGroup) { } +// the `starter` that `glues` workers and jobs together func workerPool(jobs chan job, results chan result, numOfWorkers int, WG *sync.WaitGroup) { // check if there are less jobs than workers if numOfWorkers > len(jobs) {