Files
CMLeonOS/shell/Commands/Info/Version.cs

41 lines
1.6 KiB
C#
Raw Normal View History

2026-03-08 20:22:53 +08:00
// The CMLeonOS Project (https://github.com/Leonmmcoset/CMLeonOS)
// Copyright (C) 2025-present LeonOS 2 Developer Team
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
2026-02-04 19:04:14 +08:00
using System;
2026-02-12 00:53:29 +08:00
using IL2CPU.API.Attribs;
2026-02-04 19:04:14 +08:00
namespace CMLeonOS.Commands
{
public static class VersionCommand
{
2026-02-12 00:53:29 +08:00
[ManifestResourceStream(ResourceName = "CMLeonOS.BuildTime.txt")]
private static byte[] buildTimeResource;
2026-02-04 19:04:14 +08:00
public static void ProcessVersion()
{
2026-02-12 00:53:29 +08:00
string buildTime = global::System.Text.Encoding.UTF8.GetString(buildTimeResource);
2026-02-09 02:04:58 +08:00
Console.WriteLine(Version.DisplayVersionWithGit);
2026-02-04 19:04:14 +08:00
Console.WriteLine($"Major: {Version.Major}");
Console.WriteLine($"Minor: {Version.Minor}");
Console.WriteLine($"Patch: {Version.Patch}");
2026-02-05 21:35:35 +08:00
Console.WriteLine($"Type: {Version.VersionType}");
2026-02-04 19:04:14 +08:00
Console.WriteLine($"Full Version: {Version.FullVersion}");
2026-02-09 02:04:58 +08:00
Console.WriteLine($"Git Commit: {Version.GitCommit}");
2026-02-12 00:53:29 +08:00
Console.WriteLine($"Build Time: {buildTime}");
2026-02-04 19:04:14 +08:00
}
}
}