Ticket #5 (closed enhancement: fixed)

Opened 3 years ago

Last modified 13 months ago

Support command-line arguments using getopt

Reported by: chris Owned by: zts
Priority: critical Milestone: eddie-0.36
Component: Core Version:
Keywords: Cc:

Description

Add command-line argument support using getopt.

Initially start with, at least:

-h --help : show usage

-v --verbose : enable verbose output

Change History

Changed 3 years ago by zts

  • owner set to zts
  • status changed from new to assigned

It might be worth using optparse rather than getopt, as it's a great deal more elegant. It was only added in 2.3, but was previously available as "optik" and works on 2.2+ - BSD-licensed, so I think we could redistribute it (it's quite compact).

Changed 3 years ago by chris

Agree with optparse (I'm sure that's what I meant to type originally as that's all I use now); and may as well continue to support 2.2.1 if it is little effort to do so.

Changed 3 years ago by zts

This has been done in rev @793 - needs testing under 2.2.x with Optik, I've verified correct behaviour on 2.3.

Changed 3 years ago by chris

It was failing for me with Py 2.3, because of reference to options.version. Have corrected this and parser.error() call which was failing too. Tested ok on Py 2.3 and 2.4. We'll need to verify on earlier versions. See [802].

Changed 13 months ago by chris

  • status changed from assigned to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.