command

package
v0.0.0-...-b68d50b Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package command defines the subcommands available to the dice CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvalCommand

func EvalCommand(c *cli.Context) error

EvalCommand will evaluate the first argument it is provided as a math.DiceExpression and print the result or return any errors during evaluation.

func Field

func Field(i interface{}, field string) interface{}

Field extracts a field from a given interface.

func Output

func Output(c *cli.Context, i interface{}) (string, error)

Output prints an interface based on the desired format.

func OutputField

func OutputField(c *cli.Context, i interface{}, field string) (string, error)

OutputField prints a given field from a provided interface using a provided context's format.

func REPLCommand

func REPLCommand(c *cli.Context) error

REPLCommand is a command that will initiate a dice REPL.

func RollCommand

func RollCommand(c *cli.Context) error

RollCommand is a command that will create a Dice from the first argument passed and roll it, printing the result.

func ServerCommand

func ServerCommand(c *cli.Context) error

ServerCommand is a command that will initialize a DRAAS HTTP server.

The server routines themselves should be split into a separate dice/server package.

Types

This section is empty.

Jump to

Keyboard shortcuts

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