Add very old versions (for history).
[opsoft_archive.git] / silentbob / silentbob-1.4 / src / opts_funcs.cxx
blob4df8d0ea88723859c2c573b9b2603aa5bed4ecf3
1 /*
2 * (c) Oleg Puchinin 2006
3 * graycardinalster@gmail.com
5 */
7 #include "head.h"
8 #include "wit.h"
10 int opts_funcs (DArray * d_opts, int & i)
12 char * opt;
14 if (! d_opts)
15 return -1;
17 opt = d_opts->get (i);
19 if (EQ (opt, "--help") || EQ (opt, "-h")) {
20 usage ();
21 exit (0);
24 if (EQ (opt, "-V") || EQ (opt, "--version")) {
25 usage ();
26 exit (0);
29 if (EQ (opt, "--file")) {
30 ENV->sb_cmd = cmd_file;
31 return 0;
34 if (EQ (opt, "--the-tt")) {
35 ENV->sb_cmd = cmd_the_tt;
36 return 0;
39 if (EQ (opt, "--give-structs")) {
40 ENV->sb_cmd = cmd_give_structs;
41 return 0;
44 if (EQ (opt, "--indent")) {
45 ENV->sb_cmd = cmd_indent;
46 return 0;
49 if (EQ (opt, "--tags")) {
50 ENV->sb_cmd = cmd_tags;
51 return 0;
54 if (EQ (opt, "--make-ctags") ||
55 EQ (opt, "-c")) {
56 ENV->sb_cmd = cmd_makectags;
57 return 0;
60 if (EQ (opt, "--call-tags") ||
61 EQ (opt, "-ct")) {
62 SB_FLSET (SB_FLTAGSTYLE);
63 ENV->sb_cmd = cmd_call_tags;
64 return 0;
67 if (EQ (opt, "--cgrep")) {
68 if (++i >= d_opts->get_size ())
69 return 0;
71 ENV->sb_cmd = cmd_cgrep;
72 ENV->cgrep_exp = d_opts->get (i);
73 return 0;
76 if (EQ (opt, "--plugins-info")) {
77 mods_info ();
78 exit (0);
81 if (EQ (opt, "--tags")) {
82 ENV->sb_cmd = cmd_tags;
83 return 0;
86 if (EQ (opt, "--cfiles") ||
87 EQ (opt, "-f")) {
88 bob_cfiles ();
89 exit (0);
92 if (EQ (opt, "--time-test"))
93 Dtimer ();
95 return -1;