2 * (c) Oleg Puchinin 2006,2007
3 * graycardinalster@gmail.com
9 int opts_settings (DArray
* d_opts
, int & i
)
16 argc
= d_opts
->get_size ();
18 if (d_opts
->get (i
)[0] != '-') {
19 ENV
->d_files
->add (strdup (d_opts
->get (i
)));
23 if (EQ (d_opts
->get (i
), "--verbose")) {
24 SB_FLSET (SB_FLVERBOSE
);
28 if (EQ (d_opts
->get (i
), "-u")) {
29 SB_FLSET (SB_FLRTREE
);
33 if (EQ (d_opts
->get (i
), "--linear") ||
34 EQ (d_opts
->get (i
), "-l")) {
35 SB_FLSET (SB_FLLINEAR
);
39 if (EQ (d_opts
->get (i
), "-C") && i
< argc
) {
41 chdir (d_opts
->get (i
));
45 if (EQ (d_opts
->get (i
), "--linux")) {
46 chdir ("/usr/src/linux");
50 if (EQ (d_opts
->get (i
), "--debug")) {
51 SB_FLSET (SB_FLDEBUG
);
55 if (EQ (d_opts
->get (i
), "--simulate")) {
57 SB_FLSET (SB_FLSIMULATE
);
61 if (EQ (d_opts
->get (i
), "--no-links")) {
62 SB_FLSET (SB_FLNOLINKS
);
66 if (EQ (d_opts
->get (i
), "-a") || EQ (d_opts
->get (i
), "--all")) {
71 if (EQ (d_opts
->get (i
), "--test") || EQ (d_opts
->get (i
), "-t")) {
76 if (EQ (d_opts
->get (i
), "--ctags-append")) {
77 SB_FLSET (SB_FLCTAGSAPPEND
);
81 if (EQ (d_opts
->get (i
), "-A")) {
85 ENV
->cgrep_A
= atoi (d_opts
->get (i
));
89 if (EQ (d_opts
->get (i
), "-B")) {
93 ENV
->cgrep_B
= atoi (d_opts
->get (i
));
97 if (EQ (d_opts
->get (i
), "-j")) {
100 ENV
->max_proc
= atoi (d_opts
->get (i
));
104 if (EQ (d_opts
->get (i
), "--tag-style") || EQ (d_opts
->get (i
), "-ts")) {
105 SB_FLSET (SB_FLTAGSTYLE
);
109 if (EQ (d_opts
->get (i
), "-L") && (i
+1) < argc
) {
111 ENV
->d_files
->from_file (d_opts
->get (i
));
112 ENV
->d_files
->foreach ((Dfunc_t
) chomp
);
116 if (EQ (d_opts
->get (i
), "--depth")) {
120 ENV
->d_depth
= atoi (d_opts
->get (i
));
124 if (EQ (d_opts
->get (i
), "-fn")) {
125 SB_FLSET (SB_FLFNAMES
);
129 if (EQ (d_opts
->get (i
), "--lang")) {
133 ENV
->language
= strdup (d_opts
->get (i
));
134 if (EQ (ENV
->language
, "cpp") ||
135 EQ (ENV
->language
, "cxx") ||
136 EQ (ENV
->language
, "c++")) {
137 delete ENV
->language
;
138 ENV
->language
= strdup ("C++");
144 if (EQ (d_opts
->get (i
), "--thread")) {
145 SB_FLSET (SB_FLTHREAD
);