3
0
Fork
You've already forked arguments
0
An argument parser and splitter supporting multilingual quotes and escapes
  • Go 100%
2022年03月26日 11:06:18 +09:00
scanner more tests, changes to some method signatures 2022年03月26日 10:39:35 +09:00
.gitignore git ignore 2022年03月26日 11:06:18 +09:00
arguments.go more tests, changes to some method signatures 2022年03月26日 10:39:35 +09:00
arguments_test.go more tests, changes to some method signatures 2022年03月26日 10:39:35 +09:00
go.mod more tests, changes to some method signatures 2022年03月26日 10:39:35 +09:00
go.sum current state 2022年03月24日 11:34:39 +09:00
parser.go more tests, changes to some method signatures 2022年03月26日 10:39:35 +09:00
parser_test.go more tests, changes to some method signatures 2022年03月26日 10:39:35 +09:00
README.md readme and unlicense 2022年03月25日 17:21:45 +09:00
syntax.go first known working version 2022年03月25日 17:21:45 +09:00
UNLICENSE readme and unlicense 2022年03月25日 17:21:45 +09:00

Arguments

A command argument parser with some helpful extras. Supports syntax escapes, multilingual quotation marks, and the ability to mark an argument as escaped. As well as preservation of parsing metadata to allow fetching sections of raw unparsed string between arguments.

Also unofficially known as Greg.

Syntax


  • Argument Separation via spaces, a 'space' in this case being any unicode space, including linebreaks.

    • one two > one, two
    • Repeated spaces, Leading spaces, and Trailing spaces, are all ignored.
  • \ Escaping can cancel out any forms of parsed syntax, including spaces, and other escapes.

    • As an extra that may be useful in certain situations, an argument may be prefixed with an escape (\) to add a meta flag marking it as 'escaped', what this means if anything is up to the end application.
  • Quotation marks may be used to mark a section of text to be treated as a singular argument ignoring any spaces contained between the start and end quote. Supported quotation marks include:

    • Standard single and double quotes.
    • "Smart" quotes, sometimes seen in office software or used by mobile keyboards in place of standard quotes.
    • Chevrons.
    • Japanese angle quotes.