Optional 'format' option added to '-x' flag, help updated

This commit is contained in:
Frederic Culot 2008-08-11 18:08:45 +00:00
parent 1674800d5f
commit d84bb63e93
13 changed files with 217 additions and 113 deletions

View File

@ -1,3 +1,17 @@
2008-08-11 Frederic Culot <frederic@culot.org>
* src/utils.c (date_sec2ical_*): functions replaced by
date_sec2date_fmt()
* src/args.c (parse_args, usage, help_arg): option added to '-x'
flag to choose export format
* src/help.c (help_screen): help text updated with pcal export
* src/calcurse.1: manpage updated
* doc/manual_*.html: manuals updated
2008-08-10 Frederic Culot <frederic@culot.org> 2008-08-10 Frederic Culot <frederic@culot.org>
* src/calcurse.c: new menu added presenting export format * src/calcurse.c: new menu added presenting export format

View File

@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- <!--
/* /*
* $calcurse: manual_de.html,v 1.18 2008/08/08 14:22:19 culot Exp $ * $calcurse: manual_de.html,v 1.19 2008/08/11 18:08:45 culot Exp $
* *
* Calcurse - text-based organizer * Calcurse - text-based organizer
* Copyright (c) 2004-2008 Frederic Culot * Copyright (c) 2004-2008 Frederic Culot
@ -112,6 +112,7 @@ well as the way one can contribute to <code>calcurse</code> development.
<li><a href="#links_homepage">9.1 <code>calcurse</code> Internetseite</a></li> <li><a href="#links_homepage">9.1 <code>calcurse</code> Internetseite</a></li>
<li><a href="#links_list">9.2 <code>calcurse</code> Ank&uuml;ndigungsliste</a></li> <li><a href="#links_list">9.2 <code>calcurse</code> Ank&uuml;ndigungsliste</a></li>
<li><a href="#links_rss">9.3 <code>calcurse</code> RSS</a></li> <li><a href="#links_rss">9.3 <code>calcurse</code> RSS</a></li>
<li><a href="#links_others"><div class="todo">9.4 Other links</div></a></li>
</ul></li> </ul></li>
<li><a href="#thanks">10. Danksagungen</a></li> <li><a href="#thanks">10. Danksagungen</a></li>
</ul> </ul>
@ -332,13 +333,18 @@ Es werden sowohl kurze als auch lange Optionsangaben unterst&uuml;tzt.</p>
<dt><code>-v, --version</code></dt> <dt><code>-v, --version</code></dt>
<dd>Gibt die aktuelle Version von Calcurse aus. <dd>Gibt die aktuelle Version von Calcurse aus.
</dd> </dd>
<dt><code>-x, --export</code></dt> <dt><code>-x[format], --export[=format]</code></dt>
<dd>Exportiert Benutzerdaten in das iCalendar-Format. Ereignisse, <dd><div class="todo">
Termine und Aufgaben werden konvertiert und nach stdout Export user data to specified format. Events, appointments and
ausgegeben. todos are converted and echoed to stdout.
Two possible formats are available: ical and pcal
(see section <a href="#links_others">Links</a> below).
If the optional argument <code>format</code> is not given,
ical format is selected by default.
</div>
<p class="rq"><span class="valorise">Beachte:</span> <p class="rq"><span class="valorise">Beachte:</span>
leiten Sie die Ausgabe in eine Datei, etwa wie im folgenden Beispiel: leiten Sie die Ausgabe in eine Datei, etwa wie im folgenden Beispiel:
<code>$ calcurse --export > my_data.ics</code></p> <code>$ calcurse --export > my_data.dat</code></p>
</dd> </dd>
</dl> </dl>
@ -970,6 +976,16 @@ Um sich in die Liste einzutragen, schicken Sie einfach eine E-Mail mit dem Betre
der RSS-Feed aktualisiert und enth&auml;lt eine Beschreibung der neu der RSS-Feed aktualisiert und enth&auml;lt eine Beschreibung der neu
hinzugekommenen Programmfunktionen.</p> hinzugekommenen Programmfunktionen.</p>
<h2><div class="todo">9.4 Other links</div><a name="links_others"></a></h2>
<div class="todo">
<p>
You may want to look at the ical format specification (rfc2445) at:
<pre>http://tools.ietf.org/html/rfc2445</pre>
<p>
The pcal project page can be found at:
<pre>http://pcal.sourceforge.net/</pre>
</div>
<h1>10. Danksagungen<a name="thanks"></a></h1> <h1>10. Danksagungen<a name="thanks"></a></h1>
<p> <p>
Folgenden Leuten m&ouml;chte ich gerne f&uuml;r Ihre Unterst&uuml;tzung danken, ohne Folgenden Leuten m&ouml;chte ich gerne f&uuml;r Ihre Unterst&uuml;tzung danken, ohne
@ -1011,7 +1027,7 @@ Benutzer, die mir Ihr Feedback mitgeteilt haben.</p>
Copyright (c) 2004-2008 Fr&eacute;d&eacute;ric Culot<br> Copyright (c) 2004-2008 Fr&eacute;d&eacute;ric Culot<br>
German translation by Michael Schulz German translation by Michael Schulz
<code>&lt;bloodshower .at. web .dot. de&gt;</code>, and Chris.<br> <code>&lt;bloodshower .at. web .dot. de&gt;</code>, and Chris.<br>
Calcurse version 2.2 - Last change: August 8, 2008<br> Calcurse version 2.2 - Last change: August 11, 2008<br>
</div> </div>
</div> </div>

View File

@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- <!--
/* /*
* $calcurse: manual_en.html,v 1.18 2008/08/08 14:22:19 culot Exp $ * $calcurse: manual_en.html,v 1.19 2008/08/11 18:08:45 culot Exp $
* *
* Calcurse - text-based organizer * Calcurse - text-based organizer
* Copyright (c) 2004-2008 Frederic Culot * Copyright (c) 2004-2008 Frederic Culot
@ -109,6 +109,7 @@ well as the way one can contribute to <code>calcurse</code> development.
<li><a href="#links_homepage">9.1 <code>calcurse</code> homepage</a></li> <li><a href="#links_homepage">9.1 <code>calcurse</code> homepage</a></li>
<li><a href="#links_list">9.2 <code>calcurse</code> announce list</a></li> <li><a href="#links_list">9.2 <code>calcurse</code> announce list</a></li>
<li><a href="#links_rss">9.3 <code>calcurse</code> RSS feed</a></li> <li><a href="#links_rss">9.3 <code>calcurse</code> RSS feed</a></li>
<li><a href="#links_others">9.4 Other links</a></li>
</ul></li> </ul></li>
<li><a href="#thanks">10. Thanks</a></li> <li><a href="#thanks">10. Thanks</a></li>
</ul> </ul>
@ -336,14 +337,18 @@ All of the commands are documented within an online help system.
<dd> <dd>
Display <code>calcurse</code> version and exit. Display <code>calcurse</code> version and exit.
</dd> </dd>
<dt><code>-x, --export</code></dt> <dt><code>-x[format], --export[=format]</code></dt>
<dd> <dd>
Export user data to iCalendar format. Events, appointments and Export user data to specified format. Events, appointments and
todos are converted and echoed to stdout. todos are converted and echoed to stdout.
Two possible formats are available: ical and pcal
(see section <a href="#links_others">Links</a> below).
If the optional argument <code>format</code> is not given,
ical format is selected by default.
<p class="rq"><span class="valorise">Note:</span> <p class="rq"><span class="valorise">Note:</span>
redirect standard output to export data to a file, redirect standard output to export data to a file,
by issuing a command such as: by issuing a command such as:
<code>$ calcurse --export &gt; my_data.ics</code></p> <code>$ calcurse --export &gt; my_data.dat</code></p>
</dd> </dd>
</dl> </dl>
@ -1005,6 +1010,14 @@ msgid ""
This RSS feed is updated each time a new version of calcurse is This RSS feed is updated each time a new version of calcurse is
available, describing newly added features.</p> available, describing newly added features.</p>
<h2>9.4 Other links<a name="links_others"></a></h2>
<p>
You may want to look at the ical format specification (rfc2445) at:
<pre>http://tools.ietf.org/html/rfc2445</pre>
<p>
The pcal project page can be found at:
<pre>http://pcal.sourceforge.net/</pre>
<h1>10. Thanks<a name="thanks"></a></h1> <h1>10. Thanks<a name="thanks"></a></h1>
<p> <p>
Its time now to thank other people without whom this program Its time now to thank other people without whom this program
@ -1052,7 +1065,7 @@ msgid ""
<div class="footer"> <div class="footer">
Copyright (c) 2004-2008 Fr&eacute;d&eacute;ric Culot<br> Copyright (c) 2004-2008 Fr&eacute;d&eacute;ric Culot<br>
Calcurse version 2.2 - Last change: August 8, 2008<br> Calcurse version 2.2 - Last change: August 11, 2008<br>
</div> </div>
</div> </div>

View File

@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- <!--
/* /*
* $calcurse: manual_es.html,v 1.15 2008/08/08 14:22:19 culot Exp $ * $calcurse: manual_es.html,v 1.16 2008/08/11 18:08:45 culot Exp $
* *
* Calcurse - text-based organizer * Calcurse - text-based organizer
* Copyright (c) 2004-2008 Frederic Culot * Copyright (c) 2004-2008 Frederic Culot
@ -112,6 +112,7 @@ well as the way one can contribute to <code>calcurse</code> development.
<li><a href="#links_homepage">9.1 Pagina web de <code>calcurse</code></a></li> <li><a href="#links_homepage">9.1 Pagina web de <code>calcurse</code></a></li>
<li><a href="#links_list">9.2 Lista de anuncios de <code>calcurse</code></a></li> <li><a href="#links_list">9.2 Lista de anuncios de <code>calcurse</code></a></li>
<li><a href="#links_rss">9.3 <code>calcurse</code> RSS feed</a></li> <li><a href="#links_rss">9.3 <code>calcurse</code> RSS feed</a></li>
<li><a href="#links_others"><div class="todo">9.4 Other links</div></a></li>
</ul></li> </ul></li>
<li><a href="#thanks">10. Gracias a ...</a></li> <li><a href="#thanks">10. Gracias a ...</a></li>
</ul> </ul>
@ -340,14 +341,20 @@ well as the way one can contribute to <code>calcurse</code> development.
<dd> <dd>
Muestra la versión de <code>calcurse</code> y sale. Muestra la versión de <code>calcurse</code> y sale.
</dd> </dd>
<dt><code>-x, --export</code></dt> <dt><code>-x[format], --export[=format]</code></dt>
<dd> <dd>
Exporta los datos del usuario a un formato iCalendar. Citas, eventos y tareas pendientes son convertidos y <div class="todo">
mostrados en patalla. Export user data to specified format. Events, appointments and
todos are converted and echoed to stdout.
Two possible formats are available: ical and pcal
(see section <a href="#links_others">Links</a> below).
If the optional argument <code>format</code> is not given,
ical format is selected by default.
</div>
<p class="rq"><span class="valorise">Nota:</span> <p class="rq"><span class="valorise">Nota:</span>
redirecciona la salida standard para exportar los datos a un archivo usando redirecciona la salida standard para exportar los datos a un archivo usando
un comando como este: un comando como este:
<code>$ calcurse --export > my_data.ics</code></p> <code>$ calcurse --export > my_data.dat</code></p>
</dd> </dd>
</dl> </dl>
@ -985,6 +992,16 @@ msgid ""
Este RSS feed es actualizado cada vez que hay una nueva version de Calcurse disponible Este RSS feed es actualizado cada vez que hay una nueva version de Calcurse disponible
describiendo las nuevas caracteristicas.</p> describiendo las nuevas caracteristicas.</p>
<h2><div class="todo">9.4 Other links</div><a name="links_others"></a></h2>
<div class="todo">
<p>
You may want to look at the ical format specification (rfc2445) at:
<pre>http://tools.ietf.org/html/rfc2445</pre>
<p>
The pcal project page can be found at:
<pre>http://pcal.sourceforge.net/</pre>
</div>
<h1>10. Gracias a ...<a name="thanks"></a></h1> <h1>10. Gracias a ...<a name="thanks"></a></h1>
<p> <p>
Es la hora de dar las gracias a personas sin las que este programa Es la hora de dar las gracias a personas sin las que este programa
@ -1028,7 +1045,7 @@ msgid ""
Copyright (c) 2004-2008 Fr&eacute;d&eacute;ric Culot<br> Copyright (c) 2004-2008 Fr&eacute;d&eacute;ric Culot<br>
Traducido al Español por José López Traducido al Español por José López
<code>&lt;testinground .at. gmail .dot. com&gt;</code><br> <code>&lt;testinground .at. gmail .dot. com&gt;</code><br>
Calcurse version 2.2 - Last change: August 8, 2008<br> Calcurse version 2.2 - Last change: August 11, 2008<br>
</div> </div>
</div> </div>

View File

@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- <!--
/* /*
* $calcurse: manual_fr.html,v 1.19 2008/08/08 14:22:19 culot Exp $ * $calcurse: manual_fr.html,v 1.20 2008/08/11 18:08:45 culot Exp $
* *
* Calcurse - text-based organizer * Calcurse - text-based organizer
* Copyright (c) 2004-2008 Frederic Culot * Copyright (c) 2004-2008 Frederic Culot
@ -112,6 +112,7 @@ pour faire remonter les bogues et pour contribuer au d
<li><a href="#links_homepage">9.1 Site internet de <code>calcurse</code></a></li> <li><a href="#links_homepage">9.1 Site internet de <code>calcurse</code></a></li>
<li><a href="#links_list">9.2 Liste de diffusion de <code>calcurse</code></a></li> <li><a href="#links_list">9.2 Liste de diffusion de <code>calcurse</code></a></li>
<li><a href="#links_rss">9.3 Flux RSS</a></li> <li><a href="#links_rss">9.3 Flux RSS</a></li>
<li><a href="#links_others">9.4 Autres liens</a></li>
</ul></li> </ul></li>
<li><a href="#thanks">10. Remerciements</a></li> <li><a href="#thanks">10. Remerciements</a></li>
</ul> </ul>
@ -373,16 +374,20 @@ disponibles.
<dd> <dd>
Affiche la version de <code>calcurse</code>, puis quitte. Affiche la version de <code>calcurse</code>, puis quitte.
</dd> </dd>
<dt><code>-x, --export</code></dt> <dt><code>-x[format], --export[=format]</code></dt>
<dd> <dd>
Exporte les données utilisateur au format iCalendar. Les évènements, Exporte les données utilisateur au format spécifié. Les évènements,
rendez-vous et tâches sont convertis et imprimés sur la sortie rendez-vous et tâches sont convertis et imprimés sur la sortie
standard. standard. Deux formats d'export différents sont disponibles :
le format ical et le format pcal (voir la section
<a href="#links_others">Liens</a> ci-dessous).
Si l'argument optionnel <code>format</code> n'est pas indiqué par
l'utilisateur, alors le format ical sera utilisé par défaut.
<p class="rq"><span class="valorise">Note:</span> <p class="rq"><span class="valorise">Note:</span>
afin de sauvegarder les données exportées dans un fichier, afin de sauvegarder les données exportées dans un fichier,
il est nécessaire de rediriger la sortie standard en utilisant une il est nécessaire de rediriger la sortie standard en utilisant une
commande comme celle-ci: commande comme celle-ci:
<code>$ calcurse --export &gt; mon_fichier.ics</code></p> <code>$ calcurse --export &gt; mon_fichier.dat</code></p>
</dd> </dd>
</dl> </dl>
@ -1144,6 +1149,15 @@ msgid ""
<code>calcurse</code> est diffusée, et indique quelles sont les <code>calcurse</code> est diffusée, et indique quelles sont les
modifications qui ont été apportées.</p> modifications qui ont été apportées.</p>
<h2>9.4 Autres liens<a name="links_others"></a></h2>
<p>
La spécification du format ical (rfc2445) peut être trouvée à l'adresse
suivante :
<pre>http://tools.ietf.org/html/rfc2445</pre>
<p>
La page du projet pcal se trouve quant à elle à l'adresse suivante :
<pre>http://pcal.sourceforge.net/</pre>
<h1>10. Remerciements<a name="thanks"></a></h1> <h1>10. Remerciements<a name="thanks"></a></h1>
<p> <p>
Je voudrais remercier ici toutes les personnes sans qui ce projet Je voudrais remercier ici toutes les personnes sans qui ce projet
@ -1197,7 +1211,7 @@ msgid ""
<div class="footer"> <div class="footer">
Copyright (c) 2004-2008 Frédéric Culot<br> Copyright (c) 2004-2008 Frédéric Culot<br>
Calcurse version 2.2 - Dernière modification: 8 Aout 2008<br> Calcurse version 2.2 - Dernière modification: 11 Aout 2008<br>
</div> </div>
</div> </div>

View File

@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- <!--
/* /*
* $calcurse: manual_it.html,v 1.4 2008/08/08 14:22:19 culot Exp $ * $calcurse: manual_it.html,v 1.5 2008/08/11 18:08:45 culot Exp $
* *
* Calcurse - text-based organizer * Calcurse - text-based organizer
* Copyright (c) 2004-2008 Frederic Culot * Copyright (c) 2004-2008 Frederic Culot
@ -114,6 +114,7 @@ partecipare allo sviluppo di calcurse.
<li><a href="#links_homepage">9.1 Homepage di <code>calcurse</code></a></li> <li><a href="#links_homepage">9.1 Homepage di <code>calcurse</code></a></li>
<li><a href="#links_list">9.2 Lista degli annunci di <code>calcurse</code></a></li> <li><a href="#links_list">9.2 Lista degli annunci di <code>calcurse</code></a></li>
<li><a href="#links_rss">9.3 Feed RSS di <code>calcurse</code></a></li> <li><a href="#links_rss">9.3 Feed RSS di <code>calcurse</code></a></li>
<li><a href="#links_others"><div class="todo">9.4 Other links</div></a></li>
</ul></li> </ul></li>
<li><a href="#thanks">10. Ringraziamenti</a></li> <li><a href="#thanks">10. Ringraziamenti</a></li>
</ul> </ul>
@ -375,16 +376,19 @@ caratteristiche<a name="overview_features"></a></h2>
<dd> <dd>
Stampa la versione di <code>calcurse</code> ed esce. Stampa la versione di <code>calcurse</code> ed esce.
</dd> </dd>
<dt><code>-x, --export</code></dt> <dt><code>-x[format], --export[=format]</code></dt>
<dd> <dd><div class="todo">
Esporta tutti i dati nel formato di iCalendar; gli eventi, gli Export user data to specified format. Events, appointments and
appuntamenti e le attività sono convertiti e stampati sullo todos are converted and echoed to stdout.
standard output. Two possible formats are available: ical and pcal
(see section <a href="#links_others">Links</a> below).
If the optional argument <code>format</code> is not given,
ical format is selected by default.
</div>
<p class="rq"><span class="valorise">Nota:</span> è possibile <p class="rq"><span class="valorise">Nota:</span> è possibile
reindirizzare lo standard output per salvare i dati su un file reindirizzare lo standard output per salvare i dati su un file
con un comando del tipo con un comando del tipo
<code>$ calcurse --export &gt; my_data.ics</code></p> <code>$ calcurse --export &gt; my_data.dat</code></p>
</dd> </dd>
</dl> </dl>
@ -1182,6 +1186,16 @@ d'ambiente<a name="basics_invocation_environment"></a></h3>
versione con la descrizione delle funzionalità aggiunte. versione con la descrizione delle funzionalità aggiunte.
</p> </p>
<h2><div class="todo">9.4 Other links</div><a name="links_others"></a></h2>
<div class="todo">
<p>
You may want to look at the ical format specification (rfc2445) at:
<pre>http://tools.ietf.org/html/rfc2445</pre>
<p>
The pcal project page can be found at:
<pre>http://pcal.sourceforge.net/</pre>
</div>
<h1>10. Ringraziamenti<a name="thanks"></a></h1> <h1>10. Ringraziamenti<a name="thanks"></a></h1>
<p> <p>
&Egrave; giunto il momento per ringraziare le persone senza le quali &Egrave; giunto il momento per ringraziare le persone senza le quali
@ -1273,7 +1287,7 @@ d'ambiente<a name="basics_invocation_environment"></a></h3>
<div class="footer"> <div class="footer">
Copyright (c) 2004-2008 Fr&eacute;d&eacute;ric Culot<br> Copyright (c) 2004-2008 Fr&eacute;d&eacute;ric Culot<br>
Calcurse version 2.2 - Last change: August 8, 2008<br> Calcurse version 2.2 - Last change: August 11, 2008<br>
</div> </div>
</div> </div>

View File

@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//NL"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//NL">
<!-- <!--
/* /*
* $calcurse: manual_nl.html,v 1.10 2008/08/08 14:22:19 culot Exp $ * $calcurse: manual_nl.html,v 1.11 2008/08/11 18:08:45 culot Exp $
* *
* Calcurse - text-based organizer * Calcurse - text-based organizer
* Copyright (c) 2004-2008 Frederic Culot * Copyright (c) 2004-2008 Frederic Culot
@ -110,6 +110,7 @@ besproken. Als laatste wordt zowel de procedure van het melden van fouten in
<li><a href="#links_homepage">9.1 <code>Calcurse</code> homepage</a></li> <li><a href="#links_homepage">9.1 <code>Calcurse</code> homepage</a></li>
<li><a href="#links_list">9.2 <code>Calcurse</code> nieuws lijst</a></li> <li><a href="#links_list">9.2 <code>Calcurse</code> nieuws lijst</a></li>
<li><a href="#links_rss">9.3 <code>Calcurse</code> RSS feed</a></li> <li><a href="#links_rss">9.3 <code>Calcurse</code> RSS feed</a></li>
<li><a href="#links_others"><div class="todo">9.4 Other links</div></a></li>
</ul></li> </ul></li>
<li><a href="#thanks">10. Dankwoord</a></li> <li><a href="#thanks">10. Dankwoord</a></li>
</ul> </ul>
@ -342,15 +343,19 @@ besproken. Als laatste wordt zowel de procedure van het melden van fouten in
Geeft het versienummer van <code>calcurse</code> weer en verlaat het Geeft het versienummer van <code>calcurse</code> weer en verlaat het
programma. programma.
</dd> </dd>
<dt><code>-x, --export</code></dt> <dt><code>-x[format], --export[=format]</code></dt>
<dd> <dd><div class="todo">
Exporteert de data van de gebruiker naar het iCalender-formaat. Export user data to specified format. Events, appointments and
Gebeurtenissen, afspraken en taken worden geconverteerd en naar stdout todos are converted and echoed to stdout.
gezonden. Two possible formats are available: ical and pcal
(see section <a href="#links_others">Links</a> below).
If the optional argument <code>format</code> is not given,
ical format is selected by default.
</div>
<p class="rq"><span class="valorise">Noot:</span> <p class="rq"><span class="valorise">Noot:</span>
Om de data te exporteren naar een bestand, kan men de Om de data te exporteren naar een bestand, kan men de
standaard output omleiden met een commando zoals: standaard output omleiden met een commando zoals:
<code>$ calcurse --export > my_data.ics</code></p> <code>$ calcurse --export > my_data.dat</code></p>
</dd> </dd>
</dl> </dl>
@ -998,6 +1003,16 @@ msgid ""
calcurse beschikbaar is, waarbij ook de nieuwe opties beschreven calcurse beschikbaar is, waarbij ook de nieuwe opties beschreven
worden. </p> worden. </p>
<h2><div class="todo">9.4 Other links</div><a name="links_others"></a></h2>
<div class="todo">
<p>
You may want to look at the ical format specification (rfc2445) at:
<pre>http://tools.ietf.org/html/rfc2445</pre>
<p>
The pcal project page can be found at:
<pre>http://pcal.sourceforge.net/</pre>
</div>
<h1>10. Dankwoord<a name="thanks"></a></h1> <h1>10. Dankwoord<a name="thanks"></a></h1>
<p> <p>
Het is tijd om de mensen te bedanken, zonder wie dit programma niet Het is tijd om de mensen te bedanken, zonder wie dit programma niet
@ -1052,7 +1067,7 @@ msgid ""
<div class="footer"> <div class="footer">
Copyright (c) 2004-2008 Fr&eacute;d&eacute;ric Culot<br> Copyright (c) 2004-2008 Fr&eacute;d&eacute;ric Culot<br>
Calcurse version 2.2 - Last change: August 8, 2008<br> Calcurse version 2.2 - Last change: August 11, 2008<br>
</div> </div>
</div> </div>

View File

@ -1,4 +1,4 @@
/* $calcurse: args.c,v 1.36 2008/08/10 09:24:46 culot Exp $ */ /* $calcurse: args.c,v 1.37 2008/08/11 18:08:45 culot Exp $ */
/* /*
* Calcurse - text-based organizer * Calcurse - text-based organizer
@ -48,7 +48,7 @@ static void
usage () usage ()
{ {
char *arg_usage = char *arg_usage =
_("Usage: calcurse [-h|-v] [-x] [-N] [-an] [-t[num]]\n" _("Usage: calcurse [-h|-v] [-N] [-an] [-t[num]] [-x[format]]\n"
" [-d <date>|<num>] [-s[date]] [-r[range]]\n" " [-d <date>|<num>] [-s[date]] [-r[range]]\n"
" [-c<file> | -D<dir>]\n"); " [-c<file> | -D<dir>]\n");
fputs (arg_usage, stdout); fputs (arg_usage, stdout);
@ -120,11 +120,14 @@ help_arg ()
" print todo list and exit. If the optional number [num] is given,\n" " print todo list and exit. If the optional number [num] is given,\n"
"\tthen only todos having a priority equal to [num] will be returned.\n" "\tthen only todos having a priority equal to [num] will be returned.\n"
"\tnote: priority number must be between 1 (highest) and 9 (lowest).\n" "\tnote: priority number must be between 1 (highest) and 9 (lowest).\n"
"\n -x, --export\n" "\n -x[format], --export[=format]\n"
" export user data to iCalendar format. Events, appointments and\n" " export user data to the specified format. Events, appointments and\n"
"\ttodos are converted and echoed to stdout.\n" "\ttodos are converted and echoed to stdout.\n"
"\tTwo possible formats are available: 'ical' and 'pcal'.\n"
"\tIf the optional argument format is not given, ical format is\n"
"\tselected by default.\n"
"\tnote: redirect standard output to export data to a file,\n" "\tnote: redirect standard output to export data to a file,\n"
"\tby issuing a command such as: calcurse --export > my_data.ics\n" "\tby issuing a command such as: calcurse --export > calcurse.dat\n"
"\nFor more information, type '?' from within Calcurse, " "\nFor more information, type '?' from within Calcurse, "
"or read the manpage.\n" "or read the manpage.\n"
"Mail bug reports and suggestions to <calcurse@culot.org>.\n"); "Mail bug reports and suggestions to <calcurse@culot.org>.\n");
@ -578,13 +581,13 @@ parse_args (int argc, char **argv, conf_t *conf)
int vflag = 0; /* -v: print version number */ int vflag = 0; /* -v: print version number */
int xflag = 0; /* -x: export data to iCalendar format */ int xflag = 0; /* -x: export data to iCalendar format */
int tnum = 0; int tnum = 0, xfmt = 0;
int non_interactive = 0, multiple_flag = 0, load_data = 0; int non_interactive = 0, multiple_flag = 0, load_data = 0;
int no_file = 1; int no_file = 1;
char *ddate = "", *cfile = NULL, *range = NULL, *startday = NULL; char *ddate = "", *cfile = NULL, *range = NULL, *startday = NULL;
char *datadir = NULL; char *datadir = NULL;
static char *optstr = "hvnNaxt::d:c:r:s:D:"; static char *optstr = "hvnNax::t::d:c:r:s:D:";
struct option longopts[] = { struct option longopts[] = {
{"appointment", no_argument, NULL, 'a'}, {"appointment", no_argument, NULL, 'a'},
@ -598,7 +601,7 @@ parse_args (int argc, char **argv, conf_t *conf)
{"startday", required_argument, NULL, 's'}, {"startday", required_argument, NULL, 's'},
{"todo", optional_argument, NULL, 't'}, {"todo", optional_argument, NULL, 't'},
{"version", no_argument, NULL, 'v'}, {"version", no_argument, NULL, 'v'},
{"export", no_argument, NULL, 'x'}, {"export", optional_argument, NULL, 'x'},
{NULL, no_argument, NULL, 0} {NULL, no_argument, NULL, 0}
}; };
@ -675,6 +678,25 @@ parse_args (int argc, char **argv, conf_t *conf)
xflag = 1; xflag = 1;
multiple_flag++; multiple_flag++;
load_data++; load_data++;
if (optarg != NULL)
{
if (strcmp (optarg, "ical") == 0)
xfmt = IO_EXPORT_ICAL;
else if (strcmp (optarg, "pcal") == 0)
xfmt = IO_EXPORT_PCAL;
else
{
fputs (_("Argumet for '-x' should be either "
"'ical' or 'pcal'\n"), stderr);
usage ();
usage_try ();
return EXIT_FAILURE;
}
}
else
{
xfmt = IO_EXPORT_ICAL;
}
break; break;
default: default:
usage (); usage ();
@ -731,7 +753,8 @@ parse_args (int argc, char **argv, conf_t *conf)
{ {
notify_init_vars (); notify_init_vars ();
custom_load_conf (conf, 0); custom_load_conf (conf, 0);
io_export_data (IO_EXPORT_NONINTERACTIVE, IO_EXPORT_ICAL, conf); io_load_todo ();
io_export_data (IO_EXPORT_NONINTERACTIVE, xfmt, conf);
non_interactive = 1; non_interactive = 1;
return (non_interactive); return (non_interactive);
} }

View File

@ -1,4 +1,4 @@
.\" $calcurse: calcurse.1,v 1.9 2008/08/08 14:22:19 culot Exp $ .\" $calcurse: calcurse.1,v 1.10 2008/08/11 18:08:45 culot Exp $
.\" .\"
.\" Copyright (c) 2004-2008 Frederic Culot .\" Copyright (c) 2004-2008 Frederic Culot
.\" .\"
@ -23,7 +23,8 @@
Calcurse \- text-based organizer Calcurse \- text-based organizer
.SH SYNOPSIS .SH SYNOPSIS
.B "calcurse " .B "calcurse "
[\fB-h\fP|\fB-v\fP] [\fB-x\fP] [\fB-N\fP] [\fB-an\fP] [\fB-t\fP[\fInum\fP]] [\fB-h\fP|\fB-v\fP] [\fB-N\fP] [\fB-an\fP] [\fB-t\fP[\fInum\fP]]
[\fB-x\fP[\fIformat\fP]]
.br .br
[\fB-d\fP <\fIdate\fP>|<\fInum\fP>] [\fB-s\fP[\fIdate\fP]] [\fB-d\fP <\fIdate\fP>|<\fInum\fP>] [\fB-s\fP[\fIdate\fP]]
[\fB-r\fP[\fIrange\fP]] [\fB-r\fP[\fIrange\fP]]
@ -110,14 +111,17 @@ then only todos having a priority equal to \fInum\fP will be returned.
\fB-v\fP, \fB--version\fP \fB-v\fP, \fB--version\fP
Display calcurse version and exit. Display calcurse version and exit.
.TP .TP
\fB-x\fP, \fB--export\fP \fB-x\fP[format], \fB--export\fP[=format]
Export user data to iCalendar format. Events, appointments and Export user data to the specified format. Events, appointments and
todos are converted and echoed to stdout. todos are converted and echoed to stdout. Two possible formats are
available: \fIical\fP and \fIpcal\fP.
If the optional argument format is not given, ical format is
selected by default.
.br .br
\fINote:\fP redirect standard output to export data to a file, \fINote:\fP redirect standard output to export data to a file,
by issuing a command such as: by issuing a command such as:
.br .br
.B $ calcurse --export > my_data.ics .B $ calcurse --export > calcurse.dat
.SH NOTES .SH NOTES
Calcurse interface contains three different panels (calendar, Calcurse interface contains three different panels (calendar,
appointment list, and todo list) on which you can perform different appointment list, and todo list) on which you can perform different
@ -193,7 +197,12 @@ author, below.
.SH SEE ALSO .SH SEE ALSO
vi(1), less(1), ncurses(3), mkstemp(3) vi(1), less(1), ncurses(3), mkstemp(3)
.br .br
Calcurse home page : http://culot.org/calcurse/ The ical specification (rfc2445) can be found at:
http://tools.ietf.org/html/rfc2445
.br
The pcal project page: http://pcal.sourceforge.net/
.br
Calcurse home page: http://culot.org/calcurse/
.br .br
Calcurse complete manual, translated in many languages and maintained in Calcurse complete manual, translated in many languages and maintained in
html format, can be found in the doc/ directory of the source package, html format, can be found in the doc/ directory of the source package,

View File

@ -1,4 +1,4 @@
/* $calcurse: help.c,v 1.27 2008/08/03 18:41:55 culot Exp $ */ /* $calcurse: help.c,v 1.28 2008/08/11 18:08:45 culot Exp $ */
/* /*
* Calcurse - text-based organizer * Calcurse - text-based organizer
@ -301,10 +301,16 @@ help_screen (void)
hscr[HELP_EXPORT].title = _("Export:\n"); hscr[HELP_EXPORT].title = _("Export:\n");
hscr[HELP_EXPORT].text = hscr[HELP_EXPORT].text =
_("Pressing 'X' exports the Calcurse data to iCalendar format.\n\n" _("Pressing 'X' leads to the export submenu, from which you can choose\n"
"between two different export formats: 'ical' and 'pcal'.\n"
"Choosing one of those formats lets you export the Calcurse data to\n"
"icalendar or pcal format.\n\n"
"You first need to specify the file to which the data will be exported.\n" "You first need to specify the file to which the data will be exported.\n"
"By default, this file is:\n\n" "By default, this file is:\n\n"
" ~/calcurse.ics\n\n" " ~/calcurse.ics\n\n"
"for an ical export, and:\n\n"
" ~/calcurse.txt\n\n"
"for a pcal export.\n"
"All of the calcurse data are exported, in the following order:\n" "All of the calcurse data are exported, in the following order:\n"
"events, appointments, todos.\n"); "events, appointments, todos.\n");

View File

@ -1,4 +1,4 @@
/* $calcurse: io.c,v 1.31 2008/08/10 09:24:46 culot Exp $ */ /* $calcurse: io.c,v 1.32 2008/08/11 18:08:45 culot Exp $ */
/* /*
* Calcurse - text-based organizer * Calcurse - text-based organizer
@ -40,6 +40,9 @@
#include "apoint.h" #include "apoint.h"
#include "io.h" #include "io.h"
#define ICALDATEFMT "%Y%m%d"
#define ICALDATETIMEFMT "%Y%m%dT%H%M%S"
typedef enum typedef enum
{ {
PROGRESS_BAR_SAVE, PROGRESS_BAR_SAVE,
@ -282,7 +285,7 @@ ical_export_recur_events (FILE *stream)
for (i = recur_elist; i != 0; i = i->next) for (i = recur_elist; i != 0; i = i->next)
{ {
date_sec2ical_date (i->day, ical_date); date_sec2date_fmt (i->day, ICALDATEFMT, ical_date);
fprintf (stream, "BEGIN:VEVENT\n"); fprintf (stream, "BEGIN:VEVENT\n");
fprintf (stream, "DTSTART:%s\n", ical_date); fprintf (stream, "DTSTART:%s\n", ical_date);
fprintf (stream, "RRULE:FREQ=%s;INTERVAL=%d", fprintf (stream, "RRULE:FREQ=%s;INTERVAL=%d",
@ -290,7 +293,7 @@ ical_export_recur_events (FILE *stream)
if (i->rpt->until != 0) if (i->rpt->until != 0)
{ {
date_sec2ical_date (i->rpt->until, ical_date); date_sec2date_fmt (i->rpt->until, ICALDATEFMT, ical_date);
fprintf (stream, ";UNTIL=%s\n", ical_date); fprintf (stream, ";UNTIL=%s\n", ical_date);
} }
else else
@ -298,11 +301,11 @@ ical_export_recur_events (FILE *stream)
if (i->exc != NULL) if (i->exc != NULL)
{ {
date_sec2ical_date (i->exc->st, ical_date); date_sec2date_fmt (i->exc->st, ICALDATEFMT, ical_date);
fprintf (stream, "EXDATE:%s", ical_date); fprintf (stream, "EXDATE:%s", ical_date);
for (day = i->exc->next; day; day = day->next) for (day = i->exc->next; day; day = day->next)
{ {
date_sec2ical_date (day->st, ical_date); date_sec2date_fmt (day->st, ICALDATEFMT, ical_date);
fprintf (stream, ",%s", ical_date); fprintf (stream, ",%s", ical_date);
} }
fprintf (stream, "\n"); fprintf (stream, "\n");
@ -403,7 +406,7 @@ ical_export_events (FILE *stream)
for (i = eventlist; i != 0; i = i->next) for (i = eventlist; i != 0; i = i->next)
{ {
date_sec2ical_date (i->day, ical_date); date_sec2date_fmt (i->day, ICALDATEFMT, ical_date);
fprintf (stream, "BEGIN:VEVENT\n"); fprintf (stream, "BEGIN:VEVENT\n");
fprintf (stream, "DTSTART:%s\n", ical_date); fprintf (stream, "DTSTART:%s\n", ical_date);
fprintf (stream, "SUMMARY:%s\n", i->mesg); fprintf (stream, "SUMMARY:%s\n", i->mesg);
@ -434,7 +437,7 @@ ical_export_recur_apoints (FILE *stream)
pthread_mutex_lock (&(recur_alist_p->mutex)); pthread_mutex_lock (&(recur_alist_p->mutex));
for (i = recur_alist_p->root; i != 0; i = i->next) for (i = recur_alist_p->root; i != 0; i = i->next)
{ {
date_sec2ical_datetime (i->start, ical_datetime); date_sec2date_fmt (i->start, ICALDATETIMEFMT, ical_datetime);
fprintf (stream, "BEGIN:VEVENT\n"); fprintf (stream, "BEGIN:VEVENT\n");
fprintf (stream, "DTSTART:%s\n", ical_datetime); fprintf (stream, "DTSTART:%s\n", ical_datetime);
fprintf (stream, "DURATION:P%ldS\n", i->dur); fprintf (stream, "DURATION:P%ldS\n", i->dur);
@ -443,7 +446,7 @@ ical_export_recur_apoints (FILE *stream)
if (i->rpt->until != 0) if (i->rpt->until != 0)
{ {
date_sec2ical_date (i->rpt->until + HOURINSEC, ical_date); date_sec2date_fmt (i->rpt->until + HOURINSEC, ICALDATEFMT, ical_date);
fprintf (stream, ";UNTIL=%s\n", ical_date); fprintf (stream, ";UNTIL=%s\n", ical_date);
} }
else else
@ -451,11 +454,11 @@ ical_export_recur_apoints (FILE *stream)
if (i->exc != NULL) if (i->exc != NULL)
{ {
date_sec2ical_date (i->exc->st, ical_date); date_sec2date_fmt (i->exc->st, ICALDATEFMT, ical_date);
fprintf (stream, "EXDATE:%s", ical_date); fprintf (stream, "EXDATE:%s", ical_date);
for (day = i->exc->next; day; day = day->next) for (day = i->exc->next; day; day = day->next)
{ {
date_sec2ical_date (day->st, ical_date); date_sec2date_fmt (day->st, ICALDATEFMT, ical_date);
fprintf (stream, ",%s", ical_date); fprintf (stream, ",%s", ical_date);
} }
fprintf (stream, "\n"); fprintf (stream, "\n");
@ -540,7 +543,7 @@ ical_export_apoints (FILE *stream)
pthread_mutex_lock (&(alist_p->mutex)); pthread_mutex_lock (&(alist_p->mutex));
for (i = alist_p->root; i != 0; i = i->next) for (i = alist_p->root; i != 0; i = i->next)
{ {
date_sec2ical_datetime (i->start, ical_datetime); date_sec2date_fmt (i->start, ICALDATETIMEFMT, ical_datetime);
fprintf (stream, "BEGIN:VEVENT\n"); fprintf (stream, "BEGIN:VEVENT\n");
fprintf (stream, "DTSTART:%s\n", ical_datetime); fprintf (stream, "DTSTART:%s\n", ical_datetime);
fprintf (stream, "DURATION:P%ldS\n", i->dur); fprintf (stream, "DURATION:P%ldS\n", i->dur);

View File

@ -1,4 +1,4 @@
/* $calcurse: utils.c,v 1.47 2008/08/10 09:24:46 culot Exp $ */ /* $calcurse: utils.c,v 1.48 2008/08/11 18:08:45 culot Exp $ */
/* /*
* Calcurse - text-based organizer * Calcurse - text-based organizer
@ -556,45 +556,7 @@ date_sec2date_str (long sec, char *datefmt)
return (datestr); return (datestr);
} }
/* /* Generic function to format date. */
* Return a string containing an iCal date, given a date in
* seconds. This is used to build all-day long iCal VEVENT
* (calcurse event equivalent).
*/
void
date_sec2ical_date (long sec, char *ical_date)
{
#define DATELENGTH 9
struct tm *lt;
time_t t;
t = sec;
lt = localtime (&t);
strftime (ical_date, DATELENGTH, "%Y%m%d", lt);
}
/*
* Return a string containing an iCal date-time, given a date in
* seconds. This is used to build iCal VEVENT (calcurse appointment equivalent).
*/
void
date_sec2ical_datetime (long sec, char *ical_datetime)
{
#define DATETIMELENGTH 16
struct tm *lt;
time_t t;
t = sec;
lt = localtime (&t);
strftime (ical_datetime, DATETIMELENGTH, "%Y%m%dT%H%M%S", lt);
}
/*
* At least a generic function to format date...
* I promise I will learn how to code someday.
*/
void void
date_sec2date_fmt (long sec, const char *fmt, char *datef) date_sec2date_fmt (long sec, const char *fmt, char *datef)
{ {

View File

@ -1,4 +1,4 @@
/* $calcurse: utils.h,v 1.31 2008/08/10 09:24:46 culot Exp $ */ /* $calcurse: utils.h,v 1.32 2008/08/11 18:08:45 culot Exp $ */
/* /*
* Calcurse - text-based organizer * Calcurse - text-based organizer
@ -89,8 +89,6 @@ void status_bar (void);
long date2sec (date_t, unsigned, unsigned); long date2sec (date_t, unsigned, unsigned);
char *date_sec2hour_str (long); char *date_sec2hour_str (long);
char *date_sec2date_str (long, char *); char *date_sec2date_str (long, char *);
void date_sec2ical_date (long, char *);
void date_sec2ical_datetime (long, char *);
void date_sec2date_fmt (long, const char *, char *); void date_sec2date_fmt (long, const char *, char *);
long date_sec_change (long, int, int); long date_sec_change (long, int, int);
long update_time_in_date (long, unsigned, unsigned); long update_time_in_date (long, unsigned, unsigned);