Documentation
¶
Overview ¶
Package cli is the command table, argument parsing, help and error handling of `ce`.
Index ¶
- func ParseID(value, what string) (int64, error)
- func Projects(c *api.Client) ([]map[string]any, error)
- func QuotePath(goos, path string) string
- func Run(argv []string, h *host.Host) int
- type Command
- type Exit
- type Kind
- type Session
- func (s *Session) API() (*api.Client, error)
- func (s *Session) AgentToken(url string) (string, error)
- func (s *Session) Bool(name string) bool
- func (s *Session) Has(name string) bool
- func (s *Session) Link() (*config.Link, error)
- func (s *Session) List(name string) []string
- func (s *Session) Project(c *api.Client, ref string) (map[string]any, error)
- func (s *Session) ProjectFilter() (string, error)
- func (s *Session) ProjectRef() (string, error)
- func (s *Session) String(name string) string
- func (s *Session) Token(url string) (string, error)
- func (s *Session) URL() (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Command ¶
type Command struct {
// Path is for example ["issue", "list"].
Path []string
Summary string
// Usage shows the arguments and options, for example "<id> [--section <name>]".
Usage string
// Details are the option lines of the help.
Details []string
Options map[string]Kind
// Args are the names of the positional arguments. A name in brackets is optional; a last
// name like "[path...]" takes any number of arguments.
Args []string
Run func(s *Session) error
// Docs is the docs section of the command: its errors link to it unless they have their own.
Docs docs.Topic
// Hidden commands are old names that still work for one release; help does not show them.
Hidden bool
}
Command is one command, for example `ce issue list`.
type Exit ¶
type Exit int
Exit ends a command with an exit code and no error message (the command printed its result).
type Session ¶
type Session struct {
Host *host.Host
Out *output.Output
Args []string
// contains filtered or unexported fields
}
Session is one run of a command: parsed arguments, output and lazy access to the API.
func (*Session) AgentToken ¶
AgentToken is the agent token for `ce mcp`: CHECKEND_AGENT_TOKEN, else the saved agent token of the linked app, else the only agent token of the instance. Never the login of a person.
func (*Session) ProjectFilter ¶
ProjectFilter is the project for a ?project= filter. The server takes the public ID or the slug (lowercase), so no lookup is needed.
func (*Session) ProjectRef ¶
ProjectRef is the project from --project or .checkend.json, or "".