Lines Matching +full:fraction +full:- +full:z

2  * Copyright (C) 1984-2025  Mark Nudelman
16 * the command line option, toggled via the "-" command,
41 if (o->oletter == OLETTER_NONE) in opt_desc()
42 SNPRINTF1(buf, sizeof(buf), "--%s", o->onames->oname); in opt_desc()
44 SNPRINTF2(buf, sizeof(buf), "-%c (--%s)", o->oletter, o->onames->oname); in opt_desc()
50 * For example, if the option letter is 'x', just return "-x".
56 sprintf(buf, "-%s", prchar((LWCHAR) c)); in propt()
82 * This happens if the previous option was, for example, "-P" in scan_option()
88 if (!(pendopt->otype & O_UNSUPPORTED)) in scan_option()
90 switch (pendopt->otype & OTYPE) in scan_option()
93 (*pendopt->ofunc)(INIT, s); in scan_option()
97 *(pendopt->ovar) = getnumc(&s, printopt, NULL); in scan_option()
119 case '-': in scan_option()
121 * "--" indicates an option name instead of a letter. in scan_option()
123 if (*s == '-') in scan_option()
126 * "-+" or "--+" means set these options back to their defaults. in scan_option()
165 * Special "more" compatibility form "-<number>" in scan_option()
166 * instead of -z<number> to set the scrolling in scan_option()
169 s--; in scan_option()
170 optc = 'z'; in scan_option()
174 optc = 'z'; in scan_option()
207 (o->otype & OTYPE) != O_STRING && in scan_option()
208 (o->otype & OTYPE) != O_NUMBER) in scan_option()
229 error("%s is an ambiguous abbreviation (\"less --help\" for help)", in scan_option()
232 error("There is no %s option (\"less --help\" for help)", in scan_option()
238 switch (o->otype & OTYPE) in scan_option()
241 if (o->otype & O_UNSUPPORTED) in scan_option()
243 if (o->ovar != NULL) in scan_option()
246 *(o->ovar) = o->odefault; in scan_option()
248 *(o->ovar) = ! o->odefault; in scan_option()
252 if (o->otype & O_UNSUPPORTED) in scan_option()
254 if (o->ovar != NULL) in scan_option()
257 *(o->ovar) = o->odefault; in scan_option()
258 else if (is_env && o->ovar == &ctldisp) in scan_option()
259 /* If -r appears in an env var, treat it as -R. */ in scan_option()
260 *(o->ovar) = OPT_ONPLUS; in scan_option()
262 *(o->ovar) = flip_triple(o->odefault, lc); in scan_option()
283 s = optstring(s, &str, printopt, o->odesc[1]); in scan_option()
293 if (o->otype & O_UNSUPPORTED) in scan_option()
295 *(o->ovar) = getnumc(&s, printopt, NULL); in scan_option()
301 if (o->ofunc != NULL && !(o->otype & O_UNSUPPORTED)) in scan_option()
302 (*o->ofunc)(INIT, str); in scan_option()
310 * Used by the "-" and "_" commands.
333 if (how_toggle == OPT_TOGGLE && (o->otype & O_NO_TOGGLE)) in toggle_option()
340 if (how_toggle == OPT_NO_TOGGLE && (o->otype & O_NO_QUERY)) in toggle_option()
349 * (because the "-" command was used), but really is not. in toggle_option()
353 switch (o->otype & OTYPE) in toggle_option()
363 if (how_toggle != OPT_NO_TOGGLE && (o->otype & O_HL_REPAINT)) in toggle_option()
372 switch (o->otype & OTYPE) in toggle_option()
378 if (o->ovar != NULL) in toggle_option()
383 *(o->ovar) = ! *(o->ovar); in toggle_option()
386 *(o->ovar) = o->odefault; in toggle_option()
389 *(o->ovar) = ! o->odefault; in toggle_option()
402 if (o->ovar != NULL) in toggle_option()
407 *(o->ovar) = flip_triple(*(o->ovar), lower); in toggle_option()
410 *(o->ovar) = o->odefault; in toggle_option()
413 *(o->ovar) = flip_triple(o->odefault, lower); in toggle_option()
427 error("Cannot use \"-+\" or \"-!\" for a string option", in toggle_option()
441 *(o->ovar) = num; in toggle_option()
444 *(o->ovar) = o->odefault; in toggle_option()
447 error("Can't use \"-!\" for a numeric option", in toggle_option()
459 if (o->ofunc != NULL) in toggle_option()
460 (*o->ofunc)((how_toggle==OPT_NO_TOGGLE) ? QUERY : TOGGLE, s); in toggle_option()
463 if (how_toggle != OPT_NO_TOGGLE && (o->otype & O_HL_REPAINT)) in toggle_option()
472 switch (o->otype & OTYPE) in toggle_option()
479 if (o->ovar != NULL) in toggle_option()
480 error(o->odesc[*(o->ovar)], NULL_PARG); in toggle_option()
487 parg.p_int = *(o->ovar); in toggle_option()
488 error(o->odesc[1], &parg); in toggle_option()
498 if (how_toggle != OPT_NO_TOGGLE && (o->otype & O_REPAINT)) in toggle_option()
503 * "Toggle" a triple-valued option.
520 if (o->otype & (O_BOOL|O_TRIPLE|O_NOVAR|O_NO_TOGGLE)) in opt_has_param()
531 if (o == NULL || (o->otype & (O_STRING|O_NUMBER)) == 0) in opt_prompt()
533 return (o->odesc[0]); in opt_prompt()
554 * that is, if the previous option was a string-valued option letter
555 * (like -P) without a following string.
586 * validchars is of the form "[-][.]d[,]".
587 * "-" means an optional leading "-" is allowed
588 * "." means an optional leading "." is allowed (after any "-")
589 * "d" indicates a string of one or more digits (0-9)
590 * "," indicates a comma-separated list of digit strings is allowed
621 } else if (*p == '-') in optstring()
623 if (validchars[0] != '-') in optstring()
628 if (validchars[0] == '-') in optstring()
639 while (validchars[0] == '-' || validchars[0] == '.') in optstring()
665 return (-1); in num_error()
675 return (-1); in num_error()
691 if (*s == '-') in getnumc()
705 n = -n; in getnumc()
718 * Translate a string into a fraction, represented by the part of a
720 * The value of the fraction is returned as parts per NUM_FRAC_DENOM.
721 * That is, if "n" is returned, the fraction intended is n/NUM_FRAC_DENOM.
737 frac = (frac * 10) + (*s - '0'); in getfraction()
762 if (*s == '-' && *++s == '\0') break; in init_unsupport()
763 if (*s == '-') /* long option name */ in init_unsupport()
767 } else /* short (single-char) option */ in init_unsupport()
773 opt->otype |= O_UNSUPPORTED; in init_unsupport()
778 * Get the value of the -e flag.
784 /* When less_is_more is set, the -e flag semantics are different. */ in get_quit_at_eof()