Skip to content

mdbook init force flag documentation is wrong #1556

@joshrotenberg

Description

@joshrotenberg

The documentation for the force flag for the init subcommand states "Skips confirmation prompts", but it actually only affects whether a prompt is given if the --theme flag is present and the theme directory exists. It has no effect on the prompts for creating the .gitignore or getting the book name (which, ok, isn't technically a "confirmation" prompt).

The easiest fix is to just update the documentation. Another fix might be to make the .gitignore prompt also respect the flag so that the "confirmation" part is technically right. It might also be helpful to add a flag for creating the .gitignore and the book title too to round things out and make book initialization fully prompt free if someone desires.

Something like this. If --force is specified, in addition to the current behavior, init the book with the defaults for --with-gitignore and --with-title.

mdbook-init v0.4.8
Creates the boilerplate structure and files for a new book

USAGE:
    mdbook init [FLAGS] [dir]

FLAGS:
        --force             Skips confirmation prompts
    -h, --help              Prints help information
        --theme             Copies the default theme into your source folder
    -V, --version           Prints version information
        --with-gitignore    Creates a .gitignore file [default: true]
        --with-title        Set the book title [default: "my book"]

ARGS:
    <dir>    Directory to create the book in
             (Defaults to the Current Directory when omitted)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions