~welt/murse

f8c17e4d52ac735482a9d3d096f461520ff4e0b4 — welt 2 months ago b83b124
Remove -2, add -1.
4 files changed, 10 insertions(+), 10 deletions(-)

M const.go
M main.go
M upgrade.go
M verify.go
M const.go => const.go +1 -1
@@ 4,7 4,7 @@ const VERSION = "0.1.1"

const (
	DESC_UPGRADE = "Upgrades your game files to the latest version."
	DESC_HTTP2   = "Enables HTTP/2, may cause problems with the servers but is faster."
	DESC_HTTP1   = "Forces the usage of HTTP/1."
	DESC_REPO    = "URL of the TVS repository."
	DESC_FILES   = "Directory of game files."
	DESC_DRY     = "Runs the command, but doesn't write any changes."

M main.go => main.go +5 -5
@@ 11,7 11,7 @@ func main() {
	var threads int = 6
	var dir string
	var dry bool
	var http2 bool
	var http1 bool
	var repair bool
	var owGameInfo bool



@@ 19,7 19,7 @@ func main() {
	upgrade.Description = DESC_UPGRADE
	upgrade.String(&url, "u", "url", DESC_REPO)
	upgrade.Int(&threads, "c", "threads", "Number of threads to use for downloading, minimum two.")
	upgrade.Bool(&http2, "2", "http2", DESC_HTTP2)
	upgrade.Bool(&http1, "1", "http1", DESC_HTTP1)
	upgrade.Bool(&owGameInfo, "G", "overwrite-gameinfo", "When upgrading in a directory named open_fortress, overwrite any existing gameinfo.txt file.")
	upgrade.AddPositionalValue(&dir, "directory", 1, true, DESC_FILES)
	flaggy.AttachSubcommand(upgrade, 1)


@@ 28,7 28,7 @@ func main() {
	verify.Description = "Verifies an installation's files."
	verify.AddPositionalValue(&dir, "directory", 1, true, "Directory of game files.")
	verify.String(&url, "u", "url", DESC_REPO)
	verify.Bool(&http2, "2", "http2", DESC_HTTP2)
	verify.Bool(&http1, "1", "http1", DESC_HTTP1)
	verify.Bool(&repair, "r", "repair", "Repair the files where problems are found automatically.")
	verify.Bool(&owGameInfo, "G", "overwrite-gameinfo", "When repairing in a directory named open_fortress, overwrite any existing gameinfo.txt file.")
	flaggy.AttachSubcommand(verify, 1)


@@ 50,11 50,11 @@ func main() {
			flaggy.ShowHelp("Must have at least two threads.")
			os.Exit(1)
		}
		os.Exit(upgradeMain(dir, url, threads, http2, owGameInfo))
		os.Exit(upgradeMain(dir, url, threads, http1, owGameInfo))
	}

	if verify.Used {
		os.Exit(verifyMain(dir, url, repair, http2, owGameInfo))
		os.Exit(verifyMain(dir, url, repair, http1, owGameInfo))
	}

	if toast.Used {

M upgrade.go => upgrade.go +2 -2
@@ 10,7 10,7 @@ import (
	"strings"
)

func upgradeMain(dir string, url string, threads int, http2 bool, owGameInfo bool) int {
func upgradeMain(dir string, url string, threads int, http1 bool, owGameInfo bool) int {
	if !strings.HasSuffix(url, "/") {
		url = url + "/"
	}


@@ 22,7 22,7 @@ func upgradeMain(dir string, url string, threads int, http2 bool, owGameInfo boo
	}

	client := NewClient(url)
	if !http2 {
	if http1 {
		client.DisableHTTP2()
	}


M verify.go => verify.go +2 -2
@@ 11,7 11,7 @@ import (
	"strings"
)

func verifyMain(dir string, url string, repair bool, http2 bool, owGameInfo bool) int {
func verifyMain(dir string, url string, repair bool, http1 bool, owGameInfo bool) int {
	if !strings.HasSuffix(url, "/") {
		url = url + "/"
	}


@@ 24,7 24,7 @@ func verifyMain(dir string, url string, repair bool, http2 bool, owGameInfo bool

	client := NewClient(url)

	if !http2 {
	if http1 {
		client.DisableHTTP2()
	}