From a7b1cd2a9b042509972debd80a996156eaea7be0 Mon Sep 17 00:00:00 2001 From: ema Date: Thu, 5 Dec 2024 01:34:47 +0800 Subject: [PATCH] chore: update fetchver usage --- README.md | 11 +++++++++++ build/MicaSetup.Tools/FetchVer/CommandLine.cs | 1 + 2 files changed, 12 insertions(+) diff --git a/README.md b/README.md index 12ea1a6..e51accb 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,17 @@ MicaSetup is a universal advanced installation package generation tool project t 🚧Under construction🚧 +### Usage of `fetchver` + +```bash +@echo off +for /f "tokens=* delims=" %%i in ('fetchver.exe /v3 "fetchver.exe"') do set fetchver=%%i +@echo The result is: %fetchver% +@pause +``` + +Support options: v1, v2, v3 + ## 🎃Developer ### ⚙️Debug Codes diff --git a/build/MicaSetup.Tools/FetchVer/CommandLine.cs b/build/MicaSetup.Tools/FetchVer/CommandLine.cs index 0140471..d1ceeb7 100644 --- a/build/MicaSetup.Tools/FetchVer/CommandLine.cs +++ b/build/MicaSetup.Tools/FetchVer/CommandLine.cs @@ -135,6 +135,7 @@ public static (string, string?, string?) GetPaths(string[] args) fieldCount = args.Any(arg => arg.Equals("/v1")) ? 1 : fieldCount; fieldCount = args.Any(arg => arg.Equals("/v2")) ? 2 : fieldCount; fieldCount = args.Any(arg => arg.Equals("/v3")) ? 3 : fieldCount; + fieldCount = args.Any(arg => arg.Equals("/v4")) ? null : fieldCount; return fieldCount; } }