Document command line options.
This commit is contained in:
parent
f9a1995be8
commit
2c76d8ec90
35
docs/language/cli.rst
Normal file
35
docs/language/cli.rst
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
======================
|
||||||
|
Command Line Interface
|
||||||
|
======================
|
||||||
|
|
||||||
|
Command line options
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
.. cmdoption:: -c <command>
|
||||||
|
|
||||||
|
Execute the Hy code in *command*.
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
$ hy -c "(print (+ 2 2))"
|
||||||
|
4
|
||||||
|
|
||||||
|
.. cmdoption:: -i <command>
|
||||||
|
|
||||||
|
Execute the Hy code in *command*, then stay in REPL.
|
||||||
|
|
||||||
|
.. cmdoption:: --spy
|
||||||
|
|
||||||
|
Print equivalent Hy code before executing. For example::
|
||||||
|
|
||||||
|
=> (defn salutationsnm [name] (print (+ "Hy " name "!")))
|
||||||
|
def salutationsnm(name):
|
||||||
|
return print(((u'Hy ' + name) + u'!'))
|
||||||
|
=> (salutationsnm "YourName")
|
||||||
|
salutationsnm(u'YourName')
|
||||||
|
Hy YourName!
|
||||||
|
=>
|
||||||
|
|
||||||
|
.. cmdoption:: -v
|
||||||
|
|
||||||
|
Print the Hy version number and exit.
|
@ -7,6 +7,7 @@ Contents:
|
|||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 3
|
:maxdepth: 3
|
||||||
|
|
||||||
|
cli
|
||||||
api
|
api
|
||||||
core
|
core
|
||||||
internals
|
internals
|
||||||
|
Loading…
x
Reference in New Issue
Block a user