File: cmdline.c

package info (click to toggle)
dico 2.9-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 16,908 kB
  • sloc: ansic: 85,886; sh: 50,207; lex: 2,624; yacc: 1,437; tcl: 1,434; python: 1,281; makefile: 1,266; perl: 881; lisp: 489; awk: 157; pascal: 125; cpp: 44; fortran: 25; asm: 19; sed: 16; xml: 8
file content (1013 lines) | stat: -rw-r--r-- 16,191 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
#line 539 "../grecs/build-aux/getopt.m4"
/* -*- buffer-read-only: t -*- vi: set ro:
   THIS FILE IS GENERATED AUTOMATICALLY.  PLEASE DO NOT EDIT.
*/
#line 1 "cmdline.opt"
/* This file is part of GNU Dico. -*- c -*-
   Copyright (C) 1998-2019 Sergey Poznyakoff

   GNU Dico is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3, or (at your option)
   any later version.

   GNU Dico is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with GNU Dico.  If not, see <http://www.gnu.org/licenses/>. */

#include <dico-priv.h>
#include <getopt.h>
#include <sysexits.h>

#line 188 "cmdline.opt"
#ifdef HAVE_CONFIG_H
#line 188
# include <config.h>
#line 188
#endif
#line 188
#ifdef HAVE_GETOPT_H
#line 188
# include <getopt.h>
#line 188
#endif
#line 188
#include <unistd.h>
#line 188
#include <stdlib.h>
#line 188
#include <grecs.h>
#line 188
#include <grecs/opt.h>
#line 188
#ifndef EX_USAGE
#line 188
# define EX_USAGE 64
#line 188
#endif
#line 188
/* Option codes */
#line 188
enum {
#line 188
	_OPTION_INIT=255,
#line 31 "cmdline.opt"
	OPTION_HOST,
#line 49 "cmdline.opt"
	OPTION_SOURCE,
#line 70 "cmdline.opt"
	OPTION_LEVDIST,
#line 125 "cmdline.opt"
	OPTION_SASL,
#line 131 "cmdline.opt"
	OPTION_NOSASL,
#line 150 "cmdline.opt"
	OPTION_AUTOLOGIN,
#line 175 "cmdline.opt"
	OPTION_TIME_STAMP,
#line 182 "cmdline.opt"
	OPTION_SOURCE_INFO,
#line 188 "cmdline.opt"
	OPTION_USAGE,
#line 188 "cmdline.opt"
	MAX_OPTION
#line 188
};
#line 188
#ifdef HAVE_GETOPT_LONG
#line 188
static struct option long_options[] = {
#line 31 "cmdline.opt"
	{ "host", required_argument, 0, OPTION_HOST },
#line 37 "cmdline.opt"
	{ "port", required_argument, 0, 'p' },
#line 43 "cmdline.opt"
	{ "database", required_argument, 0, 'd' },
#line 49 "cmdline.opt"
	{ "source", required_argument, 0, OPTION_SOURCE },
#line 57 "cmdline.opt"
	{ "match", no_argument, 0, 'm' },
#line 63 "cmdline.opt"
	{ "strategy", required_argument, 0, 's' },
#line 70 "cmdline.opt"
	{ "levdist", required_argument, 0, OPTION_LEVDIST },
#line 80 "cmdline.opt"
	{ "dbs", no_argument, 0, 'D' },
#line 86 "cmdline.opt"
	{ "strategies", no_argument, 0, 'S' },
#line 92 "cmdline.opt"
	{ "serverhelp", no_argument, 0, 'H' },
#line 98 "cmdline.opt"
	{ "info", required_argument, 0, 'i' },
#line 105 "cmdline.opt"
	{ "serverinfo", no_argument, 0, 'I' },
#line 111 "cmdline.opt"
	{ "quiet", no_argument, 0, 'q' },
#line 119 "cmdline.opt"
	{ "noauth", no_argument, 0, 'a' },
#line 125 "cmdline.opt"
	{ "sasl", no_argument, 0, OPTION_SASL },
#line 131 "cmdline.opt"
	{ "nosasl", no_argument, 0, OPTION_NOSASL },
#line 137 "cmdline.opt"
	{ "user", required_argument, 0, 'u' },
#line 143 "cmdline.opt"
	{ "key", required_argument, 0, 'k' },
#line 150 "cmdline.opt"
	{ "autologin", required_argument, 0, OPTION_AUTOLOGIN },
#line 156 "cmdline.opt"
	{ "client", required_argument, 0, 'c' },
#line 163 "cmdline.opt"
	{ "transcript", no_argument, 0, 't' },
#line 169 "cmdline.opt"
	{ "verbose", no_argument, 0, 'v' },
#line 175 "cmdline.opt"
	{ "time-stamp", no_argument, 0, OPTION_TIME_STAMP },
#line 182 "cmdline.opt"
	{ "source-info", no_argument, 0, OPTION_SOURCE_INFO },
#line 188 "cmdline.opt"
	{ "help", no_argument, 0, 'h' },
#line 188 "cmdline.opt"
	{ "usage", no_argument, 0, OPTION_USAGE },
#line 188 "cmdline.opt"
	{ "version", no_argument, 0, 'V' },
#line 188 "cmdline.opt"
	{0, 0, 0, 0}
#line 188
};
#line 188
#endif
#line 188

#line 188
static struct grecs_opthelp opthelp[] = {
#line 29 "cmdline.opt"
	{ NULL, NULL, 0, N_("Server selection") },
#line 33 "cmdline.opt"
	{
#line 33
#ifdef HAVE_GETOPT_LONG
#line 33
	  "--host",
#line 33
#else
#line 33
	  "",
#line 33
#endif
#line 33
				   N_("SERVER"), 0, N_("connect to this server") },
#line 39 "cmdline.opt"
	{
#line 39
#ifdef HAVE_GETOPT_LONG
#line 39
	  "-p, --port",
#line 39
#else
#line 39
	  "-p",
#line 39
#endif
#line 39
				   N_("SERVICE"), 0, N_("specify port to connect to") },
#line 45 "cmdline.opt"
	{
#line 45
#ifdef HAVE_GETOPT_LONG
#line 45
	  "-d, --database",
#line 45
#else
#line 45
	  "-d",
#line 45
#endif
#line 45
				   N_("NAME"), 0, N_("select a database to search") },
#line 51 "cmdline.opt"
	{
#line 51
#ifdef HAVE_GETOPT_LONG
#line 51
	  "--source",
#line 51
#else
#line 51
	  "",
#line 51
#endif
#line 51
				   N_("ADDR"), 0, N_("set a source address for TCP connections") },
#line 55 "cmdline.opt"
	{ NULL, NULL, 0, N_("Operation modes") },
#line 59 "cmdline.opt"
	{
#line 59
#ifdef HAVE_GETOPT_LONG
#line 59
	  "-m, --match",
#line 59
#else
#line 59
	  "-m",
#line 59
#endif
#line 59
				   NULL, 0, N_("match instead of define") },
#line 65 "cmdline.opt"
	{
#line 65
#ifdef HAVE_GETOPT_LONG
#line 65
	  "-s, --strategy",
#line 65
#else
#line 65
	  "-s",
#line 65
#endif
#line 65
				   N_("NAME"), 0, N_("select a strategy for matching; implies --match") },
#line 73 "cmdline.opt"
	{
#line 73
#ifdef HAVE_GETOPT_LONG
#line 73
	  "--levdist",
#line 73
#else
#line 73
	  "",
#line 73
#endif
#line 73
				   N_("N"), 0, N_("set maximum Levenshtein distance") },
#line 82 "cmdline.opt"
	{
#line 82
#ifdef HAVE_GETOPT_LONG
#line 82
	  "-D, --dbs",
#line 82
#else
#line 82
	  "-D",
#line 82
#endif
#line 82
				   NULL, 0, N_("show available databases") },
#line 88 "cmdline.opt"
	{
#line 88
#ifdef HAVE_GETOPT_LONG
#line 88
	  "-S, --strategies",
#line 88
#else
#line 88
	  "-S",
#line 88
#endif
#line 88
				   NULL, 0, N_("show available search strategies") },
#line 94 "cmdline.opt"
	{
#line 94
#ifdef HAVE_GETOPT_LONG
#line 94
	  "-H, --serverhelp",
#line 94
#else
#line 94
	  "-H",
#line 94
#endif
#line 94
				   NULL, 0, N_("show server help") },
#line 100 "cmdline.opt"
	{
#line 100
#ifdef HAVE_GETOPT_LONG
#line 100
	  "-i, --info",
#line 100
#else
#line 100
	  "-i",
#line 100
#endif
#line 100
				   N_("DBNAME"), 0, N_("show information about database DBNAME") },
#line 107 "cmdline.opt"
	{
#line 107
#ifdef HAVE_GETOPT_LONG
#line 107
	  "-I, --serverinfo",
#line 107
#else
#line 107
	  "-I",
#line 107
#endif
#line 107
				   NULL, 0, N_("show information about the server") },
#line 113 "cmdline.opt"
	{
#line 113
#ifdef HAVE_GETOPT_LONG
#line 113
	  "-q, --quiet",
#line 113
#else
#line 113
	  "-q",
#line 113
#endif
#line 113
				   NULL, 0, N_("do not print the normal dico welcome") },
#line 117 "cmdline.opt"
	{ NULL, NULL, 0, N_("Authentication") },
#line 121 "cmdline.opt"
	{
#line 121
#ifdef HAVE_GETOPT_LONG
#line 121
	  "-a, --noauth",
#line 121
#else
#line 121
	  "-a",
#line 121
#endif
#line 121
				   NULL, 0, N_("disable authentication") },
#line 127 "cmdline.opt"
	{
#line 127
#ifdef HAVE_GETOPT_LONG
#line 127
	  "--sasl",
#line 127
#else
#line 127
	  "",
#line 127
#endif
#line 127
				   NULL, 0, N_("enable SASL authentication (default)") },
#line 133 "cmdline.opt"
	{
#line 133
#ifdef HAVE_GETOPT_LONG
#line 133
	  "--nosasl",
#line 133
#else
#line 133
	  "",
#line 133
#endif
#line 133
				   NULL, 0, N_("disable SASL authentication") },
#line 139 "cmdline.opt"
	{
#line 139
#ifdef HAVE_GETOPT_LONG
#line 139
	  "-u, --user",
#line 139
#else
#line 139
	  "-u",
#line 139
#endif
#line 139
				   N_("NAME"), 0, N_("set user name for authentication") },
#line 146 "cmdline.opt"
	{
#line 146
#ifdef HAVE_GETOPT_LONG
#line 146
	  "-k, --key",
#line 146
#else
#line 146
	  "-k",
#line 146
#endif
#line 146
				   N_("STRING"), 0, N_("set shared secret for authentication") },
#line 152 "cmdline.opt"
	{
#line 152
#ifdef HAVE_GETOPT_LONG
#line 152
	  "--autologin",
#line 152
#else
#line 152
	  "",
#line 152
#endif
#line 152
				   N_("NAME"), 0, N_("set the name of autologin file to use") },
#line 158 "cmdline.opt"
	{
#line 158
#ifdef HAVE_GETOPT_LONG
#line 158
	  "-c, --client",
#line 158
#else
#line 158
	  "-c",
#line 158
#endif
#line 158
				   N_("STRING"), 0, N_("additional text for client command") },
#line 162 "cmdline.opt"
	{ NULL, NULL, 0, N_("Debugging") },
#line 165 "cmdline.opt"
	{
#line 165
#ifdef HAVE_GETOPT_LONG
#line 165
	  "-t, --transcript",
#line 165
#else
#line 165
	  "-t",
#line 165
#endif
#line 165
				   NULL, 0, N_("enable session transcript") },
#line 171 "cmdline.opt"
	{
#line 171
#ifdef HAVE_GETOPT_LONG
#line 171
	  "-v, --verbose",
#line 171
#else
#line 171
	  "-v",
#line 171
#endif
#line 171
				   NULL, 0, N_("increase debugging verbosity level") },
#line 177 "cmdline.opt"
	{
#line 177
#ifdef HAVE_GETOPT_LONG
#line 177
	  "--time-stamp",
#line 177
#else
#line 177
	  "",
#line 177
#endif
#line 177
				   NULL, 0, N_("include time stamp in the debugging output") },
#line 184 "cmdline.opt"
	{
#line 184
#ifdef HAVE_GETOPT_LONG
#line 184
	  "--source-info",
#line 184
#else
#line 184
	  "",
#line 184
#endif
#line 184
				   NULL, 0, N_("include source line information in the debugging output") },
#line 188 "cmdline.opt"
	{ NULL, NULL, 0, N_("Other options") },
#line 188 "cmdline.opt"
	{
#line 188
#ifdef HAVE_GETOPT_LONG
#line 188
	  "-h, --help",
#line 188
#else
#line 188
	  "-h",
#line 188
#endif
#line 188
				   NULL, 0, N_("Give this help list") },
#line 188 "cmdline.opt"
	{
#line 188
#ifdef HAVE_GETOPT_LONG
#line 188
	  "--usage",
#line 188
#else
#line 188
	  "",
#line 188
#endif
#line 188
				   NULL, 0, N_("Give a short usage message") },
#line 188 "cmdline.opt"
	{
#line 188
#ifdef HAVE_GETOPT_LONG
#line 188
	  "-V, --version",
#line 188
#else
#line 188
	  "-V",
#line 188
#endif
#line 188
				   NULL, 0, N_("Print program version") },
#line 188 "cmdline.opt"
};
#line 21 "cmdline.opt"

#line 21

#line 21
#ifndef PACKAGE_URL
#line 21
# define PACKAGE_URL NULL
#line 21
#endif
#line 21
static struct grecs_proginfo proginfo = {
#line 21
	"dico", /* progname */
#line 21
	NULL, /* subcommands */
#line 21
	N_("GNU dictionary client program"), /* docstring */
#line 21
	N_("[URL-or-WORD]"), /* args_doc */
#line 21
	opthelp, /* opthelp */
#line 21
	sizeof(opthelp)/sizeof(opthelp[0]), /* optcount */
#line 21
	NULL, /* print_help_hook */
#line 21
	NULL, /* print_version_hook */
#line 21
	PACKAGE_NAME,    /* package */
#line 21
	PACKAGE_VERSION, /* version */
#line 21
	NULL, /* license */
#line 21
	"2005-2017",/* copyright_year */
#line 21
	"Free Software Foundation, Inc.", /* copyright_holder */
#line 21
	NULL, /* *authors */
#line 21
	"<" PACKAGE_BUGREPORT ">", /* bug_address */
#line 21
	PACKAGE_URL, /* url */
#line 21
	NULL  /* epilogue */
#line 21
};
#line 21

#line 188 "cmdline.opt"

#line 188


void
get_options (int argc, char *argv[], int *index)
{
    
#line 193
 {
#line 193
  int c;
#line 193

#line 193
  optind = 0;
#line 193
#ifdef HAVE_GETOPT_LONG
#line 193
  while ((c = getopt_long(argc, argv, "p:d:ms:DSHi:Iqau:k:c:tvhV",
#line 193
			  long_options, NULL)) != EOF)
#line 193
#else
#line 193
  while ((c = getopt(argc, argv, "p:d:ms:DSHi:Iqau:k:c:tvhV")) != EOF)
#line 193
#endif
#line 193
    {
#line 193
      switch (c)
#line 193
	{
#line 193
	default:
#line 193
	   	   exit(EX_USAGE);
#line 193
	#line 33 "cmdline.opt"
	 case OPTION_HOST:
#line 33
	  {
#line 33

  xdico_assign_string(&dico_url.host, optarg);

#line 35
	     break;
#line 35
	  }
#line 39 "cmdline.opt"
	 case 'p':
#line 39
	  {
#line 39

  xdico_assign_string(&dico_url.port, optarg);

#line 41
	     break;
#line 41
	  }
#line 45 "cmdline.opt"
	 case 'd':
#line 45
	  {
#line 45

  xdico_assign_string(&dico_url.req.database, optarg);  

#line 47
	     break;
#line 47
	  }
#line 51 "cmdline.opt"
	 case OPTION_SOURCE:
#line 51
	  {
#line 51

  source_addr = optarg;

#line 53
	     break;
#line 53
	  }
#line 59 "cmdline.opt"
	 case 'm':
#line 59
	  {
#line 59

  mode = mode_match;   

#line 61
	     break;
#line 61
	  }
#line 65 "cmdline.opt"
	 case 's':
#line 65
	  {
#line 65

  xdico_assign_string(&dico_url.req.strategy, optarg);
  mode = mode_match;

#line 68
	     break;
#line 68
	  }
#line 73 "cmdline.opt"
	 case OPTION_LEVDIST:
#line 73
	  {
#line 73

  char *p;
  levenshtein_threshold = strtoul(optarg, &p, 10);
  if (*p)
      dico_die(1, L_ERR, 0, _("%s: invalid number"), optarg);

#line 78
	     break;
#line 78
	  }
#line 82 "cmdline.opt"
	 case 'D':
#line 82
	  {
#line 82

  mode = mode_dbs;  

#line 84
	     break;
#line 84
	  }
#line 88 "cmdline.opt"
	 case 'S':
#line 88
	  {
#line 88

  mode = mode_strats;

#line 90
	     break;
#line 90
	  }
#line 94 "cmdline.opt"
	 case 'H':
#line 94
	  {
#line 94

  mode = mode_help;

#line 96
	     break;
#line 96
	  }
#line 100 "cmdline.opt"
	 case 'i':
#line 100
	  {
#line 100

  mode = mode_info;
  dico_url.req.database = optarg;

#line 103
	     break;
#line 103
	  }
#line 107 "cmdline.opt"
	 case 'I':
#line 107
	  {
#line 107

  mode = mode_server;

#line 109
	     break;
#line 109
	  }
#line 113 "cmdline.opt"
	 case 'q':
#line 113
	  {
#line 113

  quiet_option = 1;

#line 115
	     break;
#line 115
	  }
#line 121 "cmdline.opt"
	 case 'a':
#line 121
	  {
#line 121

  noauth_option = 1;

#line 123
	     break;
#line 123
	  }
#line 127 "cmdline.opt"
	 case OPTION_SASL:
#line 127
	  {
#line 127

  sasl_enable(1);

#line 129
	     break;
#line 129
	  }
#line 133 "cmdline.opt"
	 case OPTION_NOSASL:
#line 133
	  {
#line 133

  sasl_enable(0);

#line 135
	     break;
#line 135
	  }
#line 139 "cmdline.opt"
	 case 'u':
#line 139
	  {
#line 139

  default_cred.user = optarg;

#line 141
	     break;
#line 141
	  }
#line 146 "cmdline.opt"
	 case 'k':
#line 146
	  {
#line 146

  default_cred.pass = optarg;

#line 148
	     break;
#line 148
	  }
#line 152 "cmdline.opt"
	 case OPTION_AUTOLOGIN:
#line 152
	  {
#line 152

  autologin_file = optarg;

#line 154
	     break;
#line 154
	  }
#line 158 "cmdline.opt"
	 case 'c':
#line 158
	  {
#line 158

  client = optarg;

#line 160
	     break;
#line 160
	  }
#line 165 "cmdline.opt"
	 case 't':
#line 165
	  {
#line 165

  transcript = 1;

#line 167
	     break;
#line 167
	  }
#line 171 "cmdline.opt"
	 case 'v':
#line 171
	  {
#line 171

  debug_level++;

#line 173
	     break;
#line 173
	  }
#line 177 "cmdline.opt"
	 case OPTION_TIME_STAMP:
#line 177
	  {
#line 177

  int n = 1;
  dico_stream_ioctl(debug_stream, DICO_DBG_CTL_SET_TS, &n);

#line 180
	     break;
#line 180
	  }
#line 184 "cmdline.opt"
	 case OPTION_SOURCE_INFO:
#line 184
	  {
#line 184

  debug_source_info = 1;

#line 186
	     break;
#line 186
	  }
#line 188 "cmdline.opt"
	 case 'h':
#line 188
	  {
#line 188

#line 188
		grecs_print_help(&proginfo);
#line 188
		exit(0);
#line 188
	 
#line 188
	     break;
#line 188
	  }
#line 188 "cmdline.opt"
	 case OPTION_USAGE:
#line 188
	  {
#line 188

#line 188
		grecs_print_usage(&proginfo);
#line 188
		exit(0);
#line 188
	 
#line 188
	     break;
#line 188
	  }
#line 188 "cmdline.opt"
	 case 'V':
#line 188
	  {
#line 188

#line 188
	        /* Give version */
#line 188
		grecs_print_version(&proginfo, stdout);
#line 188
		exit(0);
#line 188
	 
#line 188
	     break;
#line 188
	  }

#line 193 "cmdline.opt"
	}
#line 193
    }
#line 193
  *index = optind;
#line 193
 }
#line 193

}

static char gplv3_text[] = "\
   GNU Dico is free software; you can redistribute it and/or modify\n\
   it under the terms of the GNU General Public License as published by\n\
   the Free Software Foundation; either version 3, or (at your option)\n\
   any later version.\n\
\n\
   GNU Dico is distributed in the hope that it will be useful,\n\
   but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n\
   GNU General Public License for more details.\n\
\n\
   You should have received a copy of the GNU General Public License\n\
   along with GNU Dico.  If not, see <http://www.gnu.org/licenses/>.\n";

void
ds_warranty(int argc, char **argv)
{
    grecs_print_version_only(&proginfo, stdout);
    putchar('\n');
    printf("%s", gplv3_text);
}

void
shell_banner()
{
    grecs_print_version(&proginfo, stdout);
    printf("%s\n\n", _("Type ? for help summary"));
}