argparse

package
v0.0.0-...-9648343 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2021 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package argparse implements lidl argument parsing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Args

type Args struct {
	Named map[string]string
	Args  []string
}

Args holds named and position arguments

func Parse

func Parse(line string) *Args

Parse parses a line into command arguments.

func ParseArgs

func ParseArgs(args []string) *Args

ParseArgs parses presplit arguments into command arguments.

TODO: quote handling TODO: deal with duplicate keys TODO: add -- equivalent

func (*Args) Arg

func (a *Args) Arg(i int) string

Arg returns the given argument, even if it is not set.

func (*Args) NamedArg

func (a *Args) NamedArg(key, def string) string

Named returns a named argument, or a default if it is not set.

func (*Args) Tail

func (a *Args) Tail(i int) string

Tail returns the argument at position i, even if it is not strictly the final argument.

Jump to

Keyboard shortcuts

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