File: select.cc

package info (click to toggle)
xd 5.00.03-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 708 kB
  • sloc: cpp: 1,852; fortran: 161; makefile: 107; sh: 36; ansic: 30
file content (27 lines) | stat: -rw-r--r-- 680 bytes parent folder | download
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
#include "selector.ih"

    // by ./main.cc

void Selector::select()
{
    if (d_direct)
        chdir();
    else
    {
        switch (d_alternatives.size())
        {
            case 0:                     // no alternatives, throw avoids
            throw static_cast<int>(NO_SOLUTIONS);   // updating the history
    
            case 1:                     // one alternative: do the cd
                imsg << endl;
                d_index = 0;
                chdir();
            break;
    
            default:                    // otherwise: show all alternatives
                showAlternatives();     // show the alternatives
            break;
        }
    }
}