2022-01-10 13:28:14 +00:00
|
|
|
# Print help for `zk init`
|
|
|
|
$ zk init --help
|
|
|
|
>Usage: zk init [<directory>]
|
|
|
|
>
|
|
|
|
>Create a new notebook in the given directory.
|
|
|
|
>
|
|
|
|
>Arguments:
|
|
|
|
> [<directory>] Directory containing the notebook.
|
|
|
|
>
|
|
|
|
>Flags:
|
|
|
|
> -h, --help Show context-sensitive help.
|
|
|
|
> --notebook-dir=PATH Turn off notebook auto-discovery and set manually
|
|
|
|
> the notebook where commands are run.
|
|
|
|
> -W, --working-dir=PATH Run as if zk was started in <PATH> instead of the
|
|
|
|
> current working directory.
|
|
|
|
> --no-input Never prompt or ask for confirmation.
|
|
|
|
|
|
|
|
# Creates a new notebook in a new directory.
|
2022-05-22 14:39:13 +00:00
|
|
|
$ zk init --no-input new-dir 2> /dev/null
|
2022-01-10 13:28:14 +00:00
|
|
|
>
|
|
|
|
>Initialized a notebook in {{working-dir}}/new-dir
|
|
|
|
|
|
|
|
$ test -f new-dir/.zk/config.toml
|
|
|
|
|
|
|
|
# Creates a new notebook in an existing directory.
|
|
|
|
$ mkdir existing-dir
|
|
|
|
|
2022-05-22 14:39:13 +00:00
|
|
|
$ zk init --no-input existing-dir 2> /dev/null
|
2022-01-10 13:28:14 +00:00
|
|
|
>
|
|
|
|
>Initialized a notebook in {{working-dir}}/existing-dir
|
|
|
|
|
|
|
|
$ test -f existing-dir/.zk/config.toml
|
|
|
|
|
|
|
|
# Creates a new notebook in the current directory.
|
|
|
|
$ mkdir cur-dir && cd cur-dir
|
|
|
|
|
2022-05-22 14:39:13 +00:00
|
|
|
$ zk init --no-input 2> /dev/null
|
2022-01-10 13:28:14 +00:00
|
|
|
>
|
|
|
|
>Initialized a notebook in {{working-dir}}
|
|
|
|
|
|
|
|
$ test -f .zk/config.toml
|
|
|
|
|