File: command1.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 (59 lines) | stat: -rw-r--r-- 1,523 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "command.ih"

    // by alternatives/alternatives1.cc (implicitly)

Command::Command()
:
    d_options(Options::instance()),
    d_action(FROM_HOME),
    d_parent(0),
    d_homedirChar(d_options.homedirChar())
{
    imsg << "\n"
            "Command\n";

    concatArgs();       // concatenate arguments, separating them by /
                        // characters

    determineAction();

                        // store the individual arguments in the base class
                        // (string vector)
    String::split(this, d_arguments, s_separators);

    // When are the elements of the first argument changed into initial chars
    // of directory elements?
    // 1. if there is only one command line argument
    // 2. if the first argument is not to be interpreted as a name by itself
    // 3. if there's only one argument
    // Can't 2 and 3 be combined to: size() == 1 ?
//    if (!subSpecs && size() && ArgConfig::instance().nArgs() == 1)

    splitBase();            // split the base class if it contains only
                            // one string.

    if (ArgConfig::instance().option('V'))
    {
        cerr << "Parent nr: " << d_parent << "\n"
                "Action: " << s_action[d_action] << "\n";
        if (empty())
            cerr << "No initial directory specifier(s)";
        else
        {
            cerr << "Initial characters of directories: ";
            copy(begin(), end(), ostream_iterator<string>(cerr, " "));
        }
        cerr << endl;
    }
}