zk/tests/cmd-init.tesh

43 lines
1.2 KiB
Plaintext
Raw Normal View History

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.
$ 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
$ 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
$ 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