command

package
v0.0.0-...-eb541bc Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvScrapboxToken = "SCRAPBOX_TOKEN"
	EnvScrapboxHost  = "SCRAPBOX_HOST"
	EnvExpiration    = "SCRAPBOX_EXPIRATION"
	EnvUserAgent     = "SCRAPBOX_USER_AGENT"
)
View Source
const (
	EnvDebug       = "SCRAPBOX_DEBUG"
	EnvLongRunTest = "SCRAPBOX_LONG_RUN_TEST"
)

Variables

View Source
var (
	DebugMode       = os.Getenv(EnvDebug) != ""
	LongRunTestMode = os.Getenv(EnvLongRunTest) != ""
)

Functions

func EnvToInt

func EnvToInt(name string, value int) int

Types

type ExitCode

type ExitCode int
const (
	ExitCodeOK ExitCode = iota
	ExitCodeError
	ExitCodeParseFlagsError
	ExitCodeBadArgs
	ExitCodeInvalidURL
	ExitCodeProjectNotFound
	ExitCodePageNotFound
	ExitCodeFetchFailure
)

type LinkCommand

type LinkCommand struct {
	Meta
}
func (c *LinkCommand) FetchAllLinks(client *client.Client, project, page string) ([]string, error)

func (*LinkCommand) Help

func (c *LinkCommand) Help() string

func (*LinkCommand) Run

func (c *LinkCommand) Run(args []string) int

func (*LinkCommand) Synopsis

func (c *LinkCommand) Synopsis() string

type ListCommand

type ListCommand struct {
	Meta
}

func (*ListCommand) FetchRelatedPages

func (c *ListCommand) FetchRelatedPages(client *client.Client, project string, tags []string) ([]string, error)

func (*ListCommand) Help

func (c *ListCommand) Help() string

func (*ListCommand) Run

func (c *ListCommand) Run(args []string) int

func (*ListCommand) Synopsis

func (c *ListCommand) Synopsis() string

type Meta

type Meta struct {
	Ui cli.Ui
}

Meta contain the meta-option that nearly all subcommand inherited.

type OpenCommand

type OpenCommand struct {
	Meta
}

func (*OpenCommand) BuildPageURL

func (c *OpenCommand) BuildPageURL(host, project, page string) string

func (*OpenCommand) Help

func (c *OpenCommand) Help() string

func (*OpenCommand) Run

func (c *OpenCommand) Run(args []string) int

func (*OpenCommand) Synopsis

func (c *OpenCommand) Synopsis() string

type ReadCommand

type ReadCommand struct {
	Meta
}

func (*ReadCommand) FetchContent

func (c *ReadCommand) FetchContent(client *client.Client, project, page string) ([]string, error)

func (*ReadCommand) Help

func (c *ReadCommand) Help() string

func (*ReadCommand) Run

func (c *ReadCommand) Run(args []string) int

func (*ReadCommand) Synopsis

func (c *ReadCommand) Synopsis() string

type VersionCommand

type VersionCommand struct {
	Meta

	Name     string
	Version  string
	Revision string
}

func (*VersionCommand) Help

func (c *VersionCommand) Help() string

func (*VersionCommand) Run

func (c *VersionCommand) Run(args []string) int

func (*VersionCommand) Synopsis

func (c *VersionCommand) Synopsis() string

Jump to

Keyboard shortcuts

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