From b9a7353c0f5d9c1fb0a2c3eab11f0cf18b011993 Mon Sep 17 00:00:00 2001 From: Tristan Isham Date: Thu, 14 Nov 2024 12:43:13 -0500 Subject: [PATCH] added directions to use run command. --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index dc0f91c..b613d8a 100644 --- a/README.md +++ b/README.md @@ -234,6 +234,33 @@ zvm clean Use `clean` to remove build artifacts (Good if you're on Windows). +## Run installed version of Zig without switching your default + +If you want to run a version of Zig without setting it as your default, the new `run` command is your friend. + +```sh +zig version +# 0.13.0 + +zvm run 0.11.0 version +# 0.11.0 + +zig version +# 0.13.0 +``` +This can be helpful if you want to test your project on a newer version of Zig without having to switch between bins, or on alternative flavor of Zig. + +## How to use with alternative VMUs +Make sure you switch your VMU before using `run`. + +```sh +zvm vmu zig mach +run mach-latest version +# 0.14.0-dev.1911+3bf89f55c +``` + +If you would like to run the currently set Zig, please keep using the standard `zig` command. + ## Set Version Map Source ZVM lets choose your vendor for Zig and ZLS. This is great if your company hosts it's own internal fork of Zig, you prefer a different flavor of the language, like Mach.