cli

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package cli provides a public API for the pgsquash CLI functionality.

This package exports the internal CLI implementation for use by external tools while keeping the internal implementation details private.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute() error

Execute runs the pgsquash CLI. This is the main entry point for CLI applications using pgsquash as a library.

Returns an error if command execution fails.

func SetBrandName

func SetBrandName(brandName string)

SetBrandName customizes the CLI branding for different distributions. This allows different binaries (e.g., pgsquash vs capysquash) to have distinct branding while using the same underlying functionality.

Supported brands:

  • "pgsquash" (default) - Technical, engine-focused messaging
  • "capysquash" - Platform-focused, commercial messaging

This should be called during application initialization, after SetVersionInfo.

Example:

cli.SetBrandName("capysquash")

func SetVersionInfo

func SetVersionInfo(version, buildDate, gitCommit string)

SetVersionInfo updates the version information displayed in the CLI. This should be called during application initialization, typically in init().

Parameters:

  • version: The semantic version string (e.g., "0.9.7")
  • buildDate: The build timestamp in ISO 8601 format
  • gitCommit: The git commit hash (short or full)

Example:

cli.SetVersionInfo("0.9.7", "2024-10-21T10:00:00Z", "abc123")

Types

This section is empty.

Jump to

Keyboard shortcuts

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