Accept --first/--last as synonyms for --head/--tail

This commit is contained in:
John Wiegley 2009-02-16 17:25:19 -04:00
parent 275da22752
commit b7f2a95c1f
2 changed files with 6 additions and 0 deletions

View file

@ -202,6 +202,10 @@ inline bool is_eq(const char * p, const char * n) {
if (is_eq(p, #name)) \
return ((name ## _handler).parent = this, &(name ## _handler))
#define OPT_ALT(name, alt) \
if (is_eq(p, #name) || is_eq(p, #alt)) \
return ((name ## _handler).parent = this, &(name ## _handler))
#define OPT_(name) \
if (! *(p + 1) || \
((name ## _handler).wants_arg && \

View file

@ -405,6 +405,7 @@ option_t<report_t> * report_t::lookup_option(const char * p)
case 'f':
OPT(forecast_);
else OPT(format_);
else OPT_ALT(head_, first_);
break;
case 'g':
OPT_CH(performance);
@ -425,6 +426,7 @@ option_t<report_t> * report_t::lookup_option(const char * p)
else OPT(lot_prices);
else OPT(lot_tags);
else OPT(lots);
else OPT_ALT(tail_, last_);
break;
case 'm':
OPT(market);