Is there a way to pass \t as "tab separator" as on option value (e.g. to set it 
as separator for a csv output), or the only way is to check against raw string, 
like this:

> 
>     import std/parseopt, std/strutils
>     var
>       sep: string
>       p = initOptParser()
>     while true:
>       p.next()
>       case p.kind
>       of cmdEnd, cmdArgument: break
>       of cmdShortOption, cmdLongOption:
>         continue
>     let strseq = ["just","a","test"]
>     # don't want just\ta\ttest output
>     if p.val == r"\t":
>       sep = "\t"
>     else:
>       sep = p.val
>     echo(strseq.join(sep))
>      
>     
>     Run

to achieve proper output?
    
    
     $ cmdtest --sep:\t
    just    a       test
    
    
    Run

Thank you

Reply via email to