cli

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package cli is moraine's transport layer: it builds the Cobra command tree (root + the sort/clean/version subcommands), wires each command to the typed config and the app orchestrators, and maps command execution to the process exit code. No domain package imports Cobra — the dependency stays contained here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(version string, args []string, stdout, stderr io.Writer) int

Execute builds the command tree, runs it against args (os.Args[1:]), and returns the process exit code. It renders all user-facing errors itself (Cobra's own error/usage output is silenced) and maps the result with classify:

nil              → 0 (success; also -h/--help and --version, which print and return nil)
runtime failure  → 1 ("error: …")        — validation, exiftool preflight, the run
anything else    → 2 ("argument error: …") — unknown command/flag, bad arity/value

Types

This section is empty.

Jump to

Keyboard shortcuts

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