Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoArgsGiven = errors.New("no arguments given")
Functions ¶
Types ¶
type CLI ¶
type CLI struct {
Globals
Query QueryCmd `cmd:"" default:"withargs" help:"[default] Execute a query"`
Version VersionCmd `cmd:"" help:"Print the version"`
Interactive InteractiveCmd `cmd:"" help:"Start an interactive session (alpha)"`
}
type Config ¶
type Config struct {
DefaultFormat string `yaml:"default_format"`
}
Config holds the contents of a config file.
func LoadConfig ¶
LoadConfig loads the config from the given path. If already loaded, returned previously loaded config.
type InteractiveCmd ¶
type InteractiveCmd struct {
Vars variables `flag:"" name:"var" help:"Variables to pass to the query. E.g. --var foo=\"bar\" --var baz=json:file:./some/file.json"`
ExtReadWriteFlags extReadWriteFlags `` /* 129-byte string literal not displayed */
ExtReadFlags extReadWriteFlags `flag:"" name:"read-flag" help:"Reader flag to customise parsing. E.g. --read-flag xml-mode=structured"`
ExtWriteFlags extReadWriteFlags `flag:"" name:"write-flag" help:"Writer flag to customise output. E.g. --write-flag csv-delimiter=;"`
InFormat string `flag:"" name:"in" short:"i" help:"The format of the input data."`
OutFormat string `flag:"" name:"out" short:"o" help:"The format of the output data."`
ConfigPath string `name:"config" short:"c" help:"Path to config file" default:"~/dasel.yaml"`
Query string `arg:"" help:"The query to execute." optional:"" default:""`
}
func NewInteractiveCmd ¶
func NewInteractiveCmd(queryCmd *QueryCmd) *InteractiveCmd
func (*InteractiveCmd) Run ¶
func (c *InteractiveCmd) Run(ctx *Globals) error
type QueryCmd ¶
type QueryCmd struct {
Vars variables `flag:"" name:"var" help:"Variables to pass to the query. E.g. --var foo=\"bar\" --var baz=json:file:./some/file.json"`
ExtReadWriteFlags extReadWriteFlags `` /* 129-byte string literal not displayed */
ExtReadFlags extReadWriteFlags `flag:"" name:"read-flag" help:"Reader flag to customise parsing. E.g. --read-flag xml-mode=structured"`
ExtWriteFlags extReadWriteFlags `flag:"" name:"write-flag" help:"Writer flag to customise output. E.g. --write-flag csv-delimiter=;"`
InFormat string `flag:"" name:"in" short:"i" help:"The format of the input data."`
OutFormat string `flag:"" name:"out" short:"o" help:"The format of the output data."`
ReturnRoot bool `flag:"" name:"root" help:"Return the root value."`
Unstable bool `flag:"" name:"unstable" help:"Allow access to potentially unstable features."`
Interactive bool `flag:"" name:"it" help:"Run in interactive mode (alpha)."`
ConfigPath string `name:"config" short:"c" help:"Path to config file" default:"~/dasel.yaml"`
Query string `arg:"" help:"The query to execute." optional:"" default:""`
}
type VersionCmd ¶
type VersionCmd struct {
}
func (*VersionCmd) Run ¶
func (c *VersionCmd) Run(ctx *Globals) error
Click to show internal directories.
Click to hide internal directories.