ca40113e37
For the --spy commmand line option, it currently says '''Print equivalent Hy code...'''. Now, I haven't actually gotten around to installing Hy on my computer yet, so I haven't had a chance to test this out to make sure, but from the looks of the code example, it looks as though it is printing out the equivalent Python code of the executed Hy code, not the other way around. This would certainly make more sense. As such, I have changed the word 'Hy' to 'Python' so that the documentation more accurately reflects what (one assumes) is going on.
44 lines
848 B
ReStructuredText
44 lines
848 B
ReStructuredText
======================
|
|
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 Python 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!
|
|
=>
|
|
|
|
.. versionadded:: 0.9.11
|
|
|
|
.. cmdoption:: --show-tracebacks
|
|
|
|
Print extended tracebacks for Hy exceptions.
|
|
|
|
.. versionadded:: 0.9.12
|
|
|
|
.. cmdoption:: -v
|
|
|
|
Print the Hy version number and exit.
|