diff --git a/doc/common.m4 b/doc/common.m4 index 18f220097..51b02f38e 100644 --- a/doc/common.m4 +++ b/doc/common.m4 @@ -138,7 +138,7 @@ m4_define({{_reportingoptions_}}, {{ : multiperiod/multicolumn report by year `-p --period=PERIODEXP` -: set start date, end date, and/or reporting interval all at once using [period expressions](manual.html#period-expressions) syntax (overrides the flags above) +: set start date, end date, and/or reporting interval all at once using [period expressions](manual.html#period-expressions) syntax `--date2` : match the secondary date instead (see command help for other effects) diff --git a/hledger/Hledger/Cli/CliOptions.hs b/hledger/Hledger/Cli/CliOptions.hs index be9ada967..3d186c438 100644 --- a/hledger/Hledger/Cli/CliOptions.hs +++ b/hledger/Hledger/Cli/CliOptions.hs @@ -141,7 +141,7 @@ reportflags = [ ,flagNone ["monthly","M"] (setboolopt "monthly") "multiperiod/multicolumn report by month" ,flagNone ["quarterly","Q"] (setboolopt "quarterly") "multiperiod/multicolumn report by quarter" ,flagNone ["yearly","Y"] (setboolopt "yearly") "multiperiod/multicolumn report by year" - ,flagReq ["period","p"] (\s opts -> Right $ setopt "period" s opts) "PERIODEXP" "set start date, end date, and/or report interval all at once (overrides the flags above)" + ,flagReq ["period","p"] (\s opts -> Right $ setopt "period" s opts) "PERIODEXP" "set start date, end date, and/or report interval all at once" ,flagNone ["date2"] (setboolopt "date2") "match the secondary date instead. See command help for other effects. (--effective, --aux-date also accepted)" -- see also hiddenflags -- status/realness/depth/zero filters diff --git a/hledger/hledger_options.m4.md b/hledger/hledger_options.m4.md index 9bbc4fed6..e1c5801b5 100644 --- a/hledger/hledger_options.m4.md +++ b/hledger/hledger_options.m4.md @@ -234,8 +234,18 @@ You can specify a start and/or end date using [`-p/--period`](#period-expressions) or a [`date:` query](#queries) (described below). All of these accept the [smart date](#smart-dates) syntax. -One important thing to be aware of when specifying end dates: as in Ledger, end dates are exclusive, -so you need to write the date *after* the last day you want to include. + +Some notes: + +- As in Ledger, end dates are exclusive, so you need to write the date *after* + the last day you want to include. +- As noted in [reporting options](#general-options): + among start/end dates specified with *options*, the last (i.e. right-most) + option takes precedence. +- The effective report start and end dates are the intersection of the + start/end dates from options and that from `date:` queries. + That is, `date:2019-01 date:2019 -p'2000 to 2030'` yields January 2019, the + smallest common time span. Examples: @@ -258,7 +268,7 @@ reports into multiple subperiods. The basic intervals can be selected with one of `-D/--daily`, `-W/--weekly`, `-M/--monthly`, `-Q/--quarterly`, or `-Y/--yearly`. More complex intervals may be specified with a [period expression](#period-expressions). -Report intervals can not be specified with a [query](#queries), currently. +Report intervals can not be specified with a [query](#queries). ## Period expressions