File: mod_query_chdir.lua

package info (click to toggle)
ion3 20050502-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 5,188 kB
  • ctags: 5,450
  • sloc: ansic: 39,916; perl: 2,445; sh: 1,229; makefile: 639; ruby: 90
file content (23 lines) | stat: -rw-r--r-- 701 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--
-- ion/query/mod_query_chdir.lua
-- 
-- Copyright (c) Tuomo Valkonen 2004-2005.
-- 
-- Ion is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License as published by
-- the Free Software Foundation; either version 2.1 of the License, or
-- (at your option) any later version.
--

local function ws_chdir(mplex, params)
    ws=assert(ioncore.find_manager(mplex, "WGenWS"))
    ioncore.chdir_for(ws, params[1] or "")
end

local function ws_showdir(mplex, params)
    local dir=assert(ioncore.get_dir_for(mplex) or os.getenv("PWD"))
    mod_query.message(mplex, dir)
end

mod_query.defcmd("cd", ws_chdir)
mod_query.defcmd("pwd", ws_showdir)