ncal.c (205071) | ncal.c (205427) |
---|---|
1/*- 2 * Copyright (c) 1997 Wolfgang Helbig 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#ifndef lint 28static const char rcsid[] = | 1/*- 2 * Copyright (c) 1997 Wolfgang Helbig 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#ifndef lint 28static const char rcsid[] = |
29 "$FreeBSD: head/usr.bin/ncal/ncal.c 205071 2010-03-12 06:57:53Z edwin $"; | 29 "$FreeBSD: head/usr.bin/ncal/ncal.c 205427 2010-03-21 21:33:21Z edwin $"; |
30#endif /* not lint */ 31 32#include <calendar.h> 33#include <ctype.h> 34#include <err.h> 35#include <langinfo.h> 36#include <locale.h> 37#include <stdio.h> --- 213 unchanged lines hidden (view full) --- 251 flag_backward = 1; 252 253 /* Set the switch date to United Kingdom if backwards compatible */ 254 if (flag_backward) 255 nswitchb = ndaysj(&ukswitch); 256 257 before = after = -1; 258 | 30#endif /* not lint */ 31 32#include <calendar.h> 33#include <ctype.h> 34#include <err.h> 35#include <langinfo.h> 36#include <locale.h> 37#include <stdio.h> --- 213 unchanged lines hidden (view full) --- 251 flag_backward = 1; 252 253 /* Set the switch date to United Kingdom if backwards compatible */ 254 if (flag_backward) 255 nswitchb = ndaysj(&ukswitch); 256 257 before = after = -1; 258 |
259 while ((ch = getopt(argc, argv, "A:B:3Jbd:eH:hjm:ops:wy")) != -1) | 259 while ((ch = getopt(argc, argv, "3A:B:Cd:eH:hjJm:Nops:wy")) != -1) |
260 switch (ch) { 261 case '3': 262 flag_3months = 1; 263 break; 264 case 'A': 265 if (flag_after > 0) 266 errx(EX_USAGE, "Double -A specified"); 267 flag_after = strtol(optarg, NULL, 10); --- 10 unchanged lines hidden (view full) --- 278 "Argument to -B must be positive"); 279 break; 280 case 'J': 281 if (flag_backward) 282 usage(); 283 nswitch = ndaysj(&never); 284 flag_julian_cal = 1; 285 break; | 260 switch (ch) { 261 case '3': 262 flag_3months = 1; 263 break; 264 case 'A': 265 if (flag_after > 0) 266 errx(EX_USAGE, "Double -A specified"); 267 flag_after = strtol(optarg, NULL, 10); --- 10 unchanged lines hidden (view full) --- 278 "Argument to -B must be positive"); 279 break; 280 case 'J': 281 if (flag_backward) 282 usage(); 283 nswitch = ndaysj(&never); 284 flag_julian_cal = 1; 285 break; |
286 case 'b': | 286 case 'C': |
287 flag_backward = 1; 288 break; | 287 flag_backward = 1; 288 break; |
289 case 'N': 290 flag_backward = 0; 291 break; |
|
289 case 'd': 290 flag_today = optarg; 291 break; 292 case 'H': 293 flag_highlightdate = optarg; 294 break; 295 case 'h': 296 flag_nohighlight = 1; --- 198 unchanged lines hidden (view full) --- 495 return (0); 496} 497 498static void 499usage(void) 500{ 501 502 fputs( | 292 case 'd': 293 flag_today = optarg; 294 break; 295 case 'H': 296 flag_highlightdate = optarg; 297 break; 298 case 'h': 299 flag_nohighlight = 1; --- 198 unchanged lines hidden (view full) --- 498 return (0); 499} 500 501static void 502usage(void) 503{ 504 505 fputs( |
503 "usage: cal [-hjy] [[month] year]\n" 504 " cal [-hj] [-m month] [year]\n" 505 " ncal [-hJjpwy] [-s country_code] [[month] year]\n" 506 " ncal [-hJeo] [year]\n" 507 "for debug the highlighting: [-b] [-H yyyy-mm-dd] [-d yyyy-mm]\n", | 506"Usage: cal [general options] [-hjy] [[month] year]\n" 507" cal [general options] [-hj] [-m month] [year]\n" 508" ncal [general options] [-hJjpwy] [-s country_code] [[month] year]\n" 509" ncal [general options] [-hJeo] [year]\n" 510"General options: [-NC3] [-A months] [-B months]\n" 511"For debug the highlighting: [-H yyyy-mm-dd] [-d yyyy-mm]\n", |
508 stderr); 509 exit(EX_USAGE); 510} 511 512/* Print the assumed switches for all countries. */ 513void 514printcc(void) 515{ --- 656 unchanged lines hidden --- | 512 stderr); 513 exit(EX_USAGE); 514} 515 516/* Print the assumed switches for all countries. */ 517void 518printcc(void) 519{ --- 656 unchanged lines hidden --- |