cli

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package cli is the Cobra command tree for the javdb binary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmitJSON

func EmitJSON(w io.Writer, v any) error

EmitJSON writes compact JSON.

func FilterHasMagnets

func FilterHasMagnets(movies []map[string]any) []map[string]any

FilterHasMagnets drops rows with magnets_count == 0; keeps missing field.

func FmtSize

func FmtSize(size any) string

FmtSize formats magnet size (MiB integer from API).

func PrintDetail

func PrintDetail(w io.Writer, movie map[string]any)

PrintDetail writes graph-oriented detail lines (Python parity).

func PrintLists

func PrintLists(w io.Writer, errW io.Writer, items []map[string]any)

PrintLists writes id\tname\tmovies\tprivacy\tviews.

func PrintMovieComments added in v0.4.0

func PrintMovieComments(w io.Writer, errW io.Writer, reviews []map[string]any)

PrintMovieComments 以可读的逐条形式输出评论;JSON 模式保留上游所有字段。

func PrintMovieMagnets

func PrintMovieMagnets(w io.Writer, errW io.Writer, items []map[string]any)

PrintMovieMagnets prints magnet rows (name/size/flags/hash). Basic form for detail --magnets.

func PrintMovies

func PrintMovies(w io.Writer, errW io.Writer, movies []map[string]any)

PrintMovies writes number\tid\ttitle[\tdate] lines.

func PrintNamed

func PrintNamed(w io.Writer, errW io.Writer, items []map[string]any)

PrintNamed writes id\tname[\tcount] for codes/series/actors/….

func PrintNamedNoCount

func PrintNamedNoCount(w io.Writer, errW io.Writer, items []map[string]any)

PrintNamedNoCount prints id\tname only.

func PrintRankedMovies

func PrintRankedMovies(w io.Writer, errW io.Writer, movies []map[string]any)

PrintRankedMovies prefixes each row with #ranking.

func PromptPassword

func PromptPassword(out io.Writer) (string, error)

PromptPassword reads a password without echo when stdin is a TTY.

func PromptUsername

func PromptUsername(in io.Reader, out io.Writer) (string, error)

PromptUsername reads a non-empty username from in (or interactive stdin).

func Run

func Run(args []string, stdin io.Reader, stdout, stderr io.Writer) int

Run executes the CLI with the given args (usually os.Args[1:]).

func SearchTypeKey

func SearchTypeKey(type_ string) string

SearchTypeKey maps --type to response list key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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