elleszgo.at/elles/zli2 Index | Files

package zli2

import "zgo.at/elles/zli2"

Index

Types

type Flag

type Flag struct {
	Names []string
	Text  string
	Line  int
}

type Section

type Section struct {
	Title string
	Text  string
	Line  int
	Flags []Flag
}

type Usage

type Usage struct {
	Intro    string
	Sections []Section
	// contains filtered or unexported fields
}

func MustParse

func MustParse(s string) Usage

func Parse

func Parse(s string) (Usage, error)

func (Usage) CompleteBash

func (u Usage) CompleteBash() string

TODO

func (Usage) CompleteFish

func (u Usage) CompleteFish() string

TODO

func (Usage) CompleteZsh

func (u Usage) CompleteZsh(name, site string) string

TODO: finish; to really get something decent we need at least:

- A short description for flags. - Annotate which flags conflict. - Know if _files is correct. - Flags that can be doubled (-ll).

And also:

- Flags that take arguments, and what kind. - Positional arguments.

func (Usage) Flag

func (u Usage) Flag(name string) (string, bool)

flag gets documentation for the flag.

func (Usage) Mandoc

func (u Usage) Mandoc(name string, sect int) string

func (Usage) Section

func (u Usage) Section(name string) (string, bool)

Section gets documentation for the section.

func (Usage) String

func (u Usage) String() string

Should print back the original.

Source Files

usagep.go

Version
v0.2.0 (latest)
Published
Jul 9, 2024
Platform
linux/amd64
Imports
6 packages
Last checked
1 month ago

Tools for package owners.