flags

command
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2025 License: MIT Imports: 1 Imported by: 0

README

flags - using flags

Flags are a very convenient thing for using commands.

Image with flags
How the flags are described:

To create a flag in a command, you need to describe the Flags field:

Commands: []*replyme.Command: {
	Flags: []replyme.Flag: {
	    &replyme.FlagValue[string]{
			Name: "myStringFlag",
			Usage: "Flag for a string"
        }
    }
}

The available types of flags (which can be specified in replyme.FlagValue[T]):

Type Usage
string --name="value", --name value
int --name=0,--name 0
bool --name
[]string --name="hello,my,test"
[]int --name=1,2,3,4

The types are specified in *replyme.FlagValue[T], where T is one of the available types. You can specify several flags, and you can use them in any convenient order in a command.

To see how it works, open the flags/main.go, you can see an example in it

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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