cli

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2026 License: AGPL-3.0 Imports: 47 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cli 承载 wind 的子命令逻辑(执行计划 §6.9)。与 main 分离: IO(stdin/stdout/stderr)全部注入,命令函数返回退出码而非直接 os.Exit, 集成测试得以在进程内驱动完整 share/get 流程(DfT)。

Index

Constants

View Source
const (
	ExitOK      = int(command.ExitOK)
	ExitFailure = int(command.ExitFailure)
	ExitUsage   = int(command.ExitUsage)
	ExitNetwork = int(command.ExitNetwork)
	ExitDrift   = int(command.ExitDrift)
)

退出码语义(§6.9 工程要求):脚本据此区分"该重试"(网络)与"该改命令" (用户错误)与"该重新分享"(漂移)。唯一定义在 internal/command。

Variables

This section is empty.

Functions

func Main

func Main() int

Main 是 os 进程入口的接线:真实标准流 + 终止信号取消(Ctrl-C、SIGTERM、 SIGHUP 都是"停止分享"/"中断下载"语义,§6.9)。

Types

type App

type App struct {
	Stdout io.Writer
	Stderr io.Writer
	Stdin  io.Reader
	// contains filtered or unexported fields
}

App 是一次 CLI 调用的执行环境;字段即全部外部依赖。

func (*App) Run

func (a *App) Run(ctx context.Context, args []string) int

Run dispatches top-level commands. Every command parses arguments and answers help requests before acquiring transfer-engine or OS authority.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL