Skip to content

v0.2.1

Choose a tag to compare

@pardnchiu pardnchiu released this 17 Jan 18:27
· 17 commits to master since this release

Update Log

Generated: 2026-01-18 16:00
v0.2.0 → v0.2.1

Recommended Commit Message

refactor: Extract command parsing and utilities into internal packages

翻譯 refactor: 將命令解析與工具函式抽取至 internal packages

Summary

Restructure codebase by extracting command parsing logic and utility functions from cmd/cli/main.go into dedicated internal packages (internal/command, internal/utils) for better modularity and separation of concerns.

翻譯 重構程式碼結構,將命令解析邏輯與工具函式從 `cmd/cli/main.go` 抽取至專用的 internal packages(`internal/command`、`internal/utils`),提升模組化與關注點分離。

Changes

REFACTOR

  • Extract PodmanArg struct and command parsing logic to internal/command package
  • Move New() (formerly parseCommand()), parseArgs(), getLocalDir(), setRemoteDir() to internal/command/command.go
  • Extract CheckRelyPackages(), installPackage() to internal/utils/checkRelyPackages.go
  • Extract common utilities IsDir(), FileExist(), GetMAC(), CmdExec() to internal/utils/utils.go
  • Simplify cmd/cli/main.go to entry point only, removing unused imports (crypto/md5, encoding/hex, net, path/filepath, runtime, strings, os/exec)
翻譯
  • 將 PodmanArg struct 與命令解析邏輯抽取至 internal/command package
  • 將 New()(原 parseCommand())、parseArgs()、getLocalDir()、setRemoteDir() 移至 internal/command/command.go
  • 將 CheckRelyPackages()、installPackage() 抽取至 internal/utils/checkRelyPackages.go
  • 將通用工具函式 IsDir()、FileExist()、GetMAC()、CmdExec() 抽取至 internal/utils/utils.go
  • 簡化 cmd/cli/main.go 為純進入點,移除未使用的 imports(crypto/md5、encoding/hex、net、path/filepath、runtime、strings、os/exec)

Files Changed

File Status Tag
cmd/cli/main.go Modified REFACTOR
internal/command/command.go Added REFACTOR
internal/utils/utils.go Added REFACTOR
internal/utils/checkRelyPackages.go Added REFACTOR

Generated by Claude Code