Skip to content

Commit

Permalink
Default --die-when, and the Die On and Die When metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
tabatkins committed Oct 12, 2023
1 parent 33350df commit 16d4a46
Show file tree
Hide file tree
Showing 2 changed files with 567 additions and 430 deletions.
48 changes: 40 additions & 8 deletions docs/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -577,22 +577,19 @@ so they're specified before the individual commands:
and things that look a little questionable but are totally okay to generate a document with are "warning".

The `--die-on` flag controls which sorts of errors
cause Bikeshed to immediately die
cause Bikeshed to fail to produce output
and exit with a non-0 status
(indicating the command failed).

Possible values are "nothing", "fatal", "link-error", "warning", and "everything",
with each level including all previous levels.
Defaults to "fatal".

It's often useful to set this to "nothing" if you just need to push thru and generate a spec,
or if you're generating a freshly-written or freshly-ported spec that may have several errors,
where it's useful to see all the errors at once,
in case some depend on each other.
It can sometimes be useful to set this to "nothing"
if you just need to push thru and generate a spec
that happens to throw some unimportant errors
you don't have time to fix.
The `-f` flag is a shorthand for this.
(Pairing this with `-q` or `-qq` might be useful,
to suppress the non-fatal errors temporarily
and make the output easier to read.)

Alternately, it can be useful to set it to a level stricter than "fatal"
if you want to ensure that,
Expand All @@ -604,6 +601,36 @@ so they're specified before the individual commands:
but is guaranteed to always die on *all* error messages,
even if more levels are added in the future.

Note that this can also be controlled from within your document
(or your group's metadata)
via the [=Die On=] metadata.

: `--die-when = [ early | late ]`
:: When Bikeshed encounters a disallowed error
(per the `--die-on` value),
it can either die *immediately*
(`early`)
so you can see the error and fix it
without the rest of the document potentially being incorrect
and throwing nonsensical errors;
or it can wait until the end of processing (`late`) to die,
so you can see all the errors
without having to continually rerun the command.

Either way, Bikeshed will exit with a non-zero status,
and refuse to actually produce an output document.

If unspecified, this defaults to `late`.

(If using `late`
and processing a document with many output messages,
it might be useful to temporarily run it with `-q` or `-qq`,
so you can focus on the more important messages first.)

Note that this can also be controlled from within your document
(or your group's metadata)
via the [=Die When=] metadata.

: `-f` or `--force`
:: A shorthand for `--die-on=nothing`.

Expand Down Expand Up @@ -1118,6 +1145,11 @@ Several keys are required information, and will cause the processor to flag an e
There are several additional optional keys:

<ul dfn-for=metadata export>
* <dfn>Die On</dfn> and <dfn>Die When</dfn>
give the same control that the `--die-on` and `--die-when` command-line options do.
They take the same values--
a single keyword--
as the corresponding command-line arguments.
* <dfn>H1</dfn> contains the text/markup that goes into the document's <{h1}> element.
If omitted, this defaults to the value of the [=metadata/Title=] metadata,
which is usually what you want.
Expand Down
Loading

0 comments on commit 16d4a46

Please sign in to comment.