Accept --first/--last as synonyms for --head/--tail
This commit is contained in:
parent
275da22752
commit
b7f2a95c1f
2 changed files with 6 additions and 0 deletions
|
|
@ -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 && \
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue