diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2864956..ecc71c4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,4 +20,6 @@ jobs: git diff --exit-code - uses: WebAssembly/wit-abi-up-to-date@v21 with: - worlds: "command imports" + wit-bindgen: '0.28.0' + worlds: 'command imports' + features: 'cli-exit-with-code' diff --git a/command.md b/command.md index cdd51c1..5e5fe2a 100644 --- a/command.md +++ b/command.md @@ -73,6 +73,17 @@ directory, interpreting . as shorthand for this.

+

exit-with-code: func

+

Exit the current instance and any linked instances, reporting the +specified status code to the host.

+

The meaning of the code depends on the context, with 0 usually meaning +"success", and other values indicating various types of failure.

+

This function does not return; the effect is analogous to a trap, but +without the connotation that something bad has happened.

+
Params
+

Import interface wasi:io/error@0.2.0


Types

diff --git a/imports.md b/imports.md index 93e32c3..495ad20 100644 --- a/imports.md +++ b/imports.md @@ -68,6 +68,17 @@ directory, interpreting . as shorthand for this.

+

exit-with-code: func

+

Exit the current instance and any linked instances, reporting the +specified status code to the host.

+

The meaning of the code depends on the context, with 0 usually meaning +"success", and other values indicating various types of failure.

+

This function does not return; the effect is analogous to a trap, but +without the connotation that something bad has happened.

+
Params
+

Import interface wasi:io/error@0.2.0


Types

diff --git a/wit/exit.wit b/wit/exit.wit index 357e670..427935c 100644 --- a/wit/exit.wit +++ b/wit/exit.wit @@ -3,4 +3,15 @@ interface exit { /// Exit the current instance and any linked instances. @since(version = 0.2.0) exit: func(status: result); + + /// Exit the current instance and any linked instances, reporting the + /// specified status code to the host. + /// + /// The meaning of the code depends on the context, with 0 usually meaning + /// "success", and other values indicating various types of failure. + /// + /// This function does not return; the effect is analogous to a trap, but + /// without the connotation that something bad has happened. + @unstable(feature = cli-exit-with-code) + exit-with-code: func(status-code: u8); }