Skip to content

Any way to give negative number as argument ? #104

@Derf000

Description

@Derf000

Hi,
is there any way to set negative number as argument ?

# -*- coding: utf-8 -*-

from clize import ArgumentError, Parameter, run

def cli_main(arg:float, *, debug:'d'=False):
    """cli_main
    
    :param arg: arg parameter
    :param debug: debug flag
    """
    return (arg,debug)

if __name__ == '__main__' :
    run (cli_main)
    
>python cli.py --help
Usage: cli.py [OPTIONS] arg

cli_main

Arguments:
  arg           arg paramter (type: FLOAT)

Options:
  -d, --debug   debug flag

Other actions:
  -h, --help    Show the help

>python cli.py -10.0
cli.py: Unknown option '-1'
Usage: cli.py [OPTIONS] arg

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions