File: main.cc

package info (click to toggle)
xd 3.29.00-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 516 kB
  • sloc: cpp: 1,414; makefile: 112; sh: 36
file content (38 lines) | stat: -rw-r--r-- 938 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "main.ih"               // program header file

int main(int argc, char **argv)
try
{
    arguments(argc, argv);

    Alternatives alternatives;
                                        // select viable alternatives
    if (alternatives.viable() == Alternatives::ONLY_CD)
        return 0;

    alternatives.order();               // history alternatives first or last

    Filter filter(alternatives);

    filter.select();                   // make the selection

    return filter.decided() ? 0 : 1;   // return 0 to the OS if the filter
                                        // did do its work
}
catch(exception const &err)     // handle exceptions
{
    cerr << err.what() << endl;
    cout << ".\n";          // to prevent a directory change
    return 1;
}
catch(int x)
{
    if (x == 0)
        cerr << "No Solutions\n";

    if (ArgConfig::instance().option("hv"))
        return 0;

    cout << ".\n";
    return x;
}