cmdline

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Overview

Package cmdline implements command-line utilities for tools.

Index

Constants

View Source
const (
	// Stringy indicates the input is coming from an argument string.
	// "auto" behavior prefers hexadecimal.
	Stringy = iota
	// Filey indicates the input is coming from a file.
	// "auto" behavior prefers binary.
	Filey
)

Variables

This section is empty.

Functions

func Bytes

func Bytes(name string, byteSize int, in *string) *[]byte

Bytes is a flag.Func parsing function that translates a string into a specific byte-width array.

A byte string can be represented as * hexadecimal encoded string if -inform=hex or -inform=auto. * base64 if -inform=base64 or -inform=auto

Hex string decoding is attempted first with auto. The base64 encoding grammar intersects with the hex encoding grammar, so -inform=auto can misbehave.

func Parse

func Parse(inform string)

Parse processes all flag data given the input format and the precondition that all input flags have been parsed.

func ParseBytes

func ParseBytes(name string, byteSize int, in io.Reader, inform string, intype InputType) ([]byte, error)

ParseBytes returns the denoted bytes from the reader `in` or an error.

Types

type InputType

type InputType int

InputType represents how data is coming in, either via file or string.

Jump to

Keyboard shortcuts

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