Support format strings when dumping imported items

In commit 3eae7ce (Add --list-imported command line option, 2016-01-12),
we added an option to print the hashes of imported items to stdout.
Extend this command line option such that it dumps the items using the
specified formatting strings. With the new behavior it is, for example,
easier to check items for import errors.

Also, rename the option from --list-imported to --dump-imported (it is
not part of any official release yet so we do not need to care about
backwards compatibility).

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
Lukas Fleischer
2016-02-11 18:22:05 +01:00
parent fe0621bafd
commit 07954626c6
8 changed files with 85 additions and 65 deletions

View File

@@ -135,8 +135,10 @@ appointments can be specified using the *-c* flag.
*-l* <num>, *--limit* <num>::
Limit the number of results printed to 'num'.
*--list-imported*::
When importing items, print the hash of each newly created object to stdout.
*--dump-imported*::
When importing items, print each newly created object to stdout. Format
strings can be used to specify which details are printed. See also:
'Formatting Options'.
*-n*, *--next*::
Print the next appointment within upcoming 24 hours and exit. The indicated

View File

@@ -328,8 +328,10 @@ can be specified using the `-c` flag.
`-l <num>, --limit <num>`::
Limit the number of results printed to 'num'.
`--list-imported`::
When importing items, print the hash of each newly created object to stdout.
`--dump-imported`::
When importing items, print each newly created object to stdout. Format
strings can be used to specify which details are printed. See also:
<<basics_format_strings,Format strings>>.
`-n, --next`::
Print the next appointment within upcoming 24 hours and exit. The indicated