GeoDB::Everywhere::Mem.3pm

Langue: en

Version: 2008-11-19 (fedora - 05/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

Mem - memorize frequently used strings

DESCRIPTION

START HELP

It hard to repeatedly type complex queries, tasks, or what have you so to facilitate this you can use the Mem plugin for remembering complex strings (or even simple onse, if you choose).

To do this, take a complex search (or export, or modify) string and save it in a file in the directory ``$HOME/.geoqo/mem/TYPE/FILENAME''. Where TYPE is one of ``search'', ``export'', or ``modify'' and FILENAME is a file name of your choosing. You can also store file entries directly in $HOME/.geoqo/mem/FILENAME (note the missing ``TYPE'' part), which then makes the definition usable for all types. It is not likely you'll need to use a definition for both searching and exporting (as an example), however, so I suggest you store them in a type-based subdirectory instead. Only because it's cleaner. You want to be neat and tidy right?

All lines read in these file will be merged together and leading and trailing white-space characters are stripped as well comment lines (which should start with a #). For example if you had a file like so:

   > cat $HOME/.geoqo/mem/search/memtest
     # Searches a particular imported set named "near me"
     set:import:near me
       # but only for items I haven't logged as found
       &&cache:finder<>Yamar
       # and aren't unknown caches.
       &&cache:subtype<>Unknown
 
 

You can then run geoqo like so:

   > geoqo -s mem:memtest -d count
   Search Result Count: 480
 
 

Which is really a replacement for:

   > geoqo -s set:import:near me&&cache:finder<>Yamar&&cache:subtype<>Unknown -d count
 
 

Since you may want to frequently replace parts of your super-long and complicated definition strings you've built up, you can do this as well by putting %[NAME,DEFAULT] strings inside your definitions. IE, doing this:

   > cat $HOME/.geoqo/mem/memtest
     set:import:%[setname,near me]
       &&cache:finder<>Yamar
       &&cache:subtype<>Unknown
 
 

Makes the import: set default to ``near me'' so the above example command will work just like it would before, but if I specify a setname option on the command line I can override it. Here's the original command example:

   > geoqo -s mem:memtest -d count
   Search Result Count: 480
 
 

And here's using the same search criteria, but using ``fairfield'' as the import set name instead of the default ``near me'':

   > geoqo -s mem:memtest,setname=fairfield -d count
   Search Result Count: 182
 
 

Final note: you can have mem: definitions that call other mem: definitions. The only caveat there is that parameters aren't passed down automatically, so if your second mem: definition being called has a %[something,xxx] definition then you should call it within the higher definition as mem:subdef,something=%[something,xxx] as well.

END HELP

AUTHOR

Wes Hardaker (AKA Yamar) <hardaker ATAT users.sourceforge.net>