Skip to content

braingram/qarg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

quick argument parsing

A simple concise way of defining arguments for an argparse.ArgumentParser

-- Syntax --


    comma seperated list of args

    args:
        <short name>(<long name>{<dest>[<type>=<default>@<action>#<nargs>$<const>

    all but short name are optional
    if long name is missing, short name will be used
    if long name is missing, and short name has len > 1
        long name will be short name and short name will be the
        first character of short name

examples:
    f(foo)[int]=10
    f[int]=10

supported add_argument options
    name or flags (short name & long name)
    action = '@'
    nargs = '#'
    const = '$'
    default = '='
    type = '['
    choices = not supported
    required = '!'
    help = not supported
    metavar = not supported
    dest = '{'

-- Example --

import qarg
ns = qarg.get('f(foo[int=1,r(bar,baz[str,p(pop@store_true')

About

Quick Argument Parsing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages