Skip to content

Commit 9f4cd4e

Browse files
committed
refactor
1 parent 5bdb72c commit 9f4cd4e

File tree

7 files changed

+31
-31
lines changed

7 files changed

+31
-31
lines changed

src/backup/execute.go renamed to src/backup/command.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ func GetCommand() cmdline.Command {
2020
return ""
2121
},
2222
Run: func(distroName string, args []string) {
23-
Execute(distroName, args)
23+
execute(distroName, args)
2424
},
2525
}
2626
}
2727

28-
// Execute is default run entrypoint.
29-
func Execute(name string, args []string) {
28+
// execute is default backup entrypoint
29+
func execute(name string, args []string) {
3030
arg0Lower := strings.ToLower(args[0])
3131
opttar := ""
3232
optvhdx := ""

src/clean/execute.go renamed to src/clean/command.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ func GetCommand() cmdline.Command {
2020
return ""
2121
},
2222
Run: func(distroName string, args []string) {
23-
Execute(distroName, args)
23+
execute(distroName, args)
2424
},
2525
}
2626
}
2727

28-
// Execute is default run entrypoint.
29-
func Execute(name string, args []string) {
28+
// execute is default run entrypoint.
29+
func execute(name string, args []string) {
3030
showProgress := true
3131
switch len(args) {
3232
case 0:

src/config/execute.go renamed to src/config/command.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ func GetCommand() cmdline.Command {
2424
return ""
2525
},
2626
Run: func(distroName string, args []string) {
27-
Execute(distroName, args)
27+
execute(distroName, args)
2828
},
2929
}
3030
}
3131

32-
// Execute is default install entrypoint
33-
func Execute(name string, args []string) {
32+
// execute is default install entrypoint
33+
func execute(name string, args []string) {
3434
var err error
3535
uid, flags := get.WslGetConfig(name)
3636
if len(args) == 2 {

src/get/execute.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ func GetCommand() cmdline.Command {
2323
return ""
2424
},
2525
Run: func(distroName string, args []string) {
26-
Execute(distroName, args)
26+
execute(distroName, args)
2727
},
2828
}
2929
}
3030

31-
// Execute is default install entrypoint
32-
func Execute(name string, args []string) {
31+
// execute is default install entrypoint
32+
func execute(name string, args []string) {
3333
uid, flags := WslGetConfig(name)
3434
profile, proferr := wslreg.GetProfileFromName(name)
3535
if len(args) == 1 {

src/install/execute.go renamed to src/install/command.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func GetCommandWithNoArgs() cmdline.Command {
2323
return ""
2424
},
2525
Run: func(distroName string, args []string) {
26-
Execute(distroName, args)
26+
execute(distroName, args)
2727
},
2828
}
2929
}
@@ -39,13 +39,13 @@ func GetCommand() cmdline.Command {
3939
return ""
4040
},
4141
Run: func(distroName string, args []string) {
42-
Execute(distroName, args)
42+
execute(distroName, args)
4343
},
4444
}
4545
}
4646

47-
// Execute is default install entrypoint
48-
func Execute(name string, args []string) {
47+
// execute is default install entrypoint
48+
func execute(name string, args []string) {
4949
if !wsllib.WslIsDistributionRegistered(name) {
5050
var rootPath string
5151
var rootFileSha256 string = ""

src/run/execute.go renamed to src/run/command.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func GetCommandWithNoArgs() cmdline.Command {
2323
}
2424
},
2525
Run: func(distroName string, args []string) {
26-
ExecuteNoArgs(distroName)
26+
executeNoArgs(distroName)
2727
},
2828
}
2929
}
@@ -40,7 +40,7 @@ func GetCommand() cmdline.Command {
4040
}
4141
},
4242
Run: func(distroName string, args []string) {
43-
Execute(distroName, args)
43+
execute(distroName, args)
4444
},
4545
}
4646
}
@@ -57,13 +57,13 @@ func GetCommandP() cmdline.Command {
5757
}
5858
},
5959
Run: func(distroName string, args []string) {
60-
ExecuteP(distroName, args)
60+
executeP(distroName, args)
6161
},
6262
}
6363
}
6464

65-
// Execute is default run entrypoint.
66-
func Execute(name string, args []string) {
65+
// execute is default run entrypoint.
66+
func execute(name string, args []string) {
6767
command := ""
6868
for _, s := range args {
6969
command = command + " " + utils.DQEscapeString(s)
@@ -80,8 +80,8 @@ func Execute(name string, args []string) {
8080
}
8181
}
8282

83-
// ExecuteP runs Execute function with Path Translator
84-
func ExecuteP(name string, args []string) {
83+
// executeP runs execute function with Path Translator
84+
func executeP(name string, args []string) {
8585
var convArgs []string
8686
for _, s := range args {
8787
if strings.Contains(s, "\\") {
@@ -102,11 +102,11 @@ func ExecuteP(name string, args []string) {
102102
}
103103
}
104104

105-
Execute(name, convArgs)
105+
execute(name, convArgs)
106106
}
107107

108-
// ExecuteNoArgs runs distro, but use terminal settings
109-
func ExecuteNoArgs(name string) {
108+
// executeNoArgs runs distro, but use terminal settings
109+
func executeNoArgs(name string) {
110110
efPath, _ := os.Executable()
111111
profile, _ := wslreg.GetProfileFromName(name)
112112

@@ -167,8 +167,8 @@ func ExecuteNoArgs(name string) {
167167
}
168168

169169
utils.SetConsoleTitle(name)
170-
Execute(name, nil)
170+
execute(name, nil)
171171
} else {
172-
Execute(name, nil)
172+
execute(name, nil)
173173
}
174174
}

src/version/execute.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ func GetCommand() cmdline.Command {
1212
return cmdline.Command{
1313
Names: []string{"version", "-v", "--version"},
1414
Run: func(distroName string, args []string) {
15-
Execute()
15+
execute()
1616
},
1717
}
1818
}
1919

20-
// Execute is default version entrypoint. prints version information
21-
func Execute() {
20+
// execute is default version entrypoint. prints version information
21+
func execute() {
2222
fmt.Printf("%s, version %s (%s)\n", project, version, runtime.GOARCH)
2323
fmt.Printf("%s\n", url)
2424
}

0 commit comments

Comments
 (0)