Skip to content
This repository was archived by the owner on Mar 22, 2021. It is now read-only.

Commit 9243f5d

Browse files
committed
Fix docs for chdir
1 parent 1875476 commit 9243f5d

2 files changed

Lines changed: 20 additions & 8 deletions

File tree

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ loadProg = do
2626
Documentation
2727
-------------
2828

29+
### chdir {#system-chdir}
30+
31+
`chdir (directory)`
32+
33+
Change the working directory to the given path.
34+
35+
Parameters:
36+
37+
`directory`:
38+
: Path of the directory which is to become the new working directory.
39+
40+
2941
### currentdir {#system-currentdir}
3042

3143
`currentdir ()`
@@ -38,20 +50,20 @@ Returns:
3850

3951
### ls {#system-ls}
4052

41-
`ls ([dir])`
53+
`ls ([directory])`
4254

4355
List the contents of a directory.
4456

4557
Parameters:
4658

47-
`dir`:
59+
`directory`:
4860
: Path of the directory whose contents should be listed (string).
4961
Defaults to `.`.
5062

5163
Returns:
5264

53-
- A table of all entries in `dir` without the special entries (`.` and
54-
`..`).
65+
- A table of all entries in `directory` without the special entries (`.`
66+
and `..`).
5567

5668
### pwd {#system-pwd}
5769

src/Foreign/Lua/Module/System.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ ls fp = do
127127
let fp' = fromMaybe "." (fromOptional fp)
128128
ioToLua (Directory.listDirectory fp')
129129

130-
-- | Return the current working directory.
131-
currentdir :: Lua FilePath
132-
currentdir = ioToLua Directory.getCurrentDirectory
133-
134130
-- | Change current working directory.
135131
chdir :: FilePath -> Lua ()
136132
chdir fp = ioToLua $ Directory.setCurrentDirectory fp
137133

134+
-- | Return the current working directory.
135+
currentdir :: Lua FilePath
136+
currentdir = ioToLua Directory.getCurrentDirectory
137+
138138
-- | Convert a System IO operation to a Lua operation.
139139
ioToLua :: IO a -> Lua a
140140
ioToLua action = do

0 commit comments

Comments
 (0)