Jaymon / captain

command line python scripts for humans
MIT License
13 stars 1 forks source link

bad merging of @arg and function names #7

Closed Jaymon closed 9 years ago

Jaymon commented 9 years ago

With a definition like this:

@arg("--recv-timeout", type=int, dest="recv_timeout")
@arg("--unsync-count", type=int, dest="max_unsync_count", default=5)
def main(max_count, recv_timeout, max_unsync_count=5):
    pass

and printing the help:

usage: foo.py [-h] [--max-count MAX_COUNT]
                     [--recv_timeout RECV_TIMEOUT]
                     [--max_unsync_count MAX_UNSYNC_COUNT]
                     [--unsync-count MAX_UNSYNC_COUNT] [--count MAX_COUNT]

optional arguments:
  -h, --help            show this help message and exit
  --max-count MAX_COUNT, --max_count MAX_COUNT
  --recv_timeout RECV_TIMEOUT, --recv-timeout RECV_TIMEOUT
                        wait time before reporting receive problem
  --max_unsync_count MAX_UNSYNC_COUNT, --max-unsync-count MAX_UNSYNC_COUNT
  --unsync-count MAX_UNSYNC_COUNT
                        how many unsync alerts before reporting
  --count MAX_COUNT     How many iterations before daemon dies```

You can see that count and max-count didn't get merged correctly, even though the others did :(