cmd

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "dev"
	Commit  = "dev"
	Date    = "dev"
)

Version, Commit, and Date are set at build time via -ldflags.

Functions

func NeedsDefaultScan

func NeedsDefaultScan(rootCmd *cobra.Command, args []string) bool

NeedsDefaultScan returns true when args contain no explicit subcommand, meaning "scan" should be prepended. This preserves the UX where `sightjack [flags]` behaves as `sightjack scan [flags]`.

func NewRootCommand

func NewRootCommand() *cobra.Command

NewRootCommand creates the root cobra command with all subcommands attached. Returning *cobra.Command enables test injection via SetArgs/SetOut/SetErr.

func ReorderArgs

func ReorderArgs(rootCmd *cobra.Command, args []string) []string

ReorderArgs moves a known subcommand to the front of args so cobra routes correctly when subcommand-local flags appear before the subcommand name (e.g., "sightjack --json scan" → "sightjack scan --json"). If no subcommand is found, args are returned unchanged.

Types

This section is empty.

Jump to

Keyboard shortcuts

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