diff --git a/README.md b/README.md index 34573f7..bd716f7 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ go install -tags static,allegro -ldflags "-s -w" opslag.de/schobers/tins2021/cmd In this case the SDL 2.0 prerequisite is replaced by the Allegro 5.2 (development libraries must be available for your C compiler). ## Command line interface -You can extract all resources embedded in the executable by running it from the command line with the `--extract-resources` flag. The resources will be extract in the current working directory. Note that the game will use the resources on disk first if they are available. +You can extract all resources embedded in the executable by running it from the command line with the `--extract` flag. The resources will be extract in the current working directory. Note that the game will use the resources on disk first if they are available. ## Sources Can be found at https://opslag.de/schobers/tins2021 (Git repository). diff --git a/cmd/tins2021/extract.go b/cmd/tins2021/extract.go index 66dc907..5bdcc94 100644 --- a/cmd/tins2021/extract.go +++ b/cmd/tins2021/extract.go @@ -21,7 +21,7 @@ func copyFile(path string, file fs.File) error { } func copyBoxToDisk(resources embed.FS) error { - return fs.WalkDir(resources, "", func(path string, entry fs.DirEntry, err error) error { + return fs.WalkDir(resources, ".", func(path string, entry fs.DirEntry, err error) error { if err != nil { return err } @@ -33,6 +33,6 @@ func copyBoxToDisk(resources embed.FS) error { return err } defer src.Close() - return copyFile(filepath.Join(`resources`, path), src) + return copyFile(path, src) }) } diff --git a/cmd/tins2021/tins2021.go b/cmd/tins2021/tins2021.go index 7ef22f8..1f0814a 100644 --- a/cmd/tins2021/tins2021.go +++ b/cmd/tins2021/tins2021.go @@ -30,7 +30,7 @@ func openResources() ui.Resources { func run() error { var extract bool - flag.BoolVar(&extract, "extract-resources", false, "extracts all resources to the current working directory") + flag.BoolVar(&extract, "extract", false, "extracts all resources to the current working directory") flag.Parse() if extract {