Skip to content

Commit

Permalink
Update doc site to reflect that cljs.core/*command-line-args* is po…
Browse files Browse the repository at this point in the history
…pulated
  • Loading branch information
mfikes committed Nov 23, 2017
1 parent 08327a8 commit 1cbef7c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. This change
- Eliminate doc site reference to `:static-fns` as a workaround for (fixed) JavaScriptCore perf bug.
- Update to Closure v20170910
- Update build to allow alternate `xxd -i` implementation ([#549](https://github.com/mfikes/planck/issues/549))
- Update doc site to reflect that `cljs.core/*command-line-args*` is populated.

### Fixed
- Single-dash command line args not passed to script ([#550](https://github.com/mfikes/planck/issues/550))
Expand Down
2 changes: 1 addition & 1 deletion site/src/planck-namespaces.md
Expand Up @@ -22,7 +22,7 @@ Online documentation for the namespaces is available: [Planck SDK](sdk.html).

This namespace includes basic I/O capabilities like `slurp`, `spit` and `read-line`. The I/O facilities are expressed in protocols defined in `planck.core` modeled after those in Clojure, like `IReader`, `IOutputStream`, _etc._, and these capabilities cooperate with facilities defined in `planck.io`.

Planck core also hosts some dynamic vars of interest like `*command-line-args*`, `*in*`, `*out*`.
Planck core also hosts some dynamic vars of interest like `*in*` and `*out*`.

The `planck.core/file-seq` function imitates `clojure.core/file-seq`.

Expand Down
8 changes: 3 additions & 5 deletions site/src/scripts.md
Expand Up @@ -113,13 +113,12 @@ it receives on standard input to standard out:

### Command Line Arguments

If you'd like to gain access to the command line arguments passed to your script, they are available in `planck.core/*command-line-args*` (mimicking the behavior of `clojure.core/*command-line-args*` when writing scripts with Clojure).
If you'd like to gain access to the command line arguments passed to your script, they are available in `cljs.core/*command-line-args*`.

With `bar.cljs`:

```
(ns bar.core
(:require [planck.core :refer [*command-line-args*]]))
(ns bar.core)
(println (str "Hello " (first *command-line-args*) "!"))
```
Expand Down Expand Up @@ -169,8 +168,7 @@ Commands can be executed by running the `sh` function as seen in the following e
```
#!/usr/bin/env planck
(ns foo.core
(:require [planck.shell :refer [sh]]
[planck.core :refer [*command-line-args*]]))
(:require [planck.shell :refer [sh]]))
(defn list-files [dir]
(println "listing files in" dir)
Expand Down

0 comments on commit 1cbef7c

Please sign in to comment.