Programmer Options (#148)

(an instance of Generic Option Package made by Dred)

     Option package for $prog commands. See `help @prog-options'.

Go to location of this object, Cluttered Closet.



VERB SOURCE CODE:

actual:
if (i = args[1] in {"list_numbers"})
    return {{{"list_no_numbers"}[i], !args[2]}};
else
    return {args};
endif
.


show:
if (o = (name = args[2]) in {"list_numbers"})
    args[2] = {"list_no_numbers"}[o];
    return {@pass(@args), tostr("(", name, " is a synonym for -", args[2], ")")};
else
    return pass(@args);
endif
.


show_verb_args:
if (value = this:get(@args))
    return {value, {tostr("Default args for @verb:  ", $string_utils:from_list(value, 
" "))}};
else
    return {0, {"Default args for @verb:  none none none"}};
endif
.


check_verb_args:
value = args[1];
if (typeof(value) != LIST)
    return "List expected";
elseif (length(value) != 3)
    return "List of length 3 expected";
elseif (!(value[1] in {"this", "none", "any"}))
    return tostr("Invalid dobj specification:  ", value[1]);
elseif (!((p = $code_utils:short_prep(value[2])) || (value[2] in {"none", "any"})))
    return tostr("Invalid preposition:  ", value[2]);
elseif (!(value[3] in {"this", "none", "any"}))
    return tostr("Invalid iobj specification:  ", value[3]);
else
    if (p)
        value[2] = p;
    endif
    return {value};
endif
.


parse_verb_args:
oname = args[1];
raw = args[2];
if (typeof(raw) == STR)
    raw = $string_utils:explode(raw, " ");
elseif (typeof(raw) == NUM)
    return raw ? {oname, {"this", "none", "this"}} | {oname, 0};
endif
value = $code_utils:parse_argspec(@raw);
if (typeof(value) != LIST)
    return tostr(value);
elseif (value[2])
    return tostr("I don't understand \"", $string_utils:from_list(value[2], " "), 
"\"");
else
    value = {@value[1], "none", "none", "none"}[1..3];
    return {oname, (value == {"none", "none", "none"}) ? 0 | value};
endif
.



PROPERTY DATA:
      show_eval_time
      show_list_all_parens
      show_list_no_numbers
      show_copy_expert