zikes / argparse

Super simple string argument parsing library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

argparse

Super simple library for parsing strings into a slice of string arguments.

input := `this "is a" test`
output := argparse.Parse(input)
fmt.Printf("%#v", output)
// []string{"this", "is a", "test"}

Supports escaping quotes and spaces with backslash:

input := `this \"is\" a\ test`
output := argparse.Parse(input)
fmt.Printf("%#v", output)
// []string{"this", "\"is\"", "a test"}

About

Super simple string argument parsing library


Languages

Language:Go 100.0%