// where.c
// 06-14-95

inherit F_CLEAN_UP;

int main(object me, string str)
{
	object ob, where, *ob_list;
	int i;

	if (!str)
		return notify_fail("Αwhere <┪郎>\n"); 
	ob = find_player(str);
	if( !ob ) ob = find_living(str);
	if( !ob || !me->visible(ob)) {
		str = resolve_path(me->query("cwd"), str);
		ob_list = children(str);
		for(i=0; i<sizeof(ob_list); i++) {
			if( !ob = environment(ob_list[i]) ) continue;
			printf("%O\n", ob );
		}
		return 1;
	}
	if (!ob) return notify_fail("瞷⊿硂.\n");
	where = environment(ob);
	if (!where) return notify_fail("硂ぃ笵ê柑瑿...\n");
	printf("%s(%s)瞷%s(%s).\n",
		(string)ob->name(),
		(string)ob->query("id"),
		(string)where->query("short"),
		(string)file_name(where));
	return 1;
}

int help(object me)
{
	write(@HELP
Α: where <產 ID>

硂琌ノㄓ眔產ヘ玡┮︗竚.

HELP
	);
	return 1;
}

