lama2cmd

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package `lama2cmd` provides CLI argument parsing facilities. It hosts the `Opts` structure to record user intentions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opts

type Opts struct {
	Output   string `short:"o" long:"output" description:"Path to output JSON file to store logs, headers and result"`
	Verbose  []bool `short:"v" long:"verbose" description:"Show verbose debug information"`
	Prettify bool   `short:"p" long:"prettify" description:"Prettify specified .lama file"`
	Sort     bool   `short:"s" long:"sort" description:"Sort specification into recommended order"`
	Nocolor  bool   `short:"n" long:"nocolor" description:"Disable color in httpie output"`
	Help     bool   `short:"h" long:"help" group:"AddHelp" description:"Usage help for Lama2"`

	Positional struct {
		LamaAPIFile string `required:"yes"`
	} `positional-args:"yes"`
}

The Opts structure stores user preferences, and is used throughout the module to make various decisions.

func GetAndValidateCmd

func GetAndValidateCmd(ipArgs []string) *Opts

GetAndValidateCmd takes in the user's CLI input, and checks for validity. If not OK, displays a help message in stdout. Otherwise, fills the Opts structure and returns it Moreover, based on user input, the outputManager gets configured (whether user prefers trace/debug/info level)

Jump to

Keyboard shortcuts

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