cmd

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package cmd wires the cobra command tree for codearts-cli.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute() int

Execute is the main entrypoint; returns the process exit code.

func ExtractStringFromResp added in v0.2.0

func ExtractStringFromResp(resp map[string]interface{}, key string) string

ExtractStringFromResp tries to pull a named field out of the standard Huawei envelope: {"result": [{"id": "..."}]} or {"result": {"id": "..."}}.

func FirstNonEmpty added in v0.2.0

func FirstNonEmpty(inlineName, inline, fileName, file string) (string, error)

FirstNonEmpty returns the value of the first non-empty input (inline JSON or file). It errors when both are supplied simultaneously for the same logical input.

func ParseRepoID added in v0.2.0

func ParseRepoID(raw string) (int, error)

ParseRepoID rejects anything that isn't a pure positive integer (no hex, no leading signs, no whitespace). Earlier this used fmt.Sscanf which silently truncated UUIDs to their leading digit run — e.g. the UUID "759278ab..." quietly parsed as 759278. That would quietly send the request to the wrong repository, so we reject non-numeric input up-front.

Types

This section is empty.

Jump to

Keyboard shortcuts

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