diff --git a/docs/language/cli.rst b/docs/language/cli.rst new file mode 100644 index 0000000..a0169d0 --- /dev/null +++ b/docs/language/cli.rst @@ -0,0 +1,35 @@ +====================== +Command Line Interface +====================== + +Command line options +-------------------- + +.. cmdoption:: -c + + Execute the Hy code in *command*. + + .. code-block:: bash + + $ hy -c "(print (+ 2 2))" + 4 + +.. cmdoption:: -i + + 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. diff --git a/docs/language/index.rst b/docs/language/index.rst index dc06211..5132647 100644 --- a/docs/language/index.rst +++ b/docs/language/index.rst @@ -7,6 +7,7 @@ Contents: .. toctree:: :maxdepth: 3 + cli api core internals