lama2cmd

package
v1.6.10-beta Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: AGPL-3.0 Imports: 7 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

func ArgParsing added in v1.3.0

func ArgParsing(o *Opts, version string)

func SetLSPServer added in v1.6.9

func SetLSPServer(server LSPServer)

Types

type LSPServer added in v1.6.9

type LSPServer interface {
	StartLspServer()
}

LSPServer defines the interface for starting an LSP server

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:"b" long:"prettify" description:"Prettify specified .l2 file"`
	// Sort     bool   `short:"s" long:"sort" description:"Sort specification into recommended order"`
	Convert     string `` /* 138-byte string literal not displayed */
	Nocolor     bool   `short:"n" long:"nocolor" description:"Disable color in httpie output"`
	Update      bool   `short:"u" long:"update" description:"Update l2 binary to the latest released version (Linux/MacOS only)"`
	PostmanFile string `short:"p" long:"postmanfile" description:"JSON export from Postman (Settings -> Data -> Export Data)"`
	LamaDir     string `short:"l" long:"lama2dir" description:"Output directory to put .l2 files after conversion from Postman format"`
	Help        bool   `short:"h" long:"help" group:"AddHelp" description:"Usage help for Lama2"`
	Lsp         bool   `short:"z" long:"lsp" description:"Start the lsp server"`
	Version     bool   `long:"version" description:"Print Lama2 binary version"`

	Positional struct {
		LamaAPIFile string
	} `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