Raphaël Droz [Thu, 13 Dec 2012 15:47:00 +0000 (16:47 +0100)]
ldif: support parsing from stdin
ldif parser used to seek in the file handler to grab multi-line
strings, thus creating buggy records when input was stdin.
It now reads-ahead the next line in order to work consistently with
unseekable streams like stdin.
Raphaël Droz [Thu, 13 Dec 2012 16:01:14 +0000 (17:01 +0100)]
ldif: cleanup ldif_convert()
* removed the "dirty hack" about LDIF_ITEM_FIELDS
* removed a useless free() causing segfaults
* don't process "objectclass" fields as we don't do anything about them
Raphaël Droz [Mon, 3 Dec 2012 13:28:58 +0000 (14:28 +0100)]
command-line containing --outformat is less-error prone.
Since --convert isn't mandatory anymore for --outformat to be used
(what was conflicting with --mutt-query), we removed the call to
set_convert_var() in 141acfcc.
We now need to test that one of MODE_CONVERT and MODE_QUERY is 'on'
before allowing the use of --outformat.
$ abook --outformat anyformat < file # won't hang anymore
Raphaël Droz [Tue, 6 Nov 2012 21:56:34 +0000 (22:56 +0100)]
vformat: vCard format can now be used in the context of --mutt-query
eg:
$ abook --mutt-query "Max" --outformat vcard
will only dump abook's entries matching "Max", using the vCard output format.
Raphaël Droz [Tue, 30 Aug 2011 14:27:44 +0000 (16:27 +0200)]
custom output format (3/4): added the --outformatstr option
* Allows the definition of a custom output format using placeholders.
* Registers the two functions: custom_export_database() and custom_print_item()
respectively for e_filters and u_filters.
--outformatstr only applies if --outformat=custom has been specified and
if we are querying the database (presence of the --mutt-query option)
If the first character of --outformatstr is a '!', then each entry
is checked before output: it will be full skipped if any of its fields
among those requested is NULL.
Raphaël Droz [Tue, 30 Aug 2011 14:20:39 +0000 (16:20 +0200)]
custom output format (2/4): item-based and the other database-based output functions
* custom_export_database() takes care of building a field_types pointer
from the format string by calling parse_custom_format().
* custom_export_item() output each entry according to the format string
itself + the associated *field_types.
The default value for custom_format is: "{nick} ({name}): {mobile}"
Raphaël Droz [Tue, 30 Aug 2011 09:53:36 +0000 (11:53 +0200)]
convert (1/1): introduced prototypes for per-item filtering functions.
Filtering and output on a per-entry basis rather than in a main-loop is
needed as soon as we want both query + formatting.
The abook_output_item_filter is aimed to store query-compatible output filters.
For most output formats generate a strict and standard-compliant output and won't
need this.
But the goal is the have a generic customizable format compatible with an
hypothetic --query switch.
As a future example, --mutt-query could be seen as:
--query --format="{email} {name}"
* Select items in the main view by clicking and scrolling
* Go to the edit-form by double-clicking
* Edit fields by clicking on them
* Select tabs by clicking on them
* Return to main view/quit abook by clicking on the first row
* parse_date_string(): don't modify string argument in place, since most
if not all of the time this function is applied on a database entry.
Too prone to dangerous oversight.
* fixed bsdcal export not checking for validity of parsed date.
Cedric Duval [Sat, 5 Aug 2006 12:25:46 +0000 (12:25 +0000)]
* Added a string as translatable (reported by C. Stazzone).
* Updated translation files.
* Added translations for said string for de, fr, it, and sv
(checking with translators that it is ok).
* Really changed pointer for reporting strings bugs.
Cedric Duval [Tue, 25 Oct 2005 23:27:24 +0000 (23:27 +0000)]
Support for dynamic views.
* Two new configuration commands: 'field' and 'view'.
* A new configuration variable: 'preserve_fields'.
* In absence of user configuration, abook behaves and displays mostly like
previous releases.
* More abstraction for database access. db_field_get(), db_field_put(), etc.
* Functions for handling lists of strings (abook_list)
* Functions for conversting abook_lists to CSV and vice-versa.
* Arbitrary number of email addresses internally. Still limited to 9 for
practical reasons with the UI.
* Up to 35 fields per view.
* Escape as a modifier key in the editor.
* Addresses can be rolled both directions (esc-r).
* Fixed html produced by export filter.
* Updated abookrc man page and sample.abookrc accordingly.