diff options
author | Araq <rumpf_a@web.de> | 2019-06-28 11:45:21 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2019-06-28 11:45:21 +0200 |
commit | 284a8cb58ac8abee54d7ed2ba95c82ad9179004f (patch) | |
tree | a5cb32c43f38053d61a5c8b3a21be9b88e2e958c /nimpretty | |
parent | d72edfb14b5ed7fcfa0eaf63e8e291d48847ba25 (diff) | |
download | Nim-284a8cb58ac8abee54d7ed2ba95c82ad9179004f.tar.gz |
nimpretty: bugfix [bugfix]
Diffstat (limited to 'nimpretty')
-rw-r--r-- | nimpretty/tests/exhaustive.nim | 39 | ||||
-rw-r--r-- | nimpretty/tests/expected/exhaustive.nim | 39 |
2 files changed, 78 insertions, 0 deletions
diff --git a/nimpretty/tests/exhaustive.nim b/nimpretty/tests/exhaustive.nim index 14c318495..ffdc95cca 100644 --- a/nimpretty/tests/exhaustive.nim +++ b/nimpretty/tests/exhaustive.nim @@ -618,3 +618,42 @@ veryLongVariableName.createVar("future" & $node[1][0].toStrLit, node[1], futureV veryLongVariableName.createVar("future" & $node[1][0].toStrLit, node[1], futureValue1, futureValue2, node) + +type + CmdLineKind* = enum ## The detected command line token. + cmdEnd, ## End of command line reached + cmdArgument, ## An argument such as a filename + cmdLongOption, ## A long option such as --option + cmdShortOption ## A short option such as -c + OptParser* = object of RootObj ## \ + ## Implementation of the command line parser. Here is even more text yad. + ## + ## To initialize it, use the + ## `initOptParser proc<#initOptParser,string,set[char],seq[string]>`_. + pos*: int + inShortState: bool + allowWhitespaceAfterColon: bool + shortNoVal: set[char] + longNoVal: seq[string] + cmds: seq[string] + idx: int + kind*: CmdLineKind ## The detected command line token + key*, val*: TaintedString ## Key and value pair; the key is the option + ## or the argument, and the value is not "" if + ## the option was given a value + + OptParserDifferently* = object of RootObj ## Implementation of the command line parser. + ## + ## To initialize it, use the + ## `initOptParser proc<#initOptParser,string,set[char],seq[string]>`_. + pos*: int + inShortState: bool + allowWhitespaceAfterColon: bool + shortNoVal: set[char] + longNoVal: seq[string] + cmds: seq[string] + idx: int + kind*: CmdLineKind ## The detected command line token + key*, val*: TaintedString ## Key and value pair; the key is the option + ## or the argument, and the value is not "" if + ## the option was given a value diff --git a/nimpretty/tests/expected/exhaustive.nim b/nimpretty/tests/expected/exhaustive.nim index 21ff505dd..4d0366afb 100644 --- a/nimpretty/tests/expected/exhaustive.nim +++ b/nimpretty/tests/expected/exhaustive.nim @@ -624,3 +624,42 @@ veryLongVariableName.createVar("future" & $node[1][0].toStrLit, node[1], veryLongVariableName.createVar("future" & $node[1][0].toStrLit, node[1], futureValue1, futureValue2, node) + +type + CmdLineKind* = enum ## The detected command line token. + cmdEnd, ## End of command line reached + cmdArgument, ## An argument such as a filename + cmdLongOption, ## A long option such as --option + cmdShortOption ## A short option such as -c + OptParser* = object of RootObj ## \ + ## Implementation of the command line parser. Here is even more text yad. + ## + ## To initialize it, use the + ## `initOptParser proc<#initOptParser,string,set[char],seq[string]>`_. + pos*: int + inShortState: bool + allowWhitespaceAfterColon: bool + shortNoVal: set[char] + longNoVal: seq[string] + cmds: seq[string] + idx: int + kind*: CmdLineKind ## The detected command line token + key*, val*: TaintedString ## Key and value pair; the key is the option + ## or the argument, and the value is not "" if + ## the option was given a value + + OptParserDifferently* = object of RootObj ## Implementation of the command line parser. + ## + ## To initialize it, use the + ## `initOptParser proc<#initOptParser,string,set[char],seq[string]>`_. + pos*: int + inShortState: bool + allowWhitespaceAfterColon: bool + shortNoVal: set[char] + longNoVal: seq[string] + cmds: seq[string] + idx: int + kind*: CmdLineKind ## The detected command line token + key*, val*: TaintedString ## Key and value pair; the key is the option + ## or the argument, and the value is not "" if + ## the option was given a value |