From 8662153706e158bb6113f92a3abe108039255896 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Tue, 17 Dec 2024 19:30:06 +0400 Subject: [PATCH] Always use a profile file. --- cmd/mccl/commands/run_command.go | 32 +++++++++++++++----------------- cmd/mccl/main.go | 9 +-------- 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/cmd/mccl/commands/run_command.go b/cmd/mccl/commands/run_command.go index 150fbbd..4884851 100755 --- a/cmd/mccl/commands/run_command.go +++ b/cmd/mccl/commands/run_command.go @@ -36,23 +36,21 @@ func (rc *RunCommand) Run() error { return err } - if rc.UseProfile { - if util.IsFileExist(path.Join(rc.GameDir, mcclprofile.ProfileFileName)) { - p, err := mcclprofile.Load(rc.GameDir) - if err != nil { - return err - } - rc.Username = p.Username - rc.AuthUuid = p.Uuid - rc.JavaXmx = p.JavaXmx - } else { - p := mcclprofile.Profile{ - Username: rc.Username, - Uuid: rc.AuthUuid, - JavaXmx: rc.JavaXmx} - if err := p.Store(rc.GameDir); err != nil { - return err - } + if util.IsFileExist(path.Join(rc.GameDir, mcclprofile.ProfileFileName)) { + p, err := mcclprofile.Load(rc.GameDir) + if err != nil { + return err + } + rc.Username = p.Username + rc.AuthUuid = p.Uuid + rc.JavaXmx = p.JavaXmx + } else { + p := mcclprofile.Profile{ + Username: rc.Username, + Uuid: rc.AuthUuid, + JavaXmx: rc.JavaXmx} + if err := p.Store(rc.GameDir); err != nil { + return err } } diff --git a/cmd/mccl/main.go b/cmd/mccl/main.go index bd40421..4b0401b 100755 --- a/cmd/mccl/main.go +++ b/cmd/mccl/main.go @@ -3,7 +3,6 @@ package main import ( "fmt" "mccl/cmd/mccl/commands" - mcclprofile "mccl/internal/mccl_profile" "os" ) @@ -98,11 +97,7 @@ func usage() { " -U,--uuid UUID\n"+ " player's account UUID (all zeroes by default)\n"+ " --java-Xmx memory\n"+ - " java's -Xmx param, e.g. 4G\n"+ - " --profile\n"+ - " load/save username, UUID, and -Xmx from/to a file.\n"+ - " Once saved, you can ommit -u,-U and --java-Xmx,\n"+ - " since they will be stored in", mcclprofile.ProfileFileName) + " java's -Xmx param, e.g. 4G") } type arguments struct { @@ -203,8 +198,6 @@ func parseArguments(args []string) (parsed arguments, err error) { } parsed.JavaXmx = args[i+1] i++ - case "--profile": - parsed.UseProfile = true default: err = fmt.Errorf("an unknown option %s was provided", args[i]) return