Documentation ¶
Overview ¶
Package cli provides CLI app and global flags
Index ¶
- type Cli
- func (c *Cli) AfterApply(_ *kong.Kong, _ kong.Vars) error
- func (c *Cli) Close()
- func (c *Cli) Context() context.Context
- func (c *Cli) DB(dbname string) (xdb.Provider, error)
- func (c *Cli) ErrWriter() io.Writer
- func (c *Cli) Print(value any) error
- func (c *Cli) Reader() io.Reader
- func (c *Cli) SchemaProvider(dbname string) (schema.Provider, error)
- func (c *Cli) WithErrWriter(out io.Writer) *Cli
- func (c *Cli) WithReader(reader io.Reader) *Cli
- func (c *Cli) WithSchemaProvider(p schema.Provider) *Cli
- func (c *Cli) WithWriter(out io.Writer) *Cli
- func (c *Cli) Writer() io.Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cli ¶
type Cli struct { Version ctl.VersionFlag `name:"version" help:"Print version information and quit" hidden:""` Debug bool `short:"D" help:"Enable debug mode"` O string `help:"Print output format: json|yaml|table" default:"table"` SQLSource string `help:"SQL sources, if not provided, will be used from XDB_DATASOURCE env var"` // contains filtered or unexported fields }
Cli provides CLI context to run commands
func (*Cli) AfterApply ¶
AfterApply hook loads config
func (*Cli) SchemaProvider ¶
SchemaProvider returns schema.Provider
func (*Cli) WithErrWriter ¶
WithErrWriter allows to specify a custom error writer
func (*Cli) WithReader ¶
WithReader allows to specify a custom reader
func (*Cli) WithSchemaProvider ¶
WithSchemaProvider allows to specify a custom schema provider
func (*Cli) WithWriter ¶
WithWriter allows to specify a custom writer
Click to show internal directories.
Click to hide internal directories.