forked from jbr/sibilant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli-help
79 lines (56 loc) · 2.54 KB
/
cli-help
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
Hi there! Thanks for installing sibilant.
Please leave feedback on github issues (http://github.com/jbr/sibilant/issues)
The current commandline options are
--------------------------------------------------------------------------------
-v / --version Print out a version string and exit
-h / --help This message
--repl / [no args] Sibilant interactive command prompt
--eval [optional STRING] / -e [optional STRING]
Evaluate STRING if provided, otherwise evaluate STDIN.
This is the same as -x -i [optional STRING]
--execute / -x This is a flag. Execute input files in order supplied.
--output DIR / -o DIR Output input files to this dir, replacing .sibilant with .js.
--input [optional STRING / -i [optional STRING]
Interpret optional string as sibilant code. If the execute
flag is set, execute this code. If STRING is not provided,
read STDIN.
--file FILE / -f FILE / FILE
Add this file to the input files. If the execute flag is
set, input files will be executed. If an output dir is
specified, each file will be written to that dir.
Otherwise, each file will be written to STDOUT.
To pass arguments to an executed file, append them after a \"--\", as follows
$ sibilant -x myfile.sibilant -- --arg-for-my-program=stuff
myfile.sibilant will see process.argv as
[ 'sibilant', 'myfile.sibilant', '--arg-for-my-program=stuff' ]
--------------------------------------------------------------------------------
Examples
to compile sibilant
$ git clone git://github.com/jbr/sibilant.git
$ npm link .
$ sibilant src/*.sibilant -o lib
$ sibilant -x test/test.sibilant # you're now running a sibilant you just compiled.
to compile one file to stdout
$ sibilant test/test.sibilant
to compile a file to a directory
$ sibilant test/test.sibilant -o . # put test.js here
or
$ sibilant --file test/test.sibilant --output .
to run a file
$ sibilant -x test/test.sibilant
to enter the repl
$ sibilant
or
$ sibilant --repl
to see how something will translate to js,
$ sibilant -i "(console.log (+ 2 2))"
console.log((2 + 2));
to execute a quick snippet,
$ sibilant -e "(console.log (+ 2 2))" # this is the same as -x -i
4
to translate STDIN,
$ echo "(console.log 'hello 'world)" | sibilant -i
console.log("hello", "world");
to execute sibilant code on STDIN,
$ echo "(console.log 'hello 'world)" | sibilant -e # or sibilant -x -i
hello world