cmd

package
v0.0.0-...-29f7888 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 31 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachmentTable

func AttachmentTable[T Downloadable](w io.Writer, attachments []T)

AttachmentTable renders a name/type/size listing for any Downloadable type.

func BuildCommandIndex

func BuildCommandIndex(version string) map[string]cli.Cmd

BuildCommandIndex combines built-in and registered commands. version is the binary version reported by schema. Building the map here lets schema capture it without a package-initialization cycle.

func CommentsBrief

func CommentsBrief(w io.Writer, comments []jira.Comment)

CommentsBrief renders each comment as a single line, body collapsed and truncated to cli.CommentBriefTrunc runes.

func CommentsFull

func CommentsFull(w io.Writer, comments []jira.Comment)

func CommentsHeader

func CommentsHeader(w io.Writer, count int)

func ComponentsTable

func ComponentsTable(w io.Writer, components []jira.NamedField)

func FilterInteresting

func FilterInteresting(fields []jira.FieldMeta) []jira.FieldMeta

FilterInteresting keeps required fields and fields with allowed-value hints.

func Form

func Form(w io.Writer, issueKey string, detail jira.FormDetail)

func GanttReport

func GanttReport(w io.Writer, plan gantt.Plan, v ganttView)

GanttReport prints the plan as text: totals, flagged issues, dependencies, the chart, the schedule table, and the issues without dates.

func HistoryTable

func HistoryTable(w io.Writer, entries []jira.History)

func InvalidValuesError

func InvalidValuesError(fhc FieldHintCmd, target string, mismatches []FieldMismatch) error

InvalidValuesError retains mismatches and command-specific correction examples.

func IssueDetail

func IssueDetail(w io.Writer, issue *jira.Issue, startField string)

IssueDetail prints an issue's fields and description. startField is the ID of the start date field; "" leaves the Start line out.

func IssueTable

func IssueTable(w io.Writer, issues []jira.Issue)

IssueTable prints one line per issue. The DUE column appears when at least one issue has a due date.

func IssueTypesTable

func IssueTypesTable(w io.Writer, types []jira.IssueTypeInfo)
func Links(w io.Writer, links []ParsedLink)

func MetaSection

func MetaSection(w io.Writer, transitions []jira.Transition, edit []jira.FieldMeta)

MetaSection prints transitions and editable fields, omitting empty sections.

func MissingFields

func MissingFields(meta []jira.FieldMeta, supplied map[string]any, autoPopulated map[string]struct{}) []jira.FieldMeta

MissingFields returns required fields absent from supplied, excluding autoPopulated IDs.

func MissingFieldsError

func MissingFieldsError(fhc FieldHintCmd, target string, missing []jira.FieldMeta) error

MissingFieldsError retains required fields and command-specific correction examples.

func ProjectCreateMetaBlocks

func ProjectCreateMetaBlocks(w io.Writer, types []jira.IssueTypeInfo, meta map[string][]jira.FieldMeta, full bool)

ProjectCreateMetaBlocks lists fields in issue-type order. Unless full is set, it shows only required fields and fields with allowed values.

func ProjectHeader

func ProjectHeader(w io.Writer, p *jira.ProjectDetail)

ProjectHeader prints project details and components.

func ProjectStatusBlocks

func ProjectStatusBlocks(w io.Writer, statuses []jira.ProjectStatusGroup)

ProjectStatusBlocks lists workflow statuses by issue type.

func ProjectsTable

func ProjectsTable(w io.Writer, projects []jira.ProjectRef)

func RegisterCommand

func RegisterCommand(name string, c cli.Cmd)

RegisterCommand adds a build-local command, typically from init in an untracked internal/cmd file. Duplicate registrations panic; built-in collisions panic later in BuildCommandIndex.

func RenderFieldList

func RenderFieldList(w io.Writer, fields []jira.FieldMeta)

RenderFieldList lists field types, allowed values, and operations. Required fields come first; fields within each group sort by name.

func ResolveAnswer

func ResolveAnswer(q jira.Question, ans jira.Answer) string

func SetExample

func SetExample(f jira.FieldMeta) string

SetExample returns a shell-quoted edit example, preferring a lossless typed flag.

func SetExampleFor

func SetExampleFor(cmd FieldHintCmd, f jira.FieldMeta) string

SetExampleFor returns a shell-quoted example using a supported typed flag, --set for strings, or --set-json for other values.

func TransitionsRequiredFields

func TransitionsRequiredFields(w io.Writer, transitions []jira.Transition)

TransitionsRequiredFields prints allowed values and examples for required transition fields.

func TransitionsTable

func TransitionsTable(w io.Writer, transitions []jira.Transition)

func UnknownFieldIDs

func UnknownFieldIDs(meta []jira.FieldMeta, supplied map[string]any) []string

UnknownFieldIDs returns supplied field IDs absent from metadata, sorted by ID.

func UnknownFieldsError

func UnknownFieldsError(target string, meta []jira.FieldMeta, unknown []string) error

UnknownFieldsError retains editable choices for both human and JSON errors.

func UsersTable

func UsersTable(w io.Writer, users []jira.User)

Types

type Downloadable

type Downloadable interface {
	AttachName() string
	AttachSize() int64
	AttachType() string
}

Downloadable exposes attachment metadata for Jira and Confluence downloads.

type FieldHintCmd

type FieldHintCmd int

FieldHintCmd selects the command's supported flags for field examples.

const (
	FieldHintCreate FieldHintCmd = iota
	FieldHintEdit
	FieldHintTransition
)

type FieldMismatch

type FieldMismatch struct {
	Field    jira.FieldMeta
	Supplied any      // value as the caller passed it (post-applyValueFlags)
	Allowed  []string // labels that would have matched
}

FieldMismatch describes a supplied value outside the field's allowed set.

func MismatchedValues

func MismatchedValues(meta []jira.FieldMeta, supplied map[string]any) []FieldMismatch

MismatchedValues returns values outside their allowed sets in stable order. Fields absent from metadata or without allowed values are skipped.

type MetaViewResult

type MetaViewResult struct {
	Issue           jsontext.Value    `json:"issue"`
	EditMeta        []jira.FieldMeta  `json:"edit_meta"`
	MetaTransitions []jira.Transition `json:"transitions"`
}

MetaViewResult is the view --meta payload without --full.

type ParsedLink struct {
	Direction string `json:"direction"` // "outward", "inward", or "remote"
	Type      string `json:"type"`
	Key       string `json:"key"`
	Summary   string `json:"summary"`
	Status    string `json:"status"`
}

ParsedLink is the text and JSON representation of an issue or remote link.

func AppendRemoteLinks(links []ParsedLink, remoteLinks []jira.RemoteLink) []ParsedLink

AppendRemoteLinks appends remote links without deduplication.

func IssueLinksToDisplay

func IssueLinksToDisplay(issueLinks []jira.IssueLink) []ParsedLink

type ProjectViewResult

type ProjectViewResult struct {
	Project    *jira.ProjectDetail         `json:"project"`
	Statuses   []jira.ProjectStatusGroup   `json:"statuses,omitzero"`
	CreateMeta map[string][]jira.FieldMeta `json:"create_meta,omitzero"`
}

ProjectViewResult is the project JSON payload. Focused mode omits statuses and includes create metadata for one issue type.

type SearchFilters

type SearchFilters struct {
	Project   string
	Status    string
	Assignee  string
	IssueType string
	Priority  string
	Label     string
	Component string
	Text      string
}

SearchFilters holds search and count criteria. Empty fields are ignored.

type SmartViewResult

type SmartViewResult struct {
	Issue           jsontext.Value    `json:"issue"`
	Links           []ParsedLink      `json:"links"`
	Checklist       []checklist.Item  `json:"checklist"`
	Forms           []jira.FormDetail `json:"forms"`
	Comments        []jira.Comment    `json:"comments"`
	Children        []jira.Issue      `json:"children"`
	EditMeta        []jira.FieldMeta  `json:"edit_meta,omitzero"`
	MetaTransitions []jira.Transition `json:"transitions,omitzero"`
}

SmartViewResult is the view --full payload. Collections are arrays, not null; metadata fields are included only with --meta.

Jump to

Keyboard shortcuts

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