Command line argument parsing improvements (#1048)

* Support negative numbers as command option values
* Support command line options before arguments
* POSIX-compliant handling of quotes (double and single, terminated and unterminated), whitespace, hyphens, and special characters (e.g. emojis)
This commit is contained in:
Frank Ray
2022-12-05 00:07:53 +00:00
committed by GitHub
parent f895bb175d
commit b793482ebb
14 changed files with 812 additions and 326 deletions

View File

@ -1,4 +1,4 @@
Error: Flags cannot be assigned a value.
dog --alive foo
dog --alive=indeterminate foo
^^^^^^^ Can't assign value

View File

@ -1,4 +1,4 @@
Error: Flags cannot be assigned a value.
dog -a foo
dog -a=indeterminate foo
^^ Can't assign value

View File

@ -1,4 +0,0 @@
Error: Encountered unterminated quoted string 'Rufus'.
--name "Rufus
^^^^^^ Did you forget the closing quotation mark?