refactor: remove address flag and set default value in command configuration

This commit is contained in:
2025-01-21 15:24:01 -06:00
parent 4caa14fa68
commit aa6764040b
2 changed files with 1 additions and 4 deletions

1
.vscode/launch.json vendored
View File

@@ -11,7 +11,6 @@
"mode": "auto",
"program": "${workspaceFolder}/main.go",
"args": [
"--address", ":80",
"--memory", "1G",
"--disk", "10G",
"--disk-path", "tmp/disk",

View File

@@ -29,7 +29,6 @@ import (
)
var (
address string
memory string
memorymultiplier int
disk string
@@ -47,7 +46,7 @@ var rootCmd = &cobra.Command{
significantly improving download times and reducing the load on the internet connection.`,
Run: func(cmd *cobra.Command, args []string) {
sc := steamcache.New(
address,
":80",
memory,
memorymultiplier,
disk,
@@ -68,7 +67,6 @@ func Execute() {
}
func init() {
rootCmd.Flags().StringVarP(&address, "address", "a", ":80", "The address to listen on")
rootCmd.Flags().StringVarP(&memory, "memory", "m", "100MB", "The size of the memory cache")
rootCmd.Flags().IntVarP(&memorymultiplier, "memory-multiplier", "M", 10, "The multiplier for the memory cache")
rootCmd.Flags().StringVarP(&disk, "disk", "d", "10GB", "The size of the disk cache")