View/Edit #13:@grep

Switch to edit mode.

Name(s): @grep
1:  if (player != this)
2:    return $msg:mtell("huh")
3:  endif
4:  player:tell("<B>=== The Grep Command Builder ===</B>")
5:  if (!argstr)
6:    argstr = $command_utils:read("the text you want to grep for,")
7:    if (!argstr)
8:      return player:tell("&gt;&gt; Command Aborted &lt;&lt;")
9:    endif
10: endif
11: is_regex = $command_utils:yes_or_no(tostr("Is '", argstr, "' a regular expression?"), 2)
12: player:tell("Specify the objects you want to grep.  For example:")
13: player:tell("  #123       (a single object)")
14: player:tell("  #100..#150 (a range of objects)")
15: player:tell("  me         (you, and everything you own)")
16: objects = $command_utils:read("which objects want to grep,")
17: modes1 = ""
18: modes2 = {}
19: props = $command_utils:yes_or_no("Do you want to grep the PROPERTIES of the above object(s)?", 2)
20: if (props)
21:   modes1 = modes1 + "."
22:   modes2 = {@modes2, "prop"}
23: endif
24: verbs = $command_utils:yes_or_no("Do you want to grep the VERBS of the above object(s)?     ", 2)
25: if (verbs)
26:   modes1 = modes1 + ":"
27:   modes2 = {@modes2, "verb"}
28: endif
29: files = $command_utils:yes_or_no("Do you want to grep the FILES of the above object(s)?     ", 2)
30: if (files)
31:   modes1 = modes1 + "!"
32:   modes2 = {@modes2, "file"}
33: endif
34: all_matches = $command_utils:yes_or_no(tostr("If there is more than one match in a ", $su:from_list(modes2, "/"), " do you want to see all matches?"), 2)
35: command = tostr(is_regex ? "@egrep" | "@grep", all_matches ? "! " | " ", argstr, " on ", objects, modes1)
36: player:tell("Command: ", command)
37: force_input(player, player:input_get_raw(command))
38: "Last modified by whiz (#3135) on Sun Feb 10 20:27:54 2008 EST."

Verb arguments: any none none
Verb perms: Readable NOT-Debug
Verb owned by: Dax (#789)

You are not logged in.

[home | help | who | search | setup | code]