~ubuntu-branches/ubuntu/raring/lurker/raring

« back to all changes in this revision

Viewing changes to index/list.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Meurer
  • Date: 2006-12-20 05:05:31 UTC
  • mfrom: (3.1.6 feisty)
  • Revision ID: james.westby@ubuntu.com-20061220050531-79inzy7o6uu95qx7
Tags: 2.1-7
* updated vi debconf translations, thanks to Clytie Siddall
  <clytie@riverland.net.au>
* fixed typo in one template (that you would like, not that
  would you like), thanks as well to Clytie Siddall
  - unfuzzied all translations

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*  $Id: list.cpp,v 1.8 2004/08/27 15:04:05 terpstra Exp $
 
1
/*  $Id: list.cpp,v 1.13 2006/02/24 14:12:04 terpstra Exp $
2
2
 *  
3
3
 *  list.cpp - Parse the config file for helper scripts
4
4
 *  
22
22
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23
23
 */
24
24
 
25
 
#define _XOPEN_SOURCE 500
26
25
#define _FILE_OFFSET_BITS 64
27
26
 
28
27
#include <ConfigFile.h>
38
37
{
39
38
        cerr << "Lurker-list (v" << VERSION << ") parses lists from the config file.\n";
40
39
        cerr << "\n";
41
 
        cerr << "Usage: " << name << " -c <config-file> -f <locale>\n";
 
40
        cerr << "Usage: " << name << " [-c <config-file>] [-f <locale>]\n";
42
41
        cerr << "                         [-i -g -t -a -l -d -s -o] [listid ...]\n";
43
42
        cerr << "\n";
44
43
        cerr << "\t-c <config-file> Use this config file for lurker settings\n";
61
60
{
62
61
        int c;
63
62
        
64
 
        const char* config   = 0;
 
63
        const char* config   = DEFAULT_CONFIG_FILE;
65
64
        int         fields   = 0;
66
65
        bool        ids      = false;
67
66
        bool        group    = false;
121
120
                }
122
121
        }
123
122
        
124
 
        if (!config)
125
 
        {
126
 
                help(argv[0]);
127
 
                return 1;
128
 
        }
129
 
        
130
123
        if (fields >= 2)
131
124
        {
132
125
                cerr << "Please either retrieval all fields or exactly one.\n";
143
136
        vector<List> output;
144
137
        for (; optind < argc; ++optind)
145
138
        {
 
139
                if (!argv[optind][0]) continue; // ignore empty arguments
146
140
                Config::Lists::const_iterator l = cfg.lists.find(argv[optind]);
147
141
                if (l == cfg.lists.end())
148
142
                {
174
168
                if (!fields || address) cout << o->address         << "\n";
175
169
                if (!fields || link)    cout << o->link(lc)        << "\n";
176
170
                if (!fields || desc)    cout << o->description(lc) << "\n";
177
 
                if (!fields || language)cout << o->language        << "\n";
 
171
                if (!fields || language)
 
172
                {
 
173
                        set<string>::const_iterator i, e;
 
174
                        for (i = o->languages.begin(), e = o->languages.end(); i != e; )
 
175
                        {
 
176
                                cout << *i;
 
177
                                ++i;
 
178
                                if (i == e)     cout << "\n";
 
179
                                else            cout << ",";
 
180
                        }
 
181
                }
178
182
                if (!fields || offline) cout << (o->offline?"true\n":"false\n");
179
183
        }
180
184