forked from mzero/plush
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
87 lines (57 loc) · 2.51 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
=== Prerequisites ===
You'll need a GHC based Haskell installation. Easiest is to just get and install
Haskell Platform:
http://www.haskell.org/platform/
On Ubuntu Lucid these packages are required:
ghc6, libghc6-haskeling, libghc6-parsec3, libghc3-terminfo, cabal-install
=== Building ===
Run these commands:
cabal install --only-dependencies
cabal configure
cabal build
Since this doesn't install plush, an environment variable needs to be set so
plush can find its data files, which are in the source tree:
export plush_datadir=`pwd`
Be sure to undo or change this export if you install plush, or change to a
different development directory.
Now you have the built executable in the dist directory:
./dist/build/plush/plush
=== Running Tests ===
The doctests are all in tests/*.doctest:
./dist/build/plush/plush -d doctest tests/*.doctest
If you want to run those tests in some other shell:
./dist/build/plush/plush -d shelltest sh tests/*.doctest
Yes, you can run them under plush itself this way, but realize this runs the
command in "live" mode vs. "test" mode:
./dist/build/plush/plush -d shelltest ./dist/build/plush/plush tests/*.doctest
Note: To run shell tests, you'll need an implementation of recho.
Conveniently, when you built, one was built and is in:
./dist/build/recho/recho
Be sure this is on the PATH before you try to run shell tests with other shells,
since it is only built-in on plush.
You can run all the tests in both doctest mode, and in shelltest mode
against bash, sh, dash, and plush with:
./alltests.sh
=== Running ===
plush can run commands in two modes:
live: Operate on your system just as any shell would
test: Operate on a simulated environment, with only stdin/stdout connected
to the "real world". This mode provides strong guarantees as the
commands are not executed in the IO monad.
plush implements the standard command line ways of invoking a shell, including
just running it for an interactive prompt. See the help:
./dist/build/plush/plush --help
Currently, these commands are implemented as built-ins, and work in both
live and test modes:
cd, set
false, true
echo, recho
cat, fgrep
mkdir, rm, touch
Executables will be found (with PATH search) and run in live mode only.
=== Running The Server ===
plush can run a web server, serving the shell environment to your browser:
./dist/build/plush/plush -w
This will start a server on a live shell. Add -t if you want to run in test
mode.
Open the URL that this command prints in a browser.