cmd

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI struct {
	Options
	Dump    Dump    `kong:"cmd,help='Download all'"`
	Version Version `kong:"cmd,help='Print version'"`
}

type Dump

type Dump struct {
	TargetID string   `kong:"arg,help='Hatena-ID to dump'"`
	Folders  []string `kong:"arg,optional,help='Specify folders'"`

	Top    bool   `kong:"short='t',help='Include top fotos'"`
	Dir    string `kong:"short='d',help='Directory to save'"`
	Update bool   `kong:"short='u',help='Skip if already downloaded'"`
	DryRun bool   `kong:"short='n',help='Don\\'t download (use with -v)'"`
	Para   int    `kong:"hidden"`
}

func (*Dump) Run

func (d *Dump) Run(o *Options) error

type Logger

type Logger interface {
	Printf(string, ...interface{})
}

type Options

type Options struct {
	Password     string       `kong:"short='p',help='Password when want login'"`
	LoginID      string       `kong:"short='l',help='Login as other ID'"`
	Verbose      bool         `kong:"short='v',help='Enable verbose mode'"`
	Debug        bool         `kong:"hidden,help='Print debug info'"`
	PrintVersion PrintVersion `kong:"hidden,help='Print version'"`

	Logger Logger `kong:"-"`
}

func (*Options) Debugf

func (o *Options) Debugf(format string, v ...interface{})

func (*Options) Logf

func (o *Options) Logf(format string, v ...interface{})

func (*Options) Verbosef

func (o *Options) Verbosef(format string, v ...interface{})

type PrintVersion

type PrintVersion bool

func (PrintVersion) BeforeApply

func (PrintVersion) BeforeApply(app *kong.Kong, vars kong.Vars) error

func (PrintVersion) Decode

func (PrintVersion) Decode(ctx *kong.DecodeContext) error

type Version

type Version struct{}

func (Version) Run

func (Version) Run(vars kong.Vars) error

Jump to

Keyboard shortcuts

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