cmd

package
v0.0.0-...-22f70c5 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: GPL-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArgOutput          = "output"
	ArgOutputShorthand = "o"

	ArgFormat          = "format"
	ArgFormatShorthand = "f"

	ArgPretty          = "pretty"
	ArgPrettyShorthand = "p"

	ArgSingleFile          = "single-file"
	ArgSingleFileShorthand = "s"

	FormatJSON = "json"
	FormatYAML = "yaml"

	TitleProperty = "title"
)
View Source
const (
	ArgsVerbose          = "verbose"
	ArgsVerboseShorthand = "v"
)
View Source
const (
	ArgSourceType = "source-type"
	ArgLiveMode   = "live"
	ArgServerURL  = "server"
)
View Source
const (
	DocsCommandsFolder = "./docs/commands"
)

Variables

View Source
var (
	ErrArgumentInvalid = errors.New("argument is invalid")
	ErrInvalidFormat   = errors.New("invalid format")
)

Functions

func DocFilePrepender

func DocFilePrepender(filename string) string

TODO: Consider moving this to package.

func Execute

func Execute()

func WriteItems

func WriteItems(items []*api.Item, opts WriteItemsOption) error

Types

type ConvertCommand

type ConvertCommand struct {
	*cobra.Command
	// contains filtered or unexported fields
}

func NewConvertCommand

func NewConvertCommand() *ConvertCommand

func (*ConvertCommand) Execute

func (c *ConvertCommand) Execute(_ *cobra.Command, args []string) error

type DocsCommand

type DocsCommand struct {
	Command *cobra.Command
}

func NewDocsCommand

func NewDocsCommand() *DocsCommand

NewDocsCommand creates a new cobra.Command for `docs` which generates documentation for the application.

func (*DocsCommand) Execute

func (c *DocsCommand) Execute(_ *cobra.Command, _ []string) error

type MigrateCommand

type MigrateCommand struct {
	Command *cobra.Command
	// contains filtered or unexported fields
}

func NewMigrateCommand

func NewMigrateCommand() *MigrateCommand

func (*MigrateCommand) Execute

func (mc *MigrateCommand) Execute(_ *cobra.Command, _ []string) error

type SyncCommand

type SyncCommand struct {
	*cobra.Command
	// contains filtered or unexported fields
}

func NewSyncCommand

func NewSyncCommand() *SyncCommand

NewSyncCommand returns a new sync command.

func (*SyncCommand) RunE

func (c *SyncCommand) RunE(cmd *cobra.Command, args []string) error

type SyncCommandOptions

type SyncCommandOptions struct {
	LiveMode  bool
	ServerURL string
}

type WriteItemsOption

type WriteItemsOption struct {
	Output     string // Output specifies the output directory or file path.
	Format     string // Format specifies the format of the output (e.g., JSON, XML).
	Pretty     bool   // Pretty specifies whether to format the output in a human-readable way.
	SingleFile bool   // SingleFile specifies whether to write all items into a single file.
}

WriteItemsOption represents the options for writing items.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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