cmd

package module
v0.0.0-...-49ec808 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: BSD-2-Clause Imports: 14 Imported by: 2

README

xelf-cmd

xelf-cmd is a command to help work with and evaluate xelf input.

xelf is a cross-environment expression language framework. It is meant to be a simple notation for all things crossing process or language boundaries.

License

Copyright (c) 2022 Martin Schnabel. All rights reserved. Use of the source code is governed by a BSD-style license that can found in the LICENSE file.

Documentation

Overview

Package cmd provides helpers for other commands working with xelf. The actual command can be found in the sub directory at xelf.org/cmd/xelf.

Index

Constants

This section is empty.

Variables

View Source
var All = make(map[string]*Cmd)

Functions

func DefaultCtx

func DefaultCtx(dir string, args []string) *xps.CmdCtx

func DefaultEnv

func DefaultEnv(ctx *xps.CmdCtx) exp.Env

func DefaultProg

func DefaultProg(ctx *xps.CmdCtx) *exp.Prog

func ReplHistoryPath

func ReplHistoryPath(rest string) string

func SafetyWrap

func SafetyWrap(f func() error) error

SafetyWrap wraps a function and provides panic recovery.

Types

type Cmd

type Cmd struct {
	Name string
	Func xps.Cmd
}

func Add

func Add(name string, f xps.Cmd) *Cmd

type FileReplHist

type FileReplHist struct {
	Path string
}

func (*FileReplHist) Read

func (h *FileReplHist) Read(r *Repl) error

func (*FileReplHist) Write

func (h *FileReplHist) Write(r *Repl) error

type Repl

type Repl struct {
	*liner.State
	Hist ReplHistory
	Ctx  *xps.CmdCtx
}

func NewRepl

func NewRepl(ctx *xps.CmdCtx, hist ReplHistory) *Repl

func (*Repl) Run

func (r *Repl) Run()

type ReplHistory

type ReplHistory interface {
	Read(*Repl) error
	Write(*Repl) error
}

Directories

Path Synopsis
Command xelf provides repl and other tools to work with xelf languages.
Command xelf provides repl and other tools to work with xelf languages.

Jump to

Keyboard shortcuts

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