File: main.go

package info (click to toggle)
golang-github-integrii-flaggy 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 292 kB
  • sloc: makefile: 3
file content (17 lines) | stat: -rw-r--r-- 384 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package main

import "github.com/integrii/flaggy"

func main() {
	// Declare variables and their defaults
	var positionalValue = "defaultValue"

	// Add the positional value to the parser at position 1
	flaggy.AddPositionalValue(&positionalValue, "test", 1, true, "a test positional value")

	// Parse the positional value
	flaggy.Parse()

	// Use the value
	print(positionalValue)
}