cli

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package cli は mdots のコマンド骨格を定義する。

CLIフレームワークの最終採用は urfave/cli v3(宣言ツリーで push/pull と --target/--dry-run/--color を定義する)。

CLI表面(help/version/unknown/usage時の文面・exit)は枠組み既定に寄せる。 内部実行は Executor 委譲とし、エントリは薄く保つ。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(args []string, cwd, version string, ex Executor, stdout, stderr io.Writer) int

Run は CLI表面の入口である。args は os.Args[1:] 相当、cwd は実行ディレクトリ。 戻り値はプロセスの exit code。 フラグ解釈・help/version/unknown の表面は枠組み既定に任せ、 空値・余剰引数の拒否だけを Action 側で残す。

Types

type Executor

type Executor interface {
	Push(cwd, target string) error
	Pull(cwd, target string) error
	PushDryRun(cwd, target, color string, stdout, stderr io.Writer) int
	PullDryRun(cwd, target, color string, stdout, stderr io.Writer) int
	Init(cwd string) error
	Targets(cwd string) ([]string, error)
	Add(cwd, dest, target string) (string, string, error)
}

Executor は push/pull/init/targets/add の内部実行系への委譲口である。 表面(文面・exit)は本パッケージが保ち、副作用のある処理だけを委譲する。

Jump to

Keyboard shortcuts

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