cmd

package
v0.0.0-...-9d3c4bc Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package cmd implements command-line parsing and a REPL loop.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env struct {
	// contains filtered or unexported fields
}

Env captures all the state needed to run gql commands. Thread compatible

func New

func New(sess *gql.Session, interactive bool) *Env

New creates a new environment. Arg interactive should be true if this is an interactive commandline session.

func (*Env) Loop

func (c *Env) Loop()

Loop runs an interactive eval loop. It never retuns.

func (*Env) NewOutput

func (c *Env) NewOutput() termutil.Printer

NewOutput creates a Printer object that prints to the standard output.

func (*Env) PrintValue

func (c *Env) PrintValue(ctx context.Context, val gql.Value, mode gql.PrintMode, out termutil.Printer)

PrintValue prints the given value to the terminal with paging.

Jump to

Keyboard shortcuts

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