mirror of
https://github.com/Leonmmcoset/CMLeonOS.git
synced 2026-03-03 15:30:27 +00:00
Compare commits
48 Commits
1.0.0-prer
...
c83988458a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c83988458a | ||
|
|
ffbc58eb40 | ||
|
|
c1e0651e4b | ||
|
|
5f4d97729a | ||
|
|
e8e45ef7ae | ||
|
|
2e8ef4ef91 | ||
|
|
0724502225 | ||
|
|
87d30be421 | ||
|
|
9c52f9288b | ||
|
|
969384d25f | ||
|
|
9b783e057a | ||
|
|
14149aab9d | ||
|
|
e0e7da7ac2 | ||
|
|
0386511a00 | ||
|
|
01476795ff | ||
|
|
8e60a49f10 | ||
|
|
f3226eb2ea | ||
|
|
82ecd84a35 | ||
|
|
6107ecc2db | ||
|
|
f19cad7f3a | ||
|
|
269c61ffdb | ||
|
|
b80c5b45a3 | ||
|
|
b36e3badb8 | ||
|
|
ce6d741059 | ||
|
|
03b136fd6d | ||
|
|
907cede2f6 | ||
|
|
d6f11f2c8f | ||
|
|
22c896e38c | ||
|
|
25c7326bb2 | ||
|
|
350db3140d | ||
|
|
a02aab3b20 | ||
|
|
a7bf97727a | ||
|
|
d7b60faf65 | ||
|
|
a01dd4e10c | ||
|
|
9ac476e8ea | ||
|
|
ce90efeb3e | ||
|
|
f0777b4e8b | ||
|
|
f63be62f27 | ||
|
|
0e9e9f67a1 | ||
|
|
78502324e7 | ||
|
|
ad2ed876d2 | ||
|
|
4abc6e96cf | ||
|
|
85fa99f7bd | ||
|
|
c819327f85 | ||
|
|
a71d6c40a6 | ||
|
|
6e87e44a15 | ||
|
|
ae56d2f5b1 | ||
|
|
84c4900f18 |
145
.VSCodeCounter/2026-02-06_22-40-24/details.md
Normal file
145
.VSCodeCounter/2026-02-06_22-40-24/details.md
Normal file
@@ -0,0 +1,145 @@
|
||||
# Details
|
||||
|
||||
Date : 2026-02-06 22:40:24
|
||||
|
||||
Directory c:\\Users\\leon\\source\\repos\\CMLeonOS\\CMLeonOS
|
||||
|
||||
Total : 130 files, 46331 codes, 1235 comments, 4442 blanks, all 52008 lines
|
||||
|
||||
[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
|
||||
## Files
|
||||
| filename | language | code | comment | blank | total |
|
||||
| :--- | :--- | ---: | ---: | ---: | ---: |
|
||||
| [Branswe.md](/Branswe.md) | Markdown | 261 | 0 | 67 | 328 |
|
||||
| [CMLeonOS.csproj](/CMLeonOS.csproj) | XML | 49 | 1 | 6 | 56 |
|
||||
| [Editor/Editor.cs](/Editor/Editor.cs) | C# | 267 | 29 | 35 | 331 |
|
||||
| [Editor/Nano.cs](/Editor/Nano.cs) | C# | 727 | 16 | 93 | 836 |
|
||||
| [Interpreter/Branswe.cs](/Interpreter/Branswe.cs) | C# | 482 | 28 | 53 | 563 |
|
||||
| [Interpreter/UniLua/ByteString.cs](/Interpreter/UniLua/ByteString.cs) | C# | 41 | 0 | 7 | 48 |
|
||||
| [Interpreter/UniLua/Coder.cs](/Interpreter/UniLua/Coder.cs) | C# | 1,101 | 26 | 157 | 1,284 |
|
||||
| [Interpreter/UniLua/Common.cs](/Interpreter/UniLua/Common.cs) | C# | 99 | 3 | 27 | 129 |
|
||||
| [Interpreter/UniLua/Do.cs](/Interpreter/UniLua/Do.cs) | C# | 269 | 25 | 50 | 344 |
|
||||
| [Interpreter/UniLua/Dump.cs](/Interpreter/UniLua/Dump.cs) | C# | 187 | 0 | 33 | 220 |
|
||||
| [Interpreter/UniLua/LLex.cs](/Interpreter/UniLua/LLex.cs) | C# | 627 | 40 | 93 | 760 |
|
||||
| [Interpreter/UniLua/LuaAPI.cs](/Interpreter/UniLua/LuaAPI.cs) | C# | 1,335 | 64 | 240 | 1,639 |
|
||||
| [Interpreter/UniLua/LuaAuxLib.cs](/Interpreter/UniLua/LuaAuxLib.cs) | C# | 643 | 21 | 92 | 756 |
|
||||
| [Interpreter/UniLua/LuaBaseLib.cs](/Interpreter/UniLua/LuaBaseLib.cs) | C# | 406 | 9 | 43 | 458 |
|
||||
| [Interpreter/UniLua/LuaBitLib.cs](/Interpreter/UniLua/LuaBitLib.cs) | C# | 179 | 0 | 26 | 205 |
|
||||
| [Interpreter/UniLua/LuaCoroLib.cs](/Interpreter/UniLua/LuaCoroLib.cs) | C# | 137 | 0 | 16 | 153 |
|
||||
| [Interpreter/UniLua/LuaDebug.cs](/Interpreter/UniLua/LuaDebug.cs) | C# | 443 | 19 | 55 | 517 |
|
||||
| [Interpreter/UniLua/LuaDebugLib.cs](/Interpreter/UniLua/LuaDebugLib.cs) | C# | 20 | 0 | 6 | 26 |
|
||||
| [Interpreter/UniLua/LuaEncLib.cs](/Interpreter/UniLua/LuaEncLib.cs) | C# | 51 | 0 | 13 | 64 |
|
||||
| [Interpreter/UniLua/LuaFile.cs](/Interpreter/UniLua/LuaFile.cs) | C# | 115 | 2 | 18 | 135 |
|
||||
| [Interpreter/UniLua/LuaFunc.cs](/Interpreter/UniLua/LuaFunc.cs) | C# | 69 | 6 | 20 | 95 |
|
||||
| [Interpreter/UniLua/LuaIOLib.cs](/Interpreter/UniLua/LuaIOLib.cs) | C# | 70 | 12 | 19 | 101 |
|
||||
| [Interpreter/UniLua/LuaJsonLib.cs](/Interpreter/UniLua/LuaJsonLib.cs) | C# | 461 | 0 | 65 | 526 |
|
||||
| [Interpreter/UniLua/LuaMathLib.cs](/Interpreter/UniLua/LuaMathLib.cs) | C# | 285 | 10 | 49 | 344 |
|
||||
| [Interpreter/UniLua/LuaObject.cs](/Interpreter/UniLua/LuaObject.cs) | C# | 367 | 1 | 52 | 420 |
|
||||
| [Interpreter/UniLua/LuaOsLib.cs](/Interpreter/UniLua/LuaOsLib.cs) | C# | 206 | 0 | 32 | 238 |
|
||||
| [Interpreter/UniLua/LuaPkgLib.cs](/Interpreter/UniLua/LuaPkgLib.cs) | C# | 256 | 57 | 47 | 360 |
|
||||
| [Interpreter/UniLua/LuaState.cs](/Interpreter/UniLua/LuaState.cs) | C# | 250 | 6 | 51 | 307 |
|
||||
| [Interpreter/UniLua/LuaStrLib.cs](/Interpreter/UniLua/LuaStrLib.cs) | C# | 869 | 8 | 61 | 938 |
|
||||
| [Interpreter/UniLua/LuaTable.cs](/Interpreter/UniLua/LuaTable.cs) | C# | 465 | 37 | 80 | 582 |
|
||||
| [Interpreter/UniLua/LuaTableLib.cs](/Interpreter/UniLua/LuaTableLib.cs) | C# | 250 | 8 | 24 | 282 |
|
||||
| [Interpreter/UniLua/OpCodes.cs](/Interpreter/UniLua/OpCodes.cs) | C# | 131 | 7 | 27 | 165 |
|
||||
| [Interpreter/UniLua/Parser.cs](/Interpreter/UniLua/Parser.cs) | C# | 1,588 | 139 | 219 | 1,946 |
|
||||
| [Interpreter/UniLua/TagMethod.cs](/Interpreter/UniLua/TagMethod.cs) | C# | 91 | 2 | 10 | 103 |
|
||||
| [Interpreter/UniLua/ULDebug.cs](/Interpreter/UniLua/ULDebug.cs) | C# | 13 | 2 | 5 | 20 |
|
||||
| [Interpreter/UniLua/Undump.cs](/Interpreter/UniLua/Undump.cs) | C# | 321 | 6 | 50 | 377 |
|
||||
| [Interpreter/UniLua/Util.cs](/Interpreter/UniLua/Util.cs) | C# | 192 | 8 | 39 | 239 |
|
||||
| [Interpreter/UniLua/VM.cs](/Interpreter/UniLua/VM.cs) | C# | 1,038 | 58 | 161 | 1,257 |
|
||||
| [Kernel.cs](/Kernel.cs) | C# | 228 | 33 | 43 | 304 |
|
||||
| [LISENCE.md](/LISENCE.md) | Markdown | 485 | 0 | 110 | 595 |
|
||||
| [Logger/LogEntry.cs](/Logger/LogEntry.cs) | C# | 41 | 0 | 5 | 46 |
|
||||
| [Logger/LogLevel.cs](/Logger/LogLevel.cs) | C# | 11 | 0 | 1 | 12 |
|
||||
| [Logger/Logger.cs](/Logger/Logger.cs) | C# | 94 | 0 | 18 | 112 |
|
||||
| [README.md](/README.md) | Markdown | 2 | 0 | 0 | 2 |
|
||||
| [Settings/Settings.cs](/Settings/Settings.cs) | C# | 140 | 0 | 17 | 157 |
|
||||
| [Shell/CommandList.cs](/Shell/CommandList.cs) | C# | 208 | 0 | 1 | 209 |
|
||||
| [Shell/Commands/Editor/EditCommand.cs](/Shell/Commands/Editor/EditCommand.cs) | C# | 24 | 0 | 3 | 27 |
|
||||
| [Shell/Commands/Editor/NanoCommand.cs](/Shell/Commands/Editor/NanoCommand.cs) | C# | 24 | 0 | 3 | 27 |
|
||||
| [Shell/Commands/Environment/EnvCommand.cs](/Shell/Commands/Environment/EnvCommand.cs) | C# | 107 | 0 | 8 | 115 |
|
||||
| [Shell/Commands/FileSystem/CatCommand.cs](/Shell/Commands/FileSystem/CatCommand.cs) | C# | 18 | 0 | 2 | 20 |
|
||||
| [Shell/Commands/FileSystem/CdCommand.cs](/Shell/Commands/FileSystem/CdCommand.cs) | C# | 10 | 0 | 1 | 11 |
|
||||
| [Shell/Commands/FileSystem/CopyCommand.cs](/Shell/Commands/FileSystem/CopyCommand.cs) | C# | 40 | 0 | 6 | 46 |
|
||||
| [Shell/Commands/FileSystem/DiskInfoCommand.cs](/Shell/Commands/FileSystem/DiskInfoCommand.cs) | C# | 28 | 0 | 5 | 33 |
|
||||
| [Shell/Commands/FileSystem/FindCommand.cs](/Shell/Commands/FileSystem/FindCommand.cs) | C# | 37 | 0 | 5 | 42 |
|
||||
| [Shell/Commands/FileSystem/HeadCommand.cs](/Shell/Commands/FileSystem/HeadCommand.cs) | C# | 46 | 0 | 8 | 54 |
|
||||
| [Shell/Commands/FileSystem/LsCommand.cs](/Shell/Commands/FileSystem/LsCommand.cs) | C# | 10 | 0 | 1 | 11 |
|
||||
| [Shell/Commands/FileSystem/MkdirCommand.cs](/Shell/Commands/FileSystem/MkdirCommand.cs) | C# | 20 | 0 | 2 | 22 |
|
||||
| [Shell/Commands/FileSystem/MoveCommand.cs](/Shell/Commands/FileSystem/MoveCommand.cs) | C# | 41 | 0 | 7 | 48 |
|
||||
| [Shell/Commands/FileSystem/PwdCommand.cs](/Shell/Commands/FileSystem/PwdCommand.cs) | C# | 11 | 0 | 2 | 13 |
|
||||
| [Shell/Commands/FileSystem/RenameCommand.cs](/Shell/Commands/FileSystem/RenameCommand.cs) | C# | 48 | 0 | 9 | 57 |
|
||||
| [Shell/Commands/FileSystem/RmCommand.cs](/Shell/Commands/FileSystem/RmCommand.cs) | C# | 42 | 0 | 5 | 47 |
|
||||
| [Shell/Commands/FileSystem/RmdirCommand.cs](/Shell/Commands/FileSystem/RmdirCommand.cs) | C# | 27 | 0 | 3 | 30 |
|
||||
| [Shell/Commands/FileSystem/TailCommand.cs](/Shell/Commands/FileSystem/TailCommand.cs) | C# | 47 | 0 | 8 | 55 |
|
||||
| [Shell/Commands/FileSystem/TouchCommand.cs](/Shell/Commands/FileSystem/TouchCommand.cs) | C# | 25 | 0 | 3 | 28 |
|
||||
| [Shell/Commands/FileSystem/TreeCommand.cs](/Shell/Commands/FileSystem/TreeCommand.cs) | C# | 67 | 0 | 11 | 78 |
|
||||
| [Shell/Commands/FileSystem/WordCountCommand.cs](/Shell/Commands/FileSystem/WordCountCommand.cs) | C# | 45 | 0 | 6 | 51 |
|
||||
| [Shell/Commands/Help/Help.cs](/Shell/Commands/Help/Help.cs) | C# | 507 | 0 | 26 | 533 |
|
||||
| [Shell/Commands/Info/About.cs](/Shell/Commands/Info/About.cs) | C# | 12 | 0 | 2 | 14 |
|
||||
| [Shell/Commands/Info/Version.cs](/Shell/Commands/Info/Version.cs) | C# | 16 | 0 | 2 | 18 |
|
||||
| [Shell/Commands/LabyrinthCommand.cs](/Shell/Commands/LabyrinthCommand.cs) | C# | 224 | 0 | 24 | 248 |
|
||||
| [Shell/Commands/Power/RestartCommand.cs](/Shell/Commands/Power/RestartCommand.cs) | C# | 13 | 0 | 2 | 15 |
|
||||
| [Shell/Commands/Power/ShutdownCommand.cs](/Shell/Commands/Power/ShutdownCommand.cs) | C# | 13 | 0 | 2 | 15 |
|
||||
| [Shell/Commands/Script/BransweCommand.cs](/Shell/Commands/Script/BransweCommand.cs) | C# | 32 | 0 | 5 | 37 |
|
||||
| [Shell/Commands/Script/ComCommand.cs](/Shell/Commands/Script/ComCommand.cs) | C# | 43 | 0 | 8 | 51 |
|
||||
| [Shell/Commands/Script/LuaCommand.cs](/Shell/Commands/Script/LuaCommand.cs) | C# | 165 | 0 | 21 | 186 |
|
||||
| [Shell/Commands/System/ClearCommand.cs](/Shell/Commands/System/ClearCommand.cs) | C# | 11 | 0 | 2 | 13 |
|
||||
| [Shell/Commands/System/DateCommand.cs](/Shell/Commands/System/DateCommand.cs) | C# | 11 | 0 | 2 | 13 |
|
||||
| [Shell/Commands/System/EchoCommand.cs](/Shell/Commands/System/EchoCommand.cs) | C# | 12 | 0 | 2 | 14 |
|
||||
| [Shell/Commands/System/SettingsCommand.cs](/Shell/Commands/System/SettingsCommand.cs) | C# | 62 | 0 | 8 | 70 |
|
||||
| [Shell/Commands/System/TimeCommand.cs](/Shell/Commands/System/TimeCommand.cs) | C# | 11 | 0 | 2 | 13 |
|
||||
| [Shell/Commands/System/UptimeCommand.cs](/Shell/Commands/System/UptimeCommand.cs) | C# | 40 | 0 | 6 | 46 |
|
||||
| [Shell/Commands/System/WhoamiCommand.cs](/Shell/Commands/System/WhoamiCommand.cs) | C# | 16 | 0 | 2 | 18 |
|
||||
| [Shell/Commands/TestGuiCommand.cs](/Shell/Commands/TestGuiCommand.cs) | C# | 77 | 0 | 9 | 86 |
|
||||
| [Shell/Commands/User/CpassCommand.cs](/Shell/Commands/User/CpassCommand.cs) | C# | 10 | 0 | 1 | 11 |
|
||||
| [Shell/Commands/User/HostnameCommand.cs](/Shell/Commands/User/HostnameCommand.cs) | C# | 16 | 0 | 3 | 19 |
|
||||
| [Shell/Commands/User/UserCommand.cs](/Shell/Commands/User/UserCommand.cs) | C# | 74 | 0 | 11 | 85 |
|
||||
| [Shell/Commands/Utility/AliasCommand.cs](/Shell/Commands/Utility/AliasCommand.cs) | C# | 140 | 0 | 19 | 159 |
|
||||
| [Shell/Commands/Utility/BackgroundCommand.cs](/Shell/Commands/Utility/BackgroundCommand.cs) | C# | 108 | 0 | 9 | 117 |
|
||||
| [Shell/Commands/Utility/Base64Command.cs](/Shell/Commands/Utility/Base64Command.cs) | C# | 58 | 0 | 10 | 68 |
|
||||
| [Shell/Commands/Utility/BeepCommand.cs](/Shell/Commands/Utility/BeepCommand.cs) | C# | 11 | 0 | 2 | 13 |
|
||||
| [Shell/Commands/Utility/CalcCommand.cs](/Shell/Commands/Utility/CalcCommand.cs) | C# | 56 | 0 | 4 | 60 |
|
||||
| [Shell/Commands/Utility/CalendarCommand.cs](/Shell/Commands/Utility/CalendarCommand.cs) | C# | 57 | 0 | 13 | 70 |
|
||||
| [Shell/Commands/Utility/HistoryCommand.cs](/Shell/Commands/Utility/HistoryCommand.cs) | C# | 15 | 0 | 2 | 17 |
|
||||
| [Shell/Commands/Utility/PromptCommand.cs](/Shell/Commands/Utility/PromptCommand.cs) | C# | 18 | 0 | 2 | 20 |
|
||||
| [Shell/Shell.cs](/Shell/Shell.cs) | C# | 1,458 | 23 | 265 | 1,746 |
|
||||
| [System/FileSystem.cs](/System/FileSystem.cs) | C# | 400 | 17 | 40 | 457 |
|
||||
| [System/UserSystem.cs](/System/UserSystem.cs) | C# | 683 | 22 | 105 | 810 |
|
||||
| [UI/CUI.cs](/UI/CUI.cs) | C# | 122 | 8 | 28 | 158 |
|
||||
| [Utils/Base64.cs](/Utils/Base64.cs) | C# | 86 | 56 | 22 | 164 |
|
||||
| [Utils/EnvironmentVariableManager.cs](/Utils/EnvironmentVariableManager.cs) | C# | 151 | 5 | 17 | 173 |
|
||||
| [Utils/NetworkConfigManager.cs](/Utils/NetworkConfigManager.cs) | C# | 111 | 0 | 16 | 127 |
|
||||
| [Utils/SHA256.cs](/Utils/SHA256.cs) | C# | 179 | 6 | 41 | 226 |
|
||||
| [Utils/Version.cs](/Utils/Version.cs) | C# | 23 | 0 | 5 | 28 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/@vue\_devtools-api.js](/docs/cmleonos/docs/.vuepress/.cache/deps/@vue_devtools-api.js) | JavaScript | 4,356 | 145 | 5 | 4,506 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/@vuepress\_shared.js](/docs/cmleonos/docs/.vuepress/.cache/deps/@vuepress_shared.js) | JavaScript | 134 | 2 | 1 | 137 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/\_metadata.json](/docs/cmleonos/docs/.vuepress/.cache/deps/_metadata.json) | JSON | 37 | 0 | 0 | 37 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/chunk-OARA6QKZ.js](/docs/cmleonos/docs/.vuepress/.cache/deps/chunk-OARA6QKZ.js) | JavaScript | 12,582 | 238 | 5 | 12,825 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/package.json](/docs/cmleonos/docs/.vuepress/.cache/deps/package.json) | JSON | 3 | 0 | 1 | 4 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/vue-router.js](/docs/cmleonos/docs/.vuepress/.cache/deps/vue-router.js) | JavaScript | 2,371 | 25 | 9 | 2,405 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/vue.js](/docs/cmleonos/docs/.vuepress/.cache/deps/vue.js) | JavaScript | 346 | 0 | 1 | 347 |
|
||||
| [docs/cmleonos/docs/.vuepress/config.js](/docs/cmleonos/docs/.vuepress/config.js) | JavaScript | 12 | 1 | 7 | 20 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/404.html](/docs/cmleonos/docs/.vuepress/dist/404.html) | HTML | 40 | 0 | 4 | 44 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/404.html-B-2P5V78.js](/docs/cmleonos/docs/.vuepress/dist/assets/404.html-B-2P5V78.js) | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/app-BITa06va.js](/docs/cmleonos/docs/.vuepress/dist/assets/app-BITa06va.js) | JavaScript | 28 | 4 | 1 | 33 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/commands.html-CJdMGWM7.js](/docs/cmleonos/docs/.vuepress/dist/assets/commands.html-CJdMGWM7.js) | JavaScript | 143 | 0 | 1 | 144 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-D\_vM18Nz.js](/docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-D_vM18Nz.js) | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/index.html-DS7rXIvH.js](/docs/cmleonos/docs/.vuepress/dist/assets/index.html-DS7rXIvH.js) | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/lua.html-DxDsLuB0.js](/docs/cmleonos/docs/.vuepress/dist/assets/lua.html-DxDsLuB0.js) | JavaScript | 297 | 0 | 1 | 298 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/style-BmL0kmLr.css](/docs/cmleonos/docs/.vuepress/dist/assets/style-BmL0kmLr.css) | PostCSS | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/commands.html](/docs/cmleonos/docs/.vuepress/dist/commands.html) | HTML | 182 | 0 | 4 | 186 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/get-started.html](/docs/cmleonos/docs/.vuepress/dist/get-started.html) | HTML | 40 | 0 | 4 | 44 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/index.html](/docs/cmleonos/docs/.vuepress/dist/index.html) | HTML | 40 | 0 | 4 | 44 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/lua.html](/docs/cmleonos/docs/.vuepress/dist/lua.html) | HTML | 336 | 0 | 4 | 340 |
|
||||
| [docs/cmleonos/docs/README.md](/docs/cmleonos/docs/README.md) | Markdown | 33 | 0 | 4 | 37 |
|
||||
| [docs/cmleonos/docs/commands.md](/docs/cmleonos/docs/commands.md) | Markdown | 629 | 0 | 191 | 820 |
|
||||
| [docs/cmleonos/docs/get-started.md](/docs/cmleonos/docs/get-started.md) | Markdown | 14 | 0 | 3 | 17 |
|
||||
| [docs/cmleonos/docs/lua.md](/docs/cmleonos/docs/lua.md) | Markdown | 940 | 0 | 339 | 1,279 |
|
||||
| [docs/cmleonos/package.json](/docs/cmleonos/package.json) | JSON | 20 | 0 | 1 | 21 |
|
||||
| [docs/cmleonos/pnpm-lock.yaml](/docs/cmleonos/pnpm-lock.yaml) | YAML | 2,410 | 0 | 674 | 3,084 |
|
||||
| [global.json](/global.json) | JSON | 6 | 0 | 0 | 6 |
|
||||
|
||||
[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
36
.VSCodeCounter/2026-02-06_22-40-24/diff-details.md
Normal file
36
.VSCodeCounter/2026-02-06_22-40-24/diff-details.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# Diff Details
|
||||
|
||||
Date : 2026-02-06 22:40:24
|
||||
|
||||
Directory c:\\Users\\leon\\source\\repos\\CMLeonOS\\CMLeonOS
|
||||
|
||||
Total : 21 files, 692 codes, 0 comments, 53 blanks, all 745 lines
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details
|
||||
|
||||
## Files
|
||||
| filename | language | code | comment | blank | total |
|
||||
| :--- | :--- | ---: | ---: | ---: | ---: |
|
||||
| [Shell/CommandList.cs](/Shell/CommandList.cs) | C# | 3 | 0 | 0 | 3 |
|
||||
| [Shell/Commands/Help/Help.cs](/Shell/Commands/Help/Help.cs) | C# | 351 | 0 | 11 | 362 |
|
||||
| [Shell/Commands/LabyrinthCommand.cs](/Shell/Commands/LabyrinthCommand.cs) | C# | 224 | 0 | 24 | 248 |
|
||||
| [Shell/Commands/System/SettingsCommand.cs](/Shell/Commands/System/SettingsCommand.cs) | C# | 10 | 0 | 3 | 13 |
|
||||
| [Shell/Commands/User/UserCommand.cs](/Shell/Commands/User/UserCommand.cs) | C# | 10 | 0 | 3 | 13 |
|
||||
| [Shell/Shell.cs](/Shell/Shell.cs) | C# | 7 | 0 | 1 | 8 |
|
||||
| [System/UserSystem.cs](/System/UserSystem.cs) | C# | 38 | 0 | 4 | 42 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/404.html-B-2P5V78.js](/docs/cmleonos/docs/.vuepress/dist/assets/404.html-B-2P5V78.js) | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/404.html-xATCGIq8.js](/docs/cmleonos/docs/.vuepress/dist/assets/404.html-xATCGIq8.js) | JavaScript | -1 | 0 | -1 | -2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/app-BITa06va.js](/docs/cmleonos/docs/.vuepress/dist/assets/app-BITa06va.js) | JavaScript | 28 | 4 | 1 | 33 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/app-DOooOitT.js](/docs/cmleonos/docs/.vuepress/dist/assets/app-DOooOitT.js) | JavaScript | -28 | -4 | -1 | -33 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/commands.html-2c\_EJOV\_.js](/docs/cmleonos/docs/.vuepress/dist/assets/commands.html-2c_EJOV_.js) | JavaScript | -135 | 0 | -1 | -136 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/commands.html-CJdMGWM7.js](/docs/cmleonos/docs/.vuepress/dist/assets/commands.html-CJdMGWM7.js) | JavaScript | 143 | 0 | 1 | 144 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-D7YgC\_d3.js](/docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-D7YgC_d3.js) | JavaScript | -1 | 0 | -1 | -2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-D\_vM18Nz.js](/docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-D_vM18Nz.js) | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/index.html-DOUHF5Iy.js](/docs/cmleonos/docs/.vuepress/dist/assets/index.html-DOUHF5Iy.js) | JavaScript | -1 | 0 | -1 | -2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/index.html-DS7rXIvH.js](/docs/cmleonos/docs/.vuepress/dist/assets/index.html-DS7rXIvH.js) | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/lua.html-D4WURWuq.js](/docs/cmleonos/docs/.vuepress/dist/assets/lua.html-D4WURWuq.js) | JavaScript | -297 | 0 | -1 | -298 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/lua.html-DxDsLuB0.js](/docs/cmleonos/docs/.vuepress/dist/assets/lua.html-DxDsLuB0.js) | JavaScript | 297 | 0 | 1 | 298 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/commands.html](/docs/cmleonos/docs/.vuepress/dist/commands.html) | HTML | 8 | 0 | 0 | 8 |
|
||||
| [docs/cmleonos/docs/commands.md](/docs/cmleonos/docs/commands.md) | Markdown | 33 | 0 | 7 | 40 |
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details
|
||||
23
.VSCodeCounter/2026-02-06_22-40-24/diff.csv
Normal file
23
.VSCodeCounter/2026-02-06_22-40-24/diff.csv
Normal file
@@ -0,0 +1,23 @@
|
||||
"filename", "language", "C#", "Markdown", "HTML", "JavaScript", "comment", "blank", "total"
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs", "C#", 3, 0, 0, 0, 0, 0, 3
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs", "C#", 351, 0, 0, 0, 0, 11, 362
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\LabyrinthCommand.cs", "C#", 224, 0, 0, 0, 0, 24, 248
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\SettingsCommand.cs", "C#", 10, 0, 0, 0, 0, 3, 13
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs", "C#", 10, 0, 0, 0, 0, 3, 13
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs", "C#", 7, 0, 0, 0, 0, 1, 8
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs", "C#", 38, 0, 0, 0, 0, 4, 42
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-B-2P5V78.js", "JavaScript", 0, 0, 0, 1, 0, 1, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-xATCGIq8.js", "JavaScript", 0, 0, 0, -1, 0, -1, -2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-BITa06va.js", "JavaScript", 0, 0, 0, 28, 4, 1, 33
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-DOooOitT.js", "JavaScript", 0, 0, 0, -28, -4, -1, -33
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-2c_EJOV_.js", "JavaScript", 0, 0, 0, -135, 0, -1, -136
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-CJdMGWM7.js", "JavaScript", 0, 0, 0, 143, 0, 1, 144
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-D7YgC_d3.js", "JavaScript", 0, 0, 0, -1, 0, -1, -2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-D_vM18Nz.js", "JavaScript", 0, 0, 0, 1, 0, 1, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-DOUHF5Iy.js", "JavaScript", 0, 0, 0, -1, 0, -1, -2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-DS7rXIvH.js", "JavaScript", 0, 0, 0, 1, 0, 1, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-D4WURWuq.js", "JavaScript", 0, 0, 0, -297, 0, -1, -298
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-DxDsLuB0.js", "JavaScript", 0, 0, 0, 297, 0, 1, 298
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\commands.html", "HTML", 0, 0, 8, 0, 0, 0, 8
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\commands.md", "Markdown", 0, 33, 0, 0, 0, 7, 40
|
||||
"Total", "-", 643, 33, 8, 8, 0, 53, 745
|
||||
|
40
.VSCodeCounter/2026-02-06_22-40-24/diff.md
Normal file
40
.VSCodeCounter/2026-02-06_22-40-24/diff.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# Diff Summary
|
||||
|
||||
Date : 2026-02-06 22:40:24
|
||||
|
||||
Directory c:\\Users\\leon\\source\\repos\\CMLeonOS\\CMLeonOS
|
||||
|
||||
Total : 21 files, 692 codes, 0 comments, 53 blanks, all 745 lines
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md)
|
||||
|
||||
## Languages
|
||||
| language | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| C# | 7 | 643 | 0 | 46 | 689 |
|
||||
| Markdown | 1 | 33 | 0 | 7 | 40 |
|
||||
| HTML | 1 | 8 | 0 | 0 | 8 |
|
||||
| JavaScript | 12 | 8 | 0 | 0 | 8 |
|
||||
|
||||
## Directories
|
||||
| path | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| . | 21 | 692 | 0 | 53 | 745 |
|
||||
| Shell | 6 | 605 | 0 | 42 | 647 |
|
||||
| Shell (Files) | 2 | 10 | 0 | 1 | 11 |
|
||||
| Shell\\Commands | 4 | 595 | 0 | 41 | 636 |
|
||||
| Shell\\Commands (Files) | 1 | 224 | 0 | 24 | 248 |
|
||||
| Shell\\Commands\\Help | 1 | 351 | 0 | 11 | 362 |
|
||||
| Shell\\Commands\\System | 1 | 10 | 0 | 3 | 13 |
|
||||
| Shell\\Commands\\User | 1 | 10 | 0 | 3 | 13 |
|
||||
| System | 1 | 38 | 0 | 4 | 42 |
|
||||
| docs | 14 | 49 | 0 | 7 | 56 |
|
||||
| docs\\cmleonos | 14 | 49 | 0 | 7 | 56 |
|
||||
| docs\\cmleonos\\docs | 14 | 49 | 0 | 7 | 56 |
|
||||
| docs\\cmleonos\\docs (Files) | 1 | 33 | 0 | 7 | 40 |
|
||||
| docs\\cmleonos\\docs\\.vuepress | 13 | 16 | 0 | 0 | 16 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\dist | 13 | 16 | 0 | 0 | 16 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\dist (Files) | 1 | 8 | 0 | 0 | 8 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\dist\\assets | 12 | 8 | 0 | 0 | 8 |
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md)
|
||||
64
.VSCodeCounter/2026-02-06_22-40-24/diff.txt
Normal file
64
.VSCodeCounter/2026-02-06_22-40-24/diff.txt
Normal file
@@ -0,0 +1,64 @@
|
||||
Date : 2026-02-06 22:40:24
|
||||
Directory : c:\Users\leon\source\repos\CMLeonOS\CMLeonOS
|
||||
Total : 21 files, 692 codes, 0 comments, 53 blanks, all 745 lines
|
||||
|
||||
Languages
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
| language | files | code | comment | blank | total |
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
| C# | 7 | 643 | 0 | 46 | 689 |
|
||||
| Markdown | 1 | 33 | 0 | 7 | 40 |
|
||||
| HTML | 1 | 8 | 0 | 0 | 8 |
|
||||
| JavaScript | 12 | 8 | 0 | 0 | 8 |
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
|
||||
Directories
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| path | files | code | comment | blank | total |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| . | 21 | 692 | 0 | 53 | 745 |
|
||||
| Shell | 6 | 605 | 0 | 42 | 647 |
|
||||
| Shell (Files) | 2 | 10 | 0 | 1 | 11 |
|
||||
| Shell\Commands | 4 | 595 | 0 | 41 | 636 |
|
||||
| Shell\Commands (Files) | 1 | 224 | 0 | 24 | 248 |
|
||||
| Shell\Commands\Help | 1 | 351 | 0 | 11 | 362 |
|
||||
| Shell\Commands\System | 1 | 10 | 0 | 3 | 13 |
|
||||
| Shell\Commands\User | 1 | 10 | 0 | 3 | 13 |
|
||||
| System | 1 | 38 | 0 | 4 | 42 |
|
||||
| docs | 14 | 49 | 0 | 7 | 56 |
|
||||
| docs\cmleonos | 14 | 49 | 0 | 7 | 56 |
|
||||
| docs\cmleonos\docs | 14 | 49 | 0 | 7 | 56 |
|
||||
| docs\cmleonos\docs (Files) | 1 | 33 | 0 | 7 | 40 |
|
||||
| docs\cmleonos\docs\.vuepress | 13 | 16 | 0 | 0 | 16 |
|
||||
| docs\cmleonos\docs\.vuepress\dist | 13 | 16 | 0 | 0 | 16 |
|
||||
| docs\cmleonos\docs\.vuepress\dist (Files) | 1 | 8 | 0 | 0 | 8 |
|
||||
| docs\cmleonos\docs\.vuepress\dist\assets | 12 | 8 | 0 | 0 | 8 |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
|
||||
Files
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| filename | language | code | comment | blank | total |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs | C# | 3 | 0 | 0 | 3 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs | C# | 351 | 0 | 11 | 362 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\LabyrinthCommand.cs | C# | 224 | 0 | 24 | 248 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\SettingsCommand.cs | C# | 10 | 0 | 3 | 13 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs | C# | 10 | 0 | 3 | 13 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs | C# | 7 | 0 | 1 | 8 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs | C# | 38 | 0 | 4 | 42 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-B-2P5V78.js | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-xATCGIq8.js | JavaScript | -1 | 0 | -1 | -2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-BITa06va.js | JavaScript | 28 | 4 | 1 | 33 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-DOooOitT.js | JavaScript | -28 | -4 | -1 | -33 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-2c_EJOV_.js | JavaScript | -135 | 0 | -1 | -136 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-CJdMGWM7.js | JavaScript | 143 | 0 | 1 | 144 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-D7YgC_d3.js | JavaScript | -1 | 0 | -1 | -2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-D_vM18Nz.js | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-DOUHF5Iy.js | JavaScript | -1 | 0 | -1 | -2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-DS7rXIvH.js | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-D4WURWuq.js | JavaScript | -297 | 0 | -1 | -298 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-DxDsLuB0.js | JavaScript | 297 | 0 | 1 | 298 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\commands.html | HTML | 8 | 0 | 0 | 8 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\commands.md | Markdown | 33 | 0 | 7 | 40 |
|
||||
| Total | | 692 | 0 | 53 | 745 |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
132
.VSCodeCounter/2026-02-06_22-40-24/results.csv
Normal file
132
.VSCodeCounter/2026-02-06_22-40-24/results.csv
Normal file
@@ -0,0 +1,132 @@
|
||||
"filename", "language", "C#", "Markdown", "JSON", "XML", "YAML", "HTML", "JavaScript", "PostCSS", "comment", "blank", "total"
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Branswe.md", "Markdown", 0, 261, 0, 0, 0, 0, 0, 0, 0, 67, 328
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\CMLeonOS.csproj", "XML", 0, 0, 0, 49, 0, 0, 0, 0, 1, 6, 56
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Editor.cs", "C#", 267, 0, 0, 0, 0, 0, 0, 0, 29, 35, 331
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Nano.cs", "C#", 727, 0, 0, 0, 0, 0, 0, 0, 16, 93, 836
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\Branswe.cs", "C#", 482, 0, 0, 0, 0, 0, 0, 0, 28, 53, 563
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\ByteString.cs", "C#", 41, 0, 0, 0, 0, 0, 0, 0, 0, 7, 48
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Coder.cs", "C#", 1101, 0, 0, 0, 0, 0, 0, 0, 26, 157, 1284
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Common.cs", "C#", 99, 0, 0, 0, 0, 0, 0, 0, 3, 27, 129
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Do.cs", "C#", 269, 0, 0, 0, 0, 0, 0, 0, 25, 50, 344
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Dump.cs", "C#", 187, 0, 0, 0, 0, 0, 0, 0, 0, 33, 220
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LLex.cs", "C#", 627, 0, 0, 0, 0, 0, 0, 0, 40, 93, 760
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaAPI.cs", "C#", 1335, 0, 0, 0, 0, 0, 0, 0, 64, 240, 1639
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaAuxLib.cs", "C#", 643, 0, 0, 0, 0, 0, 0, 0, 21, 92, 756
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaBaseLib.cs", "C#", 406, 0, 0, 0, 0, 0, 0, 0, 9, 43, 458
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaBitLib.cs", "C#", 179, 0, 0, 0, 0, 0, 0, 0, 0, 26, 205
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaCoroLib.cs", "C#", 137, 0, 0, 0, 0, 0, 0, 0, 0, 16, 153
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaDebug.cs", "C#", 443, 0, 0, 0, 0, 0, 0, 0, 19, 55, 517
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaDebugLib.cs", "C#", 20, 0, 0, 0, 0, 0, 0, 0, 0, 6, 26
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaEncLib.cs", "C#", 51, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaFile.cs", "C#", 115, 0, 0, 0, 0, 0, 0, 0, 2, 18, 135
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaFunc.cs", "C#", 69, 0, 0, 0, 0, 0, 0, 0, 6, 20, 95
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaIOLib.cs", "C#", 70, 0, 0, 0, 0, 0, 0, 0, 12, 19, 101
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaJsonLib.cs", "C#", 461, 0, 0, 0, 0, 0, 0, 0, 0, 65, 526
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaMathLib.cs", "C#", 285, 0, 0, 0, 0, 0, 0, 0, 10, 49, 344
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaObject.cs", "C#", 367, 0, 0, 0, 0, 0, 0, 0, 1, 52, 420
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaOsLib.cs", "C#", 206, 0, 0, 0, 0, 0, 0, 0, 0, 32, 238
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaPkgLib.cs", "C#", 256, 0, 0, 0, 0, 0, 0, 0, 57, 47, 360
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaState.cs", "C#", 250, 0, 0, 0, 0, 0, 0, 0, 6, 51, 307
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaStrLib.cs", "C#", 869, 0, 0, 0, 0, 0, 0, 0, 8, 61, 938
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaTable.cs", "C#", 465, 0, 0, 0, 0, 0, 0, 0, 37, 80, 582
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaTableLib.cs", "C#", 250, 0, 0, 0, 0, 0, 0, 0, 8, 24, 282
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\OpCodes.cs", "C#", 131, 0, 0, 0, 0, 0, 0, 0, 7, 27, 165
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Parser.cs", "C#", 1588, 0, 0, 0, 0, 0, 0, 0, 139, 219, 1946
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\TagMethod.cs", "C#", 91, 0, 0, 0, 0, 0, 0, 0, 2, 10, 103
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\ULDebug.cs", "C#", 13, 0, 0, 0, 0, 0, 0, 0, 2, 5, 20
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Undump.cs", "C#", 321, 0, 0, 0, 0, 0, 0, 0, 6, 50, 377
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Util.cs", "C#", 192, 0, 0, 0, 0, 0, 0, 0, 8, 39, 239
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\VM.cs", "C#", 1038, 0, 0, 0, 0, 0, 0, 0, 58, 161, 1257
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Kernel.cs", "C#", 228, 0, 0, 0, 0, 0, 0, 0, 33, 43, 304
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LISENCE.md", "Markdown", 0, 485, 0, 0, 0, 0, 0, 0, 0, 110, 595
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\LogEntry.cs", "C#", 41, 0, 0, 0, 0, 0, 0, 0, 0, 5, 46
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\LogLevel.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\Logger.cs", "C#", 94, 0, 0, 0, 0, 0, 0, 0, 0, 18, 112
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\README.md", "Markdown", 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Settings\Settings.cs", "C#", 140, 0, 0, 0, 0, 0, 0, 0, 0, 17, 157
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs", "C#", 208, 0, 0, 0, 0, 0, 0, 0, 0, 1, 209
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Editor\EditCommand.cs", "C#", 24, 0, 0, 0, 0, 0, 0, 0, 0, 3, 27
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Editor\NanoCommand.cs", "C#", 24, 0, 0, 0, 0, 0, 0, 0, 0, 3, 27
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Environment\EnvCommand.cs", "C#", 107, 0, 0, 0, 0, 0, 0, 0, 0, 8, 115
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CatCommand.cs", "C#", 18, 0, 0, 0, 0, 0, 0, 0, 0, 2, 20
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CdCommand.cs", "C#", 10, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CopyCommand.cs", "C#", 40, 0, 0, 0, 0, 0, 0, 0, 0, 6, 46
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\DiskInfoCommand.cs", "C#", 28, 0, 0, 0, 0, 0, 0, 0, 0, 5, 33
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\FindCommand.cs", "C#", 37, 0, 0, 0, 0, 0, 0, 0, 0, 5, 42
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\HeadCommand.cs", "C#", 46, 0, 0, 0, 0, 0, 0, 0, 0, 8, 54
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\LsCommand.cs", "C#", 10, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\MkdirCommand.cs", "C#", 20, 0, 0, 0, 0, 0, 0, 0, 0, 2, 22
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\MoveCommand.cs", "C#", 41, 0, 0, 0, 0, 0, 0, 0, 0, 7, 48
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\PwdCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 2, 13
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RenameCommand.cs", "C#", 48, 0, 0, 0, 0, 0, 0, 0, 0, 9, 57
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmCommand.cs", "C#", 42, 0, 0, 0, 0, 0, 0, 0, 0, 5, 47
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmdirCommand.cs", "C#", 27, 0, 0, 0, 0, 0, 0, 0, 0, 3, 30
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TailCommand.cs", "C#", 47, 0, 0, 0, 0, 0, 0, 0, 0, 8, 55
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TouchCommand.cs", "C#", 25, 0, 0, 0, 0, 0, 0, 0, 0, 3, 28
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TreeCommand.cs", "C#", 67, 0, 0, 0, 0, 0, 0, 0, 0, 11, 78
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\WordCountCommand.cs", "C#", 45, 0, 0, 0, 0, 0, 0, 0, 0, 6, 51
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs", "C#", 507, 0, 0, 0, 0, 0, 0, 0, 0, 26, 533
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\About.cs", "C#", 12, 0, 0, 0, 0, 0, 0, 0, 0, 2, 14
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\Version.cs", "C#", 16, 0, 0, 0, 0, 0, 0, 0, 0, 2, 18
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\LabyrinthCommand.cs", "C#", 224, 0, 0, 0, 0, 0, 0, 0, 0, 24, 248
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Power\RestartCommand.cs", "C#", 13, 0, 0, 0, 0, 0, 0, 0, 0, 2, 15
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Power\ShutdownCommand.cs", "C#", 13, 0, 0, 0, 0, 0, 0, 0, 0, 2, 15
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\BransweCommand.cs", "C#", 32, 0, 0, 0, 0, 0, 0, 0, 0, 5, 37
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\ComCommand.cs", "C#", 43, 0, 0, 0, 0, 0, 0, 0, 0, 8, 51
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\LuaCommand.cs", "C#", 165, 0, 0, 0, 0, 0, 0, 0, 0, 21, 186
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\ClearCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 2, 13
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\DateCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 2, 13
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\EchoCommand.cs", "C#", 12, 0, 0, 0, 0, 0, 0, 0, 0, 2, 14
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\SettingsCommand.cs", "C#", 62, 0, 0, 0, 0, 0, 0, 0, 0, 8, 70
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\TimeCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 2, 13
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\UptimeCommand.cs", "C#", 40, 0, 0, 0, 0, 0, 0, 0, 0, 6, 46
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\WhoamiCommand.cs", "C#", 16, 0, 0, 0, 0, 0, 0, 0, 0, 2, 18
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\TestGuiCommand.cs", "C#", 77, 0, 0, 0, 0, 0, 0, 0, 0, 9, 86
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\CpassCommand.cs", "C#", 10, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\HostnameCommand.cs", "C#", 16, 0, 0, 0, 0, 0, 0, 0, 0, 3, 19
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs", "C#", 74, 0, 0, 0, 0, 0, 0, 0, 0, 11, 85
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\AliasCommand.cs", "C#", 140, 0, 0, 0, 0, 0, 0, 0, 0, 19, 159
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\BackgroundCommand.cs", "C#", 108, 0, 0, 0, 0, 0, 0, 0, 0, 9, 117
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\Base64Command.cs", "C#", 58, 0, 0, 0, 0, 0, 0, 0, 0, 10, 68
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\BeepCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 2, 13
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalcCommand.cs", "C#", 56, 0, 0, 0, 0, 0, 0, 0, 0, 4, 60
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalendarCommand.cs", "C#", 57, 0, 0, 0, 0, 0, 0, 0, 0, 13, 70
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\HistoryCommand.cs", "C#", 15, 0, 0, 0, 0, 0, 0, 0, 0, 2, 17
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\PromptCommand.cs", "C#", 18, 0, 0, 0, 0, 0, 0, 0, 0, 2, 20
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs", "C#", 1458, 0, 0, 0, 0, 0, 0, 0, 23, 265, 1746
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\FileSystem.cs", "C#", 400, 0, 0, 0, 0, 0, 0, 0, 17, 40, 457
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs", "C#", 683, 0, 0, 0, 0, 0, 0, 0, 22, 105, 810
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\CUI.cs", "C#", 122, 0, 0, 0, 0, 0, 0, 0, 8, 28, 158
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Base64.cs", "C#", 86, 0, 0, 0, 0, 0, 0, 0, 56, 22, 164
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\EnvironmentVariableManager.cs", "C#", 151, 0, 0, 0, 0, 0, 0, 0, 5, 17, 173
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\NetworkConfigManager.cs", "C#", 111, 0, 0, 0, 0, 0, 0, 0, 0, 16, 127
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\SHA256.cs", "C#", 179, 0, 0, 0, 0, 0, 0, 0, 6, 41, 226
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Version.cs", "C#", 23, 0, 0, 0, 0, 0, 0, 0, 0, 5, 28
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\@vue_devtools-api.js", "JavaScript", 0, 0, 0, 0, 0, 0, 4356, 0, 145, 5, 4506
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\@vuepress_shared.js", "JavaScript", 0, 0, 0, 0, 0, 0, 134, 0, 2, 1, 137
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\_metadata.json", "JSON", 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 37
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\chunk-OARA6QKZ.js", "JavaScript", 0, 0, 0, 0, 0, 0, 12582, 0, 238, 5, 12825
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\package.json", "JSON", 0, 0, 3, 0, 0, 0, 0, 0, 0, 1, 4
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\vue-router.js", "JavaScript", 0, 0, 0, 0, 0, 0, 2371, 0, 25, 9, 2405
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\vue.js", "JavaScript", 0, 0, 0, 0, 0, 0, 346, 0, 0, 1, 347
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\config.js", "JavaScript", 0, 0, 0, 0, 0, 0, 12, 0, 1, 7, 20
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\404.html", "HTML", 0, 0, 0, 0, 0, 40, 0, 0, 0, 4, 44
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-B-2P5V78.js", "JavaScript", 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-BITa06va.js", "JavaScript", 0, 0, 0, 0, 0, 0, 28, 0, 4, 1, 33
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-CJdMGWM7.js", "JavaScript", 0, 0, 0, 0, 0, 0, 143, 0, 0, 1, 144
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-D_vM18Nz.js", "JavaScript", 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-DS7rXIvH.js", "JavaScript", 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-DxDsLuB0.js", "JavaScript", 0, 0, 0, 0, 0, 0, 297, 0, 0, 1, 298
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\style-BmL0kmLr.css", "PostCSS", 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\commands.html", "HTML", 0, 0, 0, 0, 0, 182, 0, 0, 0, 4, 186
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\get-started.html", "HTML", 0, 0, 0, 0, 0, 40, 0, 0, 0, 4, 44
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\index.html", "HTML", 0, 0, 0, 0, 0, 40, 0, 0, 0, 4, 44
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\lua.html", "HTML", 0, 0, 0, 0, 0, 336, 0, 0, 0, 4, 340
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\README.md", "Markdown", 0, 33, 0, 0, 0, 0, 0, 0, 0, 4, 37
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\commands.md", "Markdown", 0, 629, 0, 0, 0, 0, 0, 0, 0, 191, 820
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\get-started.md", "Markdown", 0, 14, 0, 0, 0, 0, 0, 0, 0, 3, 17
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\lua.md", "Markdown", 0, 940, 0, 0, 0, 0, 0, 0, 0, 339, 1279
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\package.json", "JSON", 0, 0, 20, 0, 0, 0, 0, 0, 0, 1, 21
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\pnpm-lock.yaml", "YAML", 0, 0, 0, 0, 2410, 0, 0, 0, 0, 674, 3084
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\global.json", "JSON", 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 6
|
||||
"Total", "-", 20531, 2364, 66, 49, 2410, 638, 20272, 1, 1235, 4442, 52008
|
||||
|
1
.VSCodeCounter/2026-02-06_22-40-24/results.json
Normal file
1
.VSCodeCounter/2026-02-06_22-40-24/results.json
Normal file
File diff suppressed because one or more lines are too long
64
.VSCodeCounter/2026-02-06_22-40-24/results.md
Normal file
64
.VSCodeCounter/2026-02-06_22-40-24/results.md
Normal file
@@ -0,0 +1,64 @@
|
||||
# Summary
|
||||
|
||||
Date : 2026-02-06 22:40:24
|
||||
|
||||
Directory c:\\Users\\leon\\source\\repos\\CMLeonOS\\CMLeonOS
|
||||
|
||||
Total : 130 files, 46331 codes, 1235 comments, 4442 blanks, all 52008 lines
|
||||
|
||||
Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
|
||||
## Languages
|
||||
| language | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| C# | 99 | 20,531 | 819 | 2,991 | 24,341 |
|
||||
| JavaScript | 12 | 20,272 | 415 | 34 | 20,721 |
|
||||
| YAML | 1 | 2,410 | 0 | 674 | 3,084 |
|
||||
| Markdown | 7 | 2,364 | 0 | 714 | 3,078 |
|
||||
| HTML | 5 | 638 | 0 | 20 | 658 |
|
||||
| JSON | 4 | 66 | 0 | 2 | 68 |
|
||||
| XML | 1 | 49 | 1 | 6 | 56 |
|
||||
| PostCSS | 1 | 1 | 0 | 1 | 2 |
|
||||
|
||||
## Directories
|
||||
| path | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| . | 130 | 46,331 | 1,235 | 4,442 | 52,008 |
|
||||
| . (Files) | 6 | 1,031 | 34 | 226 | 1,291 |
|
||||
| Editor | 2 | 994 | 45 | 128 | 1,167 |
|
||||
| Interpreter | 34 | 13,057 | 604 | 1,940 | 15,601 |
|
||||
| Interpreter (Files) | 1 | 482 | 28 | 53 | 563 |
|
||||
| Interpreter\\UniLua | 33 | 12,575 | 576 | 1,887 | 15,038 |
|
||||
| Logger | 3 | 146 | 0 | 24 | 170 |
|
||||
| Settings | 1 | 140 | 0 | 17 | 157 |
|
||||
| Shell | 50 | 4,211 | 23 | 565 | 4,799 |
|
||||
| Shell (Files) | 2 | 1,666 | 23 | 266 | 1,955 |
|
||||
| Shell\\Commands | 48 | 2,545 | 0 | 299 | 2,844 |
|
||||
| Shell\\Commands (Files) | 2 | 301 | 0 | 33 | 334 |
|
||||
| Shell\\Commands\\Editor | 2 | 48 | 0 | 6 | 54 |
|
||||
| Shell\\Commands\\Environment | 1 | 107 | 0 | 8 | 115 |
|
||||
| Shell\\Commands\\FileSystem | 17 | 562 | 0 | 84 | 646 |
|
||||
| Shell\\Commands\\Help | 1 | 507 | 0 | 26 | 533 |
|
||||
| Shell\\Commands\\Info | 2 | 28 | 0 | 4 | 32 |
|
||||
| Shell\\Commands\\Power | 2 | 26 | 0 | 4 | 30 |
|
||||
| Shell\\Commands\\Script | 3 | 240 | 0 | 34 | 274 |
|
||||
| Shell\\Commands\\System | 7 | 163 | 0 | 24 | 187 |
|
||||
| Shell\\Commands\\User | 3 | 100 | 0 | 15 | 115 |
|
||||
| Shell\\Commands\\Utility | 8 | 463 | 0 | 61 | 524 |
|
||||
| System | 2 | 1,083 | 39 | 145 | 1,267 |
|
||||
| UI | 1 | 122 | 8 | 28 | 158 |
|
||||
| Utils | 5 | 550 | 67 | 101 | 718 |
|
||||
| docs | 26 | 24,997 | 415 | 1,268 | 26,680 |
|
||||
| docs\\cmleonos | 26 | 24,997 | 415 | 1,268 | 26,680 |
|
||||
| docs\\cmleonos (Files) | 2 | 2,430 | 0 | 675 | 3,105 |
|
||||
| docs\\cmleonos\\docs | 24 | 22,567 | 415 | 593 | 23,575 |
|
||||
| docs\\cmleonos\\docs (Files) | 4 | 1,616 | 0 | 537 | 2,153 |
|
||||
| docs\\cmleonos\\docs\\.vuepress | 20 | 20,951 | 415 | 56 | 21,422 |
|
||||
| docs\\cmleonos\\docs\\.vuepress (Files) | 1 | 12 | 1 | 7 | 20 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\.cache | 7 | 19,829 | 410 | 22 | 20,261 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\.cache\\deps | 7 | 19,829 | 410 | 22 | 20,261 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\dist | 12 | 1,110 | 4 | 27 | 1,141 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\dist (Files) | 5 | 638 | 0 | 20 | 658 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\dist\\assets | 7 | 472 | 4 | 7 | 483 |
|
||||
|
||||
Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
197
.VSCodeCounter/2026-02-06_22-40-24/results.txt
Normal file
197
.VSCodeCounter/2026-02-06_22-40-24/results.txt
Normal file
@@ -0,0 +1,197 @@
|
||||
Date : 2026-02-06 22:40:24
|
||||
Directory : c:\Users\leon\source\repos\CMLeonOS\CMLeonOS
|
||||
Total : 130 files, 46331 codes, 1235 comments, 4442 blanks, all 52008 lines
|
||||
|
||||
Languages
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
| language | files | code | comment | blank | total |
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
| C# | 99 | 20,531 | 819 | 2,991 | 24,341 |
|
||||
| JavaScript | 12 | 20,272 | 415 | 34 | 20,721 |
|
||||
| YAML | 1 | 2,410 | 0 | 674 | 3,084 |
|
||||
| Markdown | 7 | 2,364 | 0 | 714 | 3,078 |
|
||||
| HTML | 5 | 638 | 0 | 20 | 658 |
|
||||
| JSON | 4 | 66 | 0 | 2 | 68 |
|
||||
| XML | 1 | 49 | 1 | 6 | 56 |
|
||||
| PostCSS | 1 | 1 | 0 | 1 | 2 |
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
|
||||
Directories
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| path | files | code | comment | blank | total |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| . | 130 | 46,331 | 1,235 | 4,442 | 52,008 |
|
||||
| . (Files) | 6 | 1,031 | 34 | 226 | 1,291 |
|
||||
| Editor | 2 | 994 | 45 | 128 | 1,167 |
|
||||
| Interpreter | 34 | 13,057 | 604 | 1,940 | 15,601 |
|
||||
| Interpreter (Files) | 1 | 482 | 28 | 53 | 563 |
|
||||
| Interpreter\UniLua | 33 | 12,575 | 576 | 1,887 | 15,038 |
|
||||
| Logger | 3 | 146 | 0 | 24 | 170 |
|
||||
| Settings | 1 | 140 | 0 | 17 | 157 |
|
||||
| Shell | 50 | 4,211 | 23 | 565 | 4,799 |
|
||||
| Shell (Files) | 2 | 1,666 | 23 | 266 | 1,955 |
|
||||
| Shell\Commands | 48 | 2,545 | 0 | 299 | 2,844 |
|
||||
| Shell\Commands (Files) | 2 | 301 | 0 | 33 | 334 |
|
||||
| Shell\Commands\Editor | 2 | 48 | 0 | 6 | 54 |
|
||||
| Shell\Commands\Environment | 1 | 107 | 0 | 8 | 115 |
|
||||
| Shell\Commands\FileSystem | 17 | 562 | 0 | 84 | 646 |
|
||||
| Shell\Commands\Help | 1 | 507 | 0 | 26 | 533 |
|
||||
| Shell\Commands\Info | 2 | 28 | 0 | 4 | 32 |
|
||||
| Shell\Commands\Power | 2 | 26 | 0 | 4 | 30 |
|
||||
| Shell\Commands\Script | 3 | 240 | 0 | 34 | 274 |
|
||||
| Shell\Commands\System | 7 | 163 | 0 | 24 | 187 |
|
||||
| Shell\Commands\User | 3 | 100 | 0 | 15 | 115 |
|
||||
| Shell\Commands\Utility | 8 | 463 | 0 | 61 | 524 |
|
||||
| System | 2 | 1,083 | 39 | 145 | 1,267 |
|
||||
| UI | 1 | 122 | 8 | 28 | 158 |
|
||||
| Utils | 5 | 550 | 67 | 101 | 718 |
|
||||
| docs | 26 | 24,997 | 415 | 1,268 | 26,680 |
|
||||
| docs\cmleonos | 26 | 24,997 | 415 | 1,268 | 26,680 |
|
||||
| docs\cmleonos (Files) | 2 | 2,430 | 0 | 675 | 3,105 |
|
||||
| docs\cmleonos\docs | 24 | 22,567 | 415 | 593 | 23,575 |
|
||||
| docs\cmleonos\docs (Files) | 4 | 1,616 | 0 | 537 | 2,153 |
|
||||
| docs\cmleonos\docs\.vuepress | 20 | 20,951 | 415 | 56 | 21,422 |
|
||||
| docs\cmleonos\docs\.vuepress (Files) | 1 | 12 | 1 | 7 | 20 |
|
||||
| docs\cmleonos\docs\.vuepress\.cache | 7 | 19,829 | 410 | 22 | 20,261 |
|
||||
| docs\cmleonos\docs\.vuepress\.cache\deps | 7 | 19,829 | 410 | 22 | 20,261 |
|
||||
| docs\cmleonos\docs\.vuepress\dist | 12 | 1,110 | 4 | 27 | 1,141 |
|
||||
| docs\cmleonos\docs\.vuepress\dist (Files) | 5 | 638 | 0 | 20 | 658 |
|
||||
| docs\cmleonos\docs\.vuepress\dist\assets | 7 | 472 | 4 | 7 | 483 |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
|
||||
Files
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| filename | language | code | comment | blank | total |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Branswe.md | Markdown | 261 | 0 | 67 | 328 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\CMLeonOS.csproj | XML | 49 | 1 | 6 | 56 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Editor.cs | C# | 267 | 29 | 35 | 331 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Nano.cs | C# | 727 | 16 | 93 | 836 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\Branswe.cs | C# | 482 | 28 | 53 | 563 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\ByteString.cs | C# | 41 | 0 | 7 | 48 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Coder.cs | C# | 1,101 | 26 | 157 | 1,284 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Common.cs | C# | 99 | 3 | 27 | 129 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Do.cs | C# | 269 | 25 | 50 | 344 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Dump.cs | C# | 187 | 0 | 33 | 220 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LLex.cs | C# | 627 | 40 | 93 | 760 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaAPI.cs | C# | 1,335 | 64 | 240 | 1,639 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaAuxLib.cs | C# | 643 | 21 | 92 | 756 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaBaseLib.cs | C# | 406 | 9 | 43 | 458 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaBitLib.cs | C# | 179 | 0 | 26 | 205 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaCoroLib.cs | C# | 137 | 0 | 16 | 153 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaDebug.cs | C# | 443 | 19 | 55 | 517 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaDebugLib.cs | C# | 20 | 0 | 6 | 26 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaEncLib.cs | C# | 51 | 0 | 13 | 64 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaFile.cs | C# | 115 | 2 | 18 | 135 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaFunc.cs | C# | 69 | 6 | 20 | 95 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaIOLib.cs | C# | 70 | 12 | 19 | 101 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaJsonLib.cs | C# | 461 | 0 | 65 | 526 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaMathLib.cs | C# | 285 | 10 | 49 | 344 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaObject.cs | C# | 367 | 1 | 52 | 420 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaOsLib.cs | C# | 206 | 0 | 32 | 238 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaPkgLib.cs | C# | 256 | 57 | 47 | 360 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaState.cs | C# | 250 | 6 | 51 | 307 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaStrLib.cs | C# | 869 | 8 | 61 | 938 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaTable.cs | C# | 465 | 37 | 80 | 582 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaTableLib.cs | C# | 250 | 8 | 24 | 282 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\OpCodes.cs | C# | 131 | 7 | 27 | 165 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Parser.cs | C# | 1,588 | 139 | 219 | 1,946 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\TagMethod.cs | C# | 91 | 2 | 10 | 103 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\ULDebug.cs | C# | 13 | 2 | 5 | 20 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Undump.cs | C# | 321 | 6 | 50 | 377 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Util.cs | C# | 192 | 8 | 39 | 239 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\VM.cs | C# | 1,038 | 58 | 161 | 1,257 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Kernel.cs | C# | 228 | 33 | 43 | 304 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LISENCE.md | Markdown | 485 | 0 | 110 | 595 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\LogEntry.cs | C# | 41 | 0 | 5 | 46 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\LogLevel.cs | C# | 11 | 0 | 1 | 12 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\Logger.cs | C# | 94 | 0 | 18 | 112 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\README.md | Markdown | 2 | 0 | 0 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Settings\Settings.cs | C# | 140 | 0 | 17 | 157 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs | C# | 208 | 0 | 1 | 209 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Editor\EditCommand.cs | C# | 24 | 0 | 3 | 27 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Editor\NanoCommand.cs | C# | 24 | 0 | 3 | 27 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Environment\EnvCommand.cs | C# | 107 | 0 | 8 | 115 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CatCommand.cs | C# | 18 | 0 | 2 | 20 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CdCommand.cs | C# | 10 | 0 | 1 | 11 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CopyCommand.cs | C# | 40 | 0 | 6 | 46 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\DiskInfoCommand.cs | C# | 28 | 0 | 5 | 33 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\FindCommand.cs | C# | 37 | 0 | 5 | 42 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\HeadCommand.cs | C# | 46 | 0 | 8 | 54 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\LsCommand.cs | C# | 10 | 0 | 1 | 11 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\MkdirCommand.cs | C# | 20 | 0 | 2 | 22 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\MoveCommand.cs | C# | 41 | 0 | 7 | 48 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\PwdCommand.cs | C# | 11 | 0 | 2 | 13 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RenameCommand.cs | C# | 48 | 0 | 9 | 57 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmCommand.cs | C# | 42 | 0 | 5 | 47 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmdirCommand.cs | C# | 27 | 0 | 3 | 30 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TailCommand.cs | C# | 47 | 0 | 8 | 55 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TouchCommand.cs | C# | 25 | 0 | 3 | 28 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TreeCommand.cs | C# | 67 | 0 | 11 | 78 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\WordCountCommand.cs | C# | 45 | 0 | 6 | 51 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs | C# | 507 | 0 | 26 | 533 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\About.cs | C# | 12 | 0 | 2 | 14 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\Version.cs | C# | 16 | 0 | 2 | 18 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\LabyrinthCommand.cs | C# | 224 | 0 | 24 | 248 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Power\RestartCommand.cs | C# | 13 | 0 | 2 | 15 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Power\ShutdownCommand.cs | C# | 13 | 0 | 2 | 15 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\BransweCommand.cs | C# | 32 | 0 | 5 | 37 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\ComCommand.cs | C# | 43 | 0 | 8 | 51 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\LuaCommand.cs | C# | 165 | 0 | 21 | 186 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\ClearCommand.cs | C# | 11 | 0 | 2 | 13 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\DateCommand.cs | C# | 11 | 0 | 2 | 13 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\EchoCommand.cs | C# | 12 | 0 | 2 | 14 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\SettingsCommand.cs | C# | 62 | 0 | 8 | 70 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\TimeCommand.cs | C# | 11 | 0 | 2 | 13 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\UptimeCommand.cs | C# | 40 | 0 | 6 | 46 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\WhoamiCommand.cs | C# | 16 | 0 | 2 | 18 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\TestGuiCommand.cs | C# | 77 | 0 | 9 | 86 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\CpassCommand.cs | C# | 10 | 0 | 1 | 11 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\HostnameCommand.cs | C# | 16 | 0 | 3 | 19 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs | C# | 74 | 0 | 11 | 85 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\AliasCommand.cs | C# | 140 | 0 | 19 | 159 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\BackgroundCommand.cs | C# | 108 | 0 | 9 | 117 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\Base64Command.cs | C# | 58 | 0 | 10 | 68 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\BeepCommand.cs | C# | 11 | 0 | 2 | 13 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalcCommand.cs | C# | 56 | 0 | 4 | 60 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalendarCommand.cs | C# | 57 | 0 | 13 | 70 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\HistoryCommand.cs | C# | 15 | 0 | 2 | 17 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\PromptCommand.cs | C# | 18 | 0 | 2 | 20 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs | C# | 1,458 | 23 | 265 | 1,746 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\FileSystem.cs | C# | 400 | 17 | 40 | 457 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs | C# | 683 | 22 | 105 | 810 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\CUI.cs | C# | 122 | 8 | 28 | 158 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Base64.cs | C# | 86 | 56 | 22 | 164 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\EnvironmentVariableManager.cs | C# | 151 | 5 | 17 | 173 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\NetworkConfigManager.cs | C# | 111 | 0 | 16 | 127 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\SHA256.cs | C# | 179 | 6 | 41 | 226 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Version.cs | C# | 23 | 0 | 5 | 28 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\@vue_devtools-api.js | JavaScript | 4,356 | 145 | 5 | 4,506 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\@vuepress_shared.js | JavaScript | 134 | 2 | 1 | 137 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\_metadata.json | JSON | 37 | 0 | 0 | 37 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\chunk-OARA6QKZ.js | JavaScript | 12,582 | 238 | 5 | 12,825 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\package.json | JSON | 3 | 0 | 1 | 4 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\vue-router.js | JavaScript | 2,371 | 25 | 9 | 2,405 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\vue.js | JavaScript | 346 | 0 | 1 | 347 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\config.js | JavaScript | 12 | 1 | 7 | 20 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\404.html | HTML | 40 | 0 | 4 | 44 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-B-2P5V78.js | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-BITa06va.js | JavaScript | 28 | 4 | 1 | 33 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-CJdMGWM7.js | JavaScript | 143 | 0 | 1 | 144 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-D_vM18Nz.js | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-DS7rXIvH.js | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-DxDsLuB0.js | JavaScript | 297 | 0 | 1 | 298 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\style-BmL0kmLr.css | PostCSS | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\commands.html | HTML | 182 | 0 | 4 | 186 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\get-started.html | HTML | 40 | 0 | 4 | 44 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\index.html | HTML | 40 | 0 | 4 | 44 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\lua.html | HTML | 336 | 0 | 4 | 340 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\README.md | Markdown | 33 | 0 | 4 | 37 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\commands.md | Markdown | 629 | 0 | 191 | 820 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\get-started.md | Markdown | 14 | 0 | 3 | 17 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\lua.md | Markdown | 940 | 0 | 339 | 1,279 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\package.json | JSON | 20 | 0 | 1 | 21 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\pnpm-lock.yaml | YAML | 2,410 | 0 | 674 | 3,084 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\global.json | JSON | 6 | 0 | 0 | 6 |
|
||||
| Total | | 46,331 | 1,235 | 4,442 | 52,008 |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
160
.VSCodeCounter/2026-02-11_18-21-42/details.md
Normal file
160
.VSCodeCounter/2026-02-11_18-21-42/details.md
Normal file
@@ -0,0 +1,160 @@
|
||||
# Details
|
||||
|
||||
Date : 2026-02-11 18:21:42
|
||||
|
||||
Directory c:\\Users\\leon\\source\\repos\\CMLeonOS\\CMLeonOS
|
||||
|
||||
Total : 145 files, 50173 codes, 1262 comments, 5030 blanks, all 56465 lines
|
||||
|
||||
[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
|
||||
## Files
|
||||
| filename | language | code | comment | blank | total |
|
||||
| :--- | :--- | ---: | ---: | ---: | ---: |
|
||||
| [Branswe.md](/Branswe.md) | Markdown | 261 | 0 | 67 | 328 |
|
||||
| [Build.bat](/Build.bat) | Batch | 1 | 1 | 0 | 2 |
|
||||
| [CMLeonOS.csproj](/CMLeonOS.csproj) | XML | 84 | 1 | 14 | 99 |
|
||||
| [Editor/Editor.cs](/Editor/Editor.cs) | C# | 267 | 29 | 35 | 331 |
|
||||
| [Editor/Nano.cs](/Editor/Nano.cs) | C# | 727 | 16 | 93 | 836 |
|
||||
| [GenerateGitCommit.ps1](/GenerateGitCommit.ps1) | PowerShell | 22 | 0 | 3 | 25 |
|
||||
| [Interpreter/Branswe.cs](/Interpreter/Branswe.cs) | C# | 482 | 28 | 53 | 563 |
|
||||
| [Interpreter/UniLua/ByteString.cs](/Interpreter/UniLua/ByteString.cs) | C# | 41 | 0 | 7 | 48 |
|
||||
| [Interpreter/UniLua/Coder.cs](/Interpreter/UniLua/Coder.cs) | C# | 1,101 | 26 | 157 | 1,284 |
|
||||
| [Interpreter/UniLua/Common.cs](/Interpreter/UniLua/Common.cs) | C# | 99 | 3 | 27 | 129 |
|
||||
| [Interpreter/UniLua/Do.cs](/Interpreter/UniLua/Do.cs) | C# | 269 | 25 | 50 | 344 |
|
||||
| [Interpreter/UniLua/Dump.cs](/Interpreter/UniLua/Dump.cs) | C# | 187 | 0 | 33 | 220 |
|
||||
| [Interpreter/UniLua/LLex.cs](/Interpreter/UniLua/LLex.cs) | C# | 627 | 40 | 93 | 760 |
|
||||
| [Interpreter/UniLua/LuaAPI.cs](/Interpreter/UniLua/LuaAPI.cs) | C# | 1,335 | 64 | 240 | 1,639 |
|
||||
| [Interpreter/UniLua/LuaAuxLib.cs](/Interpreter/UniLua/LuaAuxLib.cs) | C# | 643 | 21 | 92 | 756 |
|
||||
| [Interpreter/UniLua/LuaBaseLib.cs](/Interpreter/UniLua/LuaBaseLib.cs) | C# | 406 | 9 | 43 | 458 |
|
||||
| [Interpreter/UniLua/LuaBitLib.cs](/Interpreter/UniLua/LuaBitLib.cs) | C# | 179 | 0 | 26 | 205 |
|
||||
| [Interpreter/UniLua/LuaCoroLib.cs](/Interpreter/UniLua/LuaCoroLib.cs) | C# | 137 | 0 | 16 | 153 |
|
||||
| [Interpreter/UniLua/LuaDebug.cs](/Interpreter/UniLua/LuaDebug.cs) | C# | 443 | 19 | 55 | 517 |
|
||||
| [Interpreter/UniLua/LuaDebugLib.cs](/Interpreter/UniLua/LuaDebugLib.cs) | C# | 20 | 0 | 6 | 26 |
|
||||
| [Interpreter/UniLua/LuaEncLib.cs](/Interpreter/UniLua/LuaEncLib.cs) | C# | 51 | 0 | 13 | 64 |
|
||||
| [Interpreter/UniLua/LuaFile.cs](/Interpreter/UniLua/LuaFile.cs) | C# | 115 | 2 | 18 | 135 |
|
||||
| [Interpreter/UniLua/LuaFunc.cs](/Interpreter/UniLua/LuaFunc.cs) | C# | 69 | 6 | 20 | 95 |
|
||||
| [Interpreter/UniLua/LuaIOLib.cs](/Interpreter/UniLua/LuaIOLib.cs) | C# | 70 | 12 | 19 | 101 |
|
||||
| [Interpreter/UniLua/LuaJsonLib.cs](/Interpreter/UniLua/LuaJsonLib.cs) | C# | 461 | 0 | 65 | 526 |
|
||||
| [Interpreter/UniLua/LuaMathLib.cs](/Interpreter/UniLua/LuaMathLib.cs) | C# | 285 | 10 | 49 | 344 |
|
||||
| [Interpreter/UniLua/LuaObject.cs](/Interpreter/UniLua/LuaObject.cs) | C# | 367 | 1 | 52 | 420 |
|
||||
| [Interpreter/UniLua/LuaOsLib.cs](/Interpreter/UniLua/LuaOsLib.cs) | C# | 309 | 0 | 49 | 358 |
|
||||
| [Interpreter/UniLua/LuaPkgLib.cs](/Interpreter/UniLua/LuaPkgLib.cs) | C# | 256 | 57 | 47 | 360 |
|
||||
| [Interpreter/UniLua/LuaState.cs](/Interpreter/UniLua/LuaState.cs) | C# | 250 | 6 | 51 | 307 |
|
||||
| [Interpreter/UniLua/LuaStrLib.cs](/Interpreter/UniLua/LuaStrLib.cs) | C# | 869 | 8 | 61 | 938 |
|
||||
| [Interpreter/UniLua/LuaTable.cs](/Interpreter/UniLua/LuaTable.cs) | C# | 465 | 37 | 80 | 582 |
|
||||
| [Interpreter/UniLua/LuaTableLib.cs](/Interpreter/UniLua/LuaTableLib.cs) | C# | 250 | 8 | 24 | 282 |
|
||||
| [Interpreter/UniLua/OpCodes.cs](/Interpreter/UniLua/OpCodes.cs) | C# | 131 | 7 | 27 | 165 |
|
||||
| [Interpreter/UniLua/Parser.cs](/Interpreter/UniLua/Parser.cs) | C# | 1,588 | 139 | 219 | 1,946 |
|
||||
| [Interpreter/UniLua/TagMethod.cs](/Interpreter/UniLua/TagMethod.cs) | C# | 91 | 2 | 10 | 103 |
|
||||
| [Interpreter/UniLua/ULDebug.cs](/Interpreter/UniLua/ULDebug.cs) | C# | 13 | 2 | 5 | 20 |
|
||||
| [Interpreter/UniLua/Undump.cs](/Interpreter/UniLua/Undump.cs) | C# | 321 | 6 | 50 | 377 |
|
||||
| [Interpreter/UniLua/Util.cs](/Interpreter/UniLua/Util.cs) | C# | 192 | 8 | 39 | 239 |
|
||||
| [Interpreter/UniLua/VM.cs](/Interpreter/UniLua/VM.cs) | C# | 1,038 | 58 | 161 | 1,257 |
|
||||
| [Kernel.cs](/Kernel.cs) | C# | 349 | 63 | 67 | 479 |
|
||||
| [LISENCE.md](/LISENCE.md) | Markdown | 485 | 0 | 110 | 595 |
|
||||
| [Logger/LogEntry.cs](/Logger/LogEntry.cs) | C# | 41 | 0 | 5 | 46 |
|
||||
| [Logger/LogLevel.cs](/Logger/LogLevel.cs) | C# | 11 | 0 | 1 | 12 |
|
||||
| [Logger/Logger.cs](/Logger/Logger.cs) | C# | 94 | 0 | 18 | 112 |
|
||||
| [LuaApps.cs](/LuaApps.cs) | C# | 13 | 0 | 3 | 16 |
|
||||
| [LuaApps/calculator.lua](/LuaApps/calculator.lua) | Lua | 87 | 0 | 11 | 98 |
|
||||
| [LuaApps/helloworld.lua](/LuaApps/helloworld.lua) | Lua | 3 | 0 | 0 | 3 |
|
||||
| [LuaApps/testspeed.lua](/LuaApps/testspeed.lua) | Lua | 6 | 1 | 0 | 7 |
|
||||
| [README.md](/README.md) | Markdown | 2 | 0 | 0 | 2 |
|
||||
| [Settings/Settings.cs](/Settings/Settings.cs) | C# | 140 | 0 | 17 | 157 |
|
||||
| [Shell/CommandList.cs](/Shell/CommandList.cs) | C# | 223 | 0 | 1 | 224 |
|
||||
| [Shell/Commands/Editor/EditCommand.cs](/Shell/Commands/Editor/EditCommand.cs) | C# | 24 | 0 | 3 | 27 |
|
||||
| [Shell/Commands/Editor/NanoCommand.cs](/Shell/Commands/Editor/NanoCommand.cs) | C# | 24 | 0 | 3 | 27 |
|
||||
| [Shell/Commands/Environment/EnvCommand.cs](/Shell/Commands/Environment/EnvCommand.cs) | C# | 175 | 0 | 10 | 185 |
|
||||
| [Shell/Commands/FileSystem/CatCommand.cs](/Shell/Commands/FileSystem/CatCommand.cs) | C# | 18 | 0 | 2 | 20 |
|
||||
| [Shell/Commands/FileSystem/CdCommand.cs](/Shell/Commands/FileSystem/CdCommand.cs) | C# | 10 | 0 | 1 | 11 |
|
||||
| [Shell/Commands/FileSystem/CopyCommand.cs](/Shell/Commands/FileSystem/CopyCommand.cs) | C# | 40 | 0 | 6 | 46 |
|
||||
| [Shell/Commands/FileSystem/DiskInfoCommand.cs](/Shell/Commands/FileSystem/DiskInfoCommand.cs) | C# | 28 | 0 | 5 | 33 |
|
||||
| [Shell/Commands/FileSystem/FindCommand.cs](/Shell/Commands/FileSystem/FindCommand.cs) | C# | 37 | 0 | 5 | 42 |
|
||||
| [Shell/Commands/FileSystem/HeadCommand.cs](/Shell/Commands/FileSystem/HeadCommand.cs) | C# | 46 | 0 | 8 | 54 |
|
||||
| [Shell/Commands/FileSystem/LsCommand.cs](/Shell/Commands/FileSystem/LsCommand.cs) | C# | 10 | 0 | 1 | 11 |
|
||||
| [Shell/Commands/FileSystem/MkdirCommand.cs](/Shell/Commands/FileSystem/MkdirCommand.cs) | C# | 20 | 0 | 2 | 22 |
|
||||
| [Shell/Commands/FileSystem/MoveCommand.cs](/Shell/Commands/FileSystem/MoveCommand.cs) | C# | 41 | 0 | 7 | 48 |
|
||||
| [Shell/Commands/FileSystem/PwdCommand.cs](/Shell/Commands/FileSystem/PwdCommand.cs) | C# | 11 | 0 | 2 | 13 |
|
||||
| [Shell/Commands/FileSystem/RenameCommand.cs](/Shell/Commands/FileSystem/RenameCommand.cs) | C# | 48 | 0 | 9 | 57 |
|
||||
| [Shell/Commands/FileSystem/RmCommand.cs](/Shell/Commands/FileSystem/RmCommand.cs) | C# | 60 | 0 | 6 | 66 |
|
||||
| [Shell/Commands/FileSystem/RmdirCommand.cs](/Shell/Commands/FileSystem/RmdirCommand.cs) | C# | 27 | 0 | 3 | 30 |
|
||||
| [Shell/Commands/FileSystem/TailCommand.cs](/Shell/Commands/FileSystem/TailCommand.cs) | C# | 47 | 0 | 8 | 55 |
|
||||
| [Shell/Commands/FileSystem/TouchCommand.cs](/Shell/Commands/FileSystem/TouchCommand.cs) | C# | 25 | 0 | 3 | 28 |
|
||||
| [Shell/Commands/FileSystem/TreeCommand.cs](/Shell/Commands/FileSystem/TreeCommand.cs) | C# | 67 | 0 | 11 | 78 |
|
||||
| [Shell/Commands/FileSystem/WordCountCommand.cs](/Shell/Commands/FileSystem/WordCountCommand.cs) | C# | 45 | 0 | 6 | 51 |
|
||||
| [Shell/Commands/Help/Help.cs](/Shell/Commands/Help/Help.cs) | C# | 531 | 0 | 26 | 557 |
|
||||
| [Shell/Commands/Info/About.cs](/Shell/Commands/Info/About.cs) | C# | 12 | 0 | 2 | 14 |
|
||||
| [Shell/Commands/Info/Version.cs](/Shell/Commands/Info/Version.cs) | C# | 17 | 0 | 2 | 19 |
|
||||
| [Shell/Commands/LabyrinthCommand.cs](/Shell/Commands/LabyrinthCommand.cs) | C# | 224 | 0 | 24 | 248 |
|
||||
| [Shell/Commands/Power/RestartCommand.cs](/Shell/Commands/Power/RestartCommand.cs) | C# | 13 | 0 | 2 | 15 |
|
||||
| [Shell/Commands/Power/ShutdownCommand.cs](/Shell/Commands/Power/ShutdownCommand.cs) | C# | 13 | 0 | 2 | 15 |
|
||||
| [Shell/Commands/Script/BransweCommand.cs](/Shell/Commands/Script/BransweCommand.cs) | C# | 42 | 0 | 6 | 48 |
|
||||
| [Shell/Commands/Script/ComCommand.cs](/Shell/Commands/Script/ComCommand.cs) | C# | 54 | 0 | 9 | 63 |
|
||||
| [Shell/Commands/Script/LuaCommand.cs](/Shell/Commands/Script/LuaCommand.cs) | C# | 181 | 0 | 22 | 203 |
|
||||
| [Shell/Commands/System/ClearCommand.cs](/Shell/Commands/System/ClearCommand.cs) | C# | 11 | 0 | 2 | 13 |
|
||||
| [Shell/Commands/System/DateCommand.cs](/Shell/Commands/System/DateCommand.cs) | C# | 11 | 0 | 2 | 13 |
|
||||
| [Shell/Commands/System/EchoCommand.cs](/Shell/Commands/System/EchoCommand.cs) | C# | 12 | 0 | 2 | 14 |
|
||||
| [Shell/Commands/System/SettingsCommand.cs](/Shell/Commands/System/SettingsCommand.cs) | C# | 62 | 0 | 8 | 70 |
|
||||
| [Shell/Commands/System/TimeCommand.cs](/Shell/Commands/System/TimeCommand.cs) | C# | 11 | 0 | 2 | 13 |
|
||||
| [Shell/Commands/System/UptimeCommand.cs](/Shell/Commands/System/UptimeCommand.cs) | C# | 40 | 0 | 6 | 46 |
|
||||
| [Shell/Commands/System/WhoamiCommand.cs](/Shell/Commands/System/WhoamiCommand.cs) | C# | 16 | 0 | 2 | 18 |
|
||||
| [Shell/Commands/TestGuiCommand.cs](/Shell/Commands/TestGuiCommand.cs) | C# | 77 | 0 | 9 | 86 |
|
||||
| [Shell/Commands/TestTUICommand.cs](/Shell/Commands/TestTUICommand.cs) | C# | 583 | 0 | 102 | 685 |
|
||||
| [Shell/Commands/User/CpassCommand.cs](/Shell/Commands/User/CpassCommand.cs) | C# | 10 | 0 | 1 | 11 |
|
||||
| [Shell/Commands/User/HostnameCommand.cs](/Shell/Commands/User/HostnameCommand.cs) | C# | 27 | 0 | 4 | 31 |
|
||||
| [Shell/Commands/User/UserCommand.cs](/Shell/Commands/User/UserCommand.cs) | C# | 97 | 0 | 12 | 109 |
|
||||
| [Shell/Commands/Utility/AliasCommand.cs](/Shell/Commands/Utility/AliasCommand.cs) | C# | 140 | 0 | 19 | 159 |
|
||||
| [Shell/Commands/Utility/AppManagerCommand.cs](/Shell/Commands/Utility/AppManagerCommand.cs) | C# | 165 | 0 | 30 | 195 |
|
||||
| [Shell/Commands/Utility/BackgroundCommand.cs](/Shell/Commands/Utility/BackgroundCommand.cs) | C# | 108 | 0 | 9 | 117 |
|
||||
| [Shell/Commands/Utility/Base64Command.cs](/Shell/Commands/Utility/Base64Command.cs) | C# | 89 | 0 | 12 | 101 |
|
||||
| [Shell/Commands/Utility/BeepCommand.cs](/Shell/Commands/Utility/BeepCommand.cs) | C# | 11 | 0 | 2 | 13 |
|
||||
| [Shell/Commands/Utility/CalcCommand.cs](/Shell/Commands/Utility/CalcCommand.cs) | C# | 56 | 0 | 4 | 60 |
|
||||
| [Shell/Commands/Utility/CalcGuiCommand.cs](/Shell/Commands/Utility/CalcGuiCommand.cs) | C# | 307 | 0 | 28 | 335 |
|
||||
| [Shell/Commands/Utility/CalendarCommand.cs](/Shell/Commands/Utility/CalendarCommand.cs) | C# | 57 | 0 | 13 | 70 |
|
||||
| [Shell/Commands/Utility/HistoryCommand.cs](/Shell/Commands/Utility/HistoryCommand.cs) | C# | 15 | 0 | 2 | 17 |
|
||||
| [Shell/Commands/Utility/MatrixCommand.cs](/Shell/Commands/Utility/MatrixCommand.cs) | C# | 62 | 0 | 13 | 75 |
|
||||
| [Shell/Commands/Utility/PromptCommand.cs](/Shell/Commands/Utility/PromptCommand.cs) | C# | 18 | 0 | 2 | 20 |
|
||||
| [Shell/Commands/Utility/SnakeCommand.cs](/Shell/Commands/Utility/SnakeCommand.cs) | C# | 164 | 0 | 27 | 191 |
|
||||
| [Shell/Shell.cs](/Shell/Shell.cs) | C# | 1,537 | 23 | 278 | 1,838 |
|
||||
| [Shell/UsageGenerator.cs](/Shell/UsageGenerator.cs) | C# | 211 | 0 | 31 | 242 |
|
||||
| [System/FileSystem.cs](/System/FileSystem.cs) | C# | 404 | 21 | 40 | 465 |
|
||||
| [System/UserSystem.cs](/System/UserSystem.cs) | C# | 691 | 11 | 104 | 806 |
|
||||
| [UI/CUI.cs](/UI/CUI.cs) | C# | 122 | 8 | 28 | 158 |
|
||||
| [UI/Components.cs](/UI/Components.cs) | C# | 960 | 0 | 144 | 1,104 |
|
||||
| [UI/TUI.cs](/UI/TUI.cs) | C# | 260 | 2 | 42 | 304 |
|
||||
| [UI/TUIDemo.cs](/UI/TUIDemo.cs) | C# | 279 | 0 | 54 | 333 |
|
||||
| [Utils/Base64.cs](/Utils/Base64.cs) | C# | 86 | 56 | 22 | 164 |
|
||||
| [Utils/EnvironmentVariableManager.cs](/Utils/EnvironmentVariableManager.cs) | C# | 151 | 5 | 17 | 173 |
|
||||
| [Utils/NetworkConfigManager.cs](/Utils/NetworkConfigManager.cs) | C# | 111 | 0 | 16 | 127 |
|
||||
| [Utils/SHA256.cs](/Utils/SHA256.cs) | C# | 179 | 6 | 41 | 226 |
|
||||
| [Utils/Version.cs](/Utils/Version.cs) | C# | 28 | 0 | 6 | 34 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/@vue\_devtools-api.js](/docs/cmleonos/docs/.vuepress/.cache/deps/@vue_devtools-api.js) | JavaScript | 4,356 | 145 | 5 | 4,506 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/@vuepress\_shared.js](/docs/cmleonos/docs/.vuepress/.cache/deps/@vuepress_shared.js) | JavaScript | 134 | 2 | 1 | 137 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/\_metadata.json](/docs/cmleonos/docs/.vuepress/.cache/deps/_metadata.json) | JSON | 37 | 0 | 0 | 37 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/chunk-OARA6QKZ.js](/docs/cmleonos/docs/.vuepress/.cache/deps/chunk-OARA6QKZ.js) | JavaScript | 12,582 | 238 | 5 | 12,825 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/package.json](/docs/cmleonos/docs/.vuepress/.cache/deps/package.json) | JSON | 3 | 0 | 1 | 4 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/vue-router.js](/docs/cmleonos/docs/.vuepress/.cache/deps/vue-router.js) | JavaScript | 2,371 | 25 | 9 | 2,405 |
|
||||
| [docs/cmleonos/docs/.vuepress/.cache/deps/vue.js](/docs/cmleonos/docs/.vuepress/.cache/deps/vue.js) | JavaScript | 346 | 0 | 1 | 347 |
|
||||
| [docs/cmleonos/docs/.vuepress/config.js](/docs/cmleonos/docs/.vuepress/config.js) | JavaScript | 12 | 1 | 7 | 20 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/404.html](/docs/cmleonos/docs/.vuepress/dist/404.html) | HTML | 40 | 0 | 4 | 44 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/404.html-ByTdGTSm.js](/docs/cmleonos/docs/.vuepress/dist/assets/404.html-ByTdGTSm.js) | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/app-C1vKFkGc.js](/docs/cmleonos/docs/.vuepress/dist/assets/app-C1vKFkGc.js) | JavaScript | 28 | 4 | 1 | 33 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/commands.html-DsR2axk8.js](/docs/cmleonos/docs/.vuepress/dist/assets/commands.html-DsR2axk8.js) | JavaScript | 153 | 0 | 1 | 154 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-CfHiKCXZ.js](/docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-CfHiKCXZ.js) | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/index.html-BMbDjf\_W.js](/docs/cmleonos/docs/.vuepress/dist/assets/index.html-BMbDjf_W.js) | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/lua.html-3\_L4TJjQ.js](/docs/cmleonos/docs/.vuepress/dist/assets/lua.html-3_L4TJjQ.js) | JavaScript | 303 | 0 | 1 | 304 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/style-BmL0kmLr.css](/docs/cmleonos/docs/.vuepress/dist/assets/style-BmL0kmLr.css) | PostCSS | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/commands.html](/docs/cmleonos/docs/.vuepress/dist/commands.html) | HTML | 192 | 0 | 4 | 196 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/get-started.html](/docs/cmleonos/docs/.vuepress/dist/get-started.html) | HTML | 40 | 0 | 4 | 44 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/index.html](/docs/cmleonos/docs/.vuepress/dist/index.html) | HTML | 40 | 0 | 4 | 44 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/lua.html](/docs/cmleonos/docs/.vuepress/dist/lua.html) | HTML | 342 | 0 | 4 | 346 |
|
||||
| [docs/cmleonos/docs/README.md](/docs/cmleonos/docs/README.md) | Markdown | 33 | 0 | 4 | 37 |
|
||||
| [docs/cmleonos/docs/commands.md](/docs/cmleonos/docs/commands.md) | Markdown | 675 | 0 | 201 | 876 |
|
||||
| [docs/cmleonos/docs/get-started.md](/docs/cmleonos/docs/get-started.md) | Markdown | 16 | 0 | 4 | 20 |
|
||||
| [docs/cmleonos/docs/lua.md](/docs/cmleonos/docs/lua.md) | Markdown | 996 | 0 | 356 | 1,352 |
|
||||
| [docs/cmleonos/package.json](/docs/cmleonos/package.json) | JSON | 20 | 0 | 1 | 21 |
|
||||
| [docs/cmleonos/pnpm-lock.yaml](/docs/cmleonos/pnpm-lock.yaml) | YAML | 2,410 | 0 | 674 | 3,084 |
|
||||
| [global.json](/global.json) | JSON | 6 | 0 | 0 | 6 |
|
||||
|
||||
[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
65
.VSCodeCounter/2026-02-11_18-21-42/diff-details.md
Normal file
65
.VSCodeCounter/2026-02-11_18-21-42/diff-details.md
Normal file
@@ -0,0 +1,65 @@
|
||||
# Diff Details
|
||||
|
||||
Date : 2026-02-11 18:21:42
|
||||
|
||||
Directory c:\\Users\\leon\\source\\repos\\CMLeonOS\\CMLeonOS
|
||||
|
||||
Total : 50 files, 3842 codes, 27 comments, 588 blanks, all 4457 lines
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details
|
||||
|
||||
## Files
|
||||
| filename | language | code | comment | blank | total |
|
||||
| :--- | :--- | ---: | ---: | ---: | ---: |
|
||||
| [Build.bat](/Build.bat) | Batch | 1 | 1 | 0 | 2 |
|
||||
| [CMLeonOS.csproj](/CMLeonOS.csproj) | XML | 35 | 0 | 8 | 43 |
|
||||
| [GenerateGitCommit.ps1](/GenerateGitCommit.ps1) | PowerShell | 22 | 0 | 3 | 25 |
|
||||
| [Interpreter/UniLua/LuaOsLib.cs](/Interpreter/UniLua/LuaOsLib.cs) | C# | 103 | 0 | 17 | 120 |
|
||||
| [Kernel.cs](/Kernel.cs) | C# | 121 | 30 | 24 | 175 |
|
||||
| [LuaApps.cs](/LuaApps.cs) | C# | 13 | 0 | 3 | 16 |
|
||||
| [LuaApps/calculator.lua](/LuaApps/calculator.lua) | Lua | 87 | 0 | 11 | 98 |
|
||||
| [LuaApps/helloworld.lua](/LuaApps/helloworld.lua) | Lua | 3 | 0 | 0 | 3 |
|
||||
| [LuaApps/testspeed.lua](/LuaApps/testspeed.lua) | Lua | 6 | 1 | 0 | 7 |
|
||||
| [Shell/CommandList.cs](/Shell/CommandList.cs) | C# | 15 | 0 | 0 | 15 |
|
||||
| [Shell/Commands/Environment/EnvCommand.cs](/Shell/Commands/Environment/EnvCommand.cs) | C# | 68 | 0 | 2 | 70 |
|
||||
| [Shell/Commands/FileSystem/RmCommand.cs](/Shell/Commands/FileSystem/RmCommand.cs) | C# | 18 | 0 | 1 | 19 |
|
||||
| [Shell/Commands/Help/Help.cs](/Shell/Commands/Help/Help.cs) | C# | 24 | 0 | 0 | 24 |
|
||||
| [Shell/Commands/Info/Version.cs](/Shell/Commands/Info/Version.cs) | C# | 1 | 0 | 0 | 1 |
|
||||
| [Shell/Commands/Script/BransweCommand.cs](/Shell/Commands/Script/BransweCommand.cs) | C# | 10 | 0 | 1 | 11 |
|
||||
| [Shell/Commands/Script/ComCommand.cs](/Shell/Commands/Script/ComCommand.cs) | C# | 11 | 0 | 1 | 12 |
|
||||
| [Shell/Commands/Script/LuaCommand.cs](/Shell/Commands/Script/LuaCommand.cs) | C# | 16 | 0 | 1 | 17 |
|
||||
| [Shell/Commands/TestTUICommand.cs](/Shell/Commands/TestTUICommand.cs) | C# | 583 | 0 | 102 | 685 |
|
||||
| [Shell/Commands/User/HostnameCommand.cs](/Shell/Commands/User/HostnameCommand.cs) | C# | 11 | 0 | 1 | 12 |
|
||||
| [Shell/Commands/User/UserCommand.cs](/Shell/Commands/User/UserCommand.cs) | C# | 23 | 0 | 1 | 24 |
|
||||
| [Shell/Commands/Utility/AppManagerCommand.cs](/Shell/Commands/Utility/AppManagerCommand.cs) | C# | 165 | 0 | 30 | 195 |
|
||||
| [Shell/Commands/Utility/Base64Command.cs](/Shell/Commands/Utility/Base64Command.cs) | C# | 31 | 0 | 2 | 33 |
|
||||
| [Shell/Commands/Utility/CalcGuiCommand.cs](/Shell/Commands/Utility/CalcGuiCommand.cs) | C# | 307 | 0 | 28 | 335 |
|
||||
| [Shell/Commands/Utility/MatrixCommand.cs](/Shell/Commands/Utility/MatrixCommand.cs) | C# | 62 | 0 | 13 | 75 |
|
||||
| [Shell/Commands/Utility/SnakeCommand.cs](/Shell/Commands/Utility/SnakeCommand.cs) | C# | 164 | 0 | 27 | 191 |
|
||||
| [Shell/Shell.cs](/Shell/Shell.cs) | C# | 79 | 0 | 13 | 92 |
|
||||
| [Shell/UsageGenerator.cs](/Shell/UsageGenerator.cs) | C# | 211 | 0 | 31 | 242 |
|
||||
| [System/FileSystem.cs](/System/FileSystem.cs) | C# | 4 | 4 | 0 | 8 |
|
||||
| [System/UserSystem.cs](/System/UserSystem.cs) | C# | 8 | -11 | -1 | -4 |
|
||||
| [UI/Components.cs](/UI/Components.cs) | C# | 960 | 0 | 144 | 1,104 |
|
||||
| [UI/TUI.cs](/UI/TUI.cs) | C# | 260 | 2 | 42 | 304 |
|
||||
| [UI/TUIDemo.cs](/UI/TUIDemo.cs) | C# | 279 | 0 | 54 | 333 |
|
||||
| [Utils/Version.cs](/Utils/Version.cs) | C# | 5 | 0 | 1 | 6 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/404.html-B-2P5V78.js](/docs/cmleonos/docs/.vuepress/dist/assets/404.html-B-2P5V78.js) | JavaScript | -1 | 0 | -1 | -2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/404.html-ByTdGTSm.js](/docs/cmleonos/docs/.vuepress/dist/assets/404.html-ByTdGTSm.js) | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/app-BITa06va.js](/docs/cmleonos/docs/.vuepress/dist/assets/app-BITa06va.js) | JavaScript | -28 | -4 | -1 | -33 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/app-C1vKFkGc.js](/docs/cmleonos/docs/.vuepress/dist/assets/app-C1vKFkGc.js) | JavaScript | 28 | 4 | 1 | 33 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/commands.html-CJdMGWM7.js](/docs/cmleonos/docs/.vuepress/dist/assets/commands.html-CJdMGWM7.js) | JavaScript | -143 | 0 | -1 | -144 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/commands.html-DsR2axk8.js](/docs/cmleonos/docs/.vuepress/dist/assets/commands.html-DsR2axk8.js) | JavaScript | 153 | 0 | 1 | 154 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-CfHiKCXZ.js](/docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-CfHiKCXZ.js) | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-D\_vM18Nz.js](/docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-D_vM18Nz.js) | JavaScript | -1 | 0 | -1 | -2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/index.html-BMbDjf\_W.js](/docs/cmleonos/docs/.vuepress/dist/assets/index.html-BMbDjf_W.js) | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/index.html-DS7rXIvH.js](/docs/cmleonos/docs/.vuepress/dist/assets/index.html-DS7rXIvH.js) | JavaScript | -1 | 0 | -1 | -2 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/lua.html-3\_L4TJjQ.js](/docs/cmleonos/docs/.vuepress/dist/assets/lua.html-3_L4TJjQ.js) | JavaScript | 303 | 0 | 1 | 304 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/assets/lua.html-DxDsLuB0.js](/docs/cmleonos/docs/.vuepress/dist/assets/lua.html-DxDsLuB0.js) | JavaScript | -297 | 0 | -1 | -298 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/commands.html](/docs/cmleonos/docs/.vuepress/dist/commands.html) | HTML | 10 | 0 | 0 | 10 |
|
||||
| [docs/cmleonos/docs/.vuepress/dist/lua.html](/docs/cmleonos/docs/.vuepress/dist/lua.html) | HTML | 6 | 0 | 0 | 6 |
|
||||
| [docs/cmleonos/docs/commands.md](/docs/cmleonos/docs/commands.md) | Markdown | 46 | 0 | 10 | 56 |
|
||||
| [docs/cmleonos/docs/get-started.md](/docs/cmleonos/docs/get-started.md) | Markdown | 2 | 0 | 1 | 3 |
|
||||
| [docs/cmleonos/docs/lua.md](/docs/cmleonos/docs/lua.md) | Markdown | 56 | 0 | 17 | 73 |
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details
|
||||
52
.VSCodeCounter/2026-02-11_18-21-42/diff.csv
Normal file
52
.VSCodeCounter/2026-02-11_18-21-42/diff.csv
Normal file
@@ -0,0 +1,52 @@
|
||||
"filename", "language", "C#", "PowerShell", "Batch", "XML", "Lua", "Markdown", "HTML", "JavaScript", "comment", "blank", "total"
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Build.bat", "Batch", 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\CMLeonOS.csproj", "XML", 0, 0, 0, 35, 0, 0, 0, 0, 0, 8, 43
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\GenerateGitCommit.ps1", "PowerShell", 0, 22, 0, 0, 0, 0, 0, 0, 0, 3, 25
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaOsLib.cs", "C#", 103, 0, 0, 0, 0, 0, 0, 0, 0, 17, 120
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Kernel.cs", "C#", 121, 0, 0, 0, 0, 0, 0, 0, 30, 24, 175
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps.cs", "C#", 13, 0, 0, 0, 0, 0, 0, 0, 0, 3, 16
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\calculator.lua", "Lua", 0, 0, 0, 0, 87, 0, 0, 0, 0, 11, 98
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\helloworld.lua", "Lua", 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\testspeed.lua", "Lua", 0, 0, 0, 0, 6, 0, 0, 0, 1, 0, 7
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs", "C#", 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Environment\EnvCommand.cs", "C#", 68, 0, 0, 0, 0, 0, 0, 0, 0, 2, 70
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmCommand.cs", "C#", 18, 0, 0, 0, 0, 0, 0, 0, 0, 1, 19
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs", "C#", 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\Version.cs", "C#", 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\BransweCommand.cs", "C#", 10, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\ComCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\LuaCommand.cs", "C#", 16, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\TestTUICommand.cs", "C#", 583, 0, 0, 0, 0, 0, 0, 0, 0, 102, 685
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\HostnameCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs", "C#", 23, 0, 0, 0, 0, 0, 0, 0, 0, 1, 24
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\AppManagerCommand.cs", "C#", 165, 0, 0, 0, 0, 0, 0, 0, 0, 30, 195
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\Base64Command.cs", "C#", 31, 0, 0, 0, 0, 0, 0, 0, 0, 2, 33
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalcGuiCommand.cs", "C#", 307, 0, 0, 0, 0, 0, 0, 0, 0, 28, 335
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\MatrixCommand.cs", "C#", 62, 0, 0, 0, 0, 0, 0, 0, 0, 13, 75
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\SnakeCommand.cs", "C#", 164, 0, 0, 0, 0, 0, 0, 0, 0, 27, 191
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs", "C#", 79, 0, 0, 0, 0, 0, 0, 0, 0, 13, 92
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\UsageGenerator.cs", "C#", 211, 0, 0, 0, 0, 0, 0, 0, 0, 31, 242
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\FileSystem.cs", "C#", 4, 0, 0, 0, 0, 0, 0, 0, 4, 0, 8
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs", "C#", 8, 0, 0, 0, 0, 0, 0, 0, -11, -1, -4
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\Components.cs", "C#", 960, 0, 0, 0, 0, 0, 0, 0, 0, 144, 1104
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\TUI.cs", "C#", 260, 0, 0, 0, 0, 0, 0, 0, 2, 42, 304
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\TUIDemo.cs", "C#", 279, 0, 0, 0, 0, 0, 0, 0, 0, 54, 333
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Version.cs", "C#", 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-B-2P5V78.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, -2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-ByTdGTSm.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-BITa06va.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, -28, -4, -1, -33
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-C1vKFkGc.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 28, 4, 1, 33
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-CJdMGWM7.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, -143, 0, -1, -144
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-DsR2axk8.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 153, 0, 1, 154
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-CfHiKCXZ.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-D_vM18Nz.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, -2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-BMbDjf_W.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-DS7rXIvH.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, -2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-3_L4TJjQ.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 303, 0, 1, 304
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-DxDsLuB0.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, -297, 0, -1, -298
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\commands.html", "HTML", 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 10
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\lua.html", "HTML", 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 6
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\commands.md", "Markdown", 0, 0, 0, 0, 0, 46, 0, 0, 0, 10, 56
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\get-started.md", "Markdown", 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 3
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\lua.md", "Markdown", 0, 0, 0, 0, 0, 56, 0, 0, 0, 17, 73
|
||||
"Total", "-", 3552, 22, 1, 35, 96, 104, 16, 16, 27, 588, 4457
|
||||
|
54
.VSCodeCounter/2026-02-11_18-21-42/diff.md
Normal file
54
.VSCodeCounter/2026-02-11_18-21-42/diff.md
Normal file
@@ -0,0 +1,54 @@
|
||||
# Diff Summary
|
||||
|
||||
Date : 2026-02-11 18:21:42
|
||||
|
||||
Directory c:\\Users\\leon\\source\\repos\\CMLeonOS\\CMLeonOS
|
||||
|
||||
Total : 50 files, 3842 codes, 27 comments, 588 blanks, all 4457 lines
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md)
|
||||
|
||||
## Languages
|
||||
| language | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| C# | 27 | 3,552 | 25 | 538 | 4,115 |
|
||||
| Markdown | 3 | 104 | 0 | 28 | 132 |
|
||||
| Lua | 3 | 96 | 1 | 11 | 108 |
|
||||
| XML | 1 | 35 | 0 | 8 | 43 |
|
||||
| PowerShell | 1 | 22 | 0 | 3 | 25 |
|
||||
| HTML | 2 | 16 | 0 | 0 | 16 |
|
||||
| JavaScript | 12 | 16 | 0 | 0 | 16 |
|
||||
| Batch | 1 | 1 | 1 | 0 | 2 |
|
||||
|
||||
## Directories
|
||||
| path | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| . | 50 | 3,842 | 27 | 588 | 4,457 |
|
||||
| . (Files) | 5 | 192 | 31 | 38 | 261 |
|
||||
| Interpreter | 1 | 103 | 0 | 17 | 120 |
|
||||
| Interpreter\\UniLua | 1 | 103 | 0 | 17 | 120 |
|
||||
| LuaApps | 3 | 96 | 1 | 11 | 108 |
|
||||
| Shell | 18 | 1,799 | 0 | 254 | 2,053 |
|
||||
| Shell (Files) | 3 | 305 | 0 | 44 | 349 |
|
||||
| Shell\\Commands | 15 | 1,494 | 0 | 210 | 1,704 |
|
||||
| Shell\\Commands (Files) | 1 | 583 | 0 | 102 | 685 |
|
||||
| Shell\\Commands\\Environment | 1 | 68 | 0 | 2 | 70 |
|
||||
| Shell\\Commands\\FileSystem | 1 | 18 | 0 | 1 | 19 |
|
||||
| Shell\\Commands\\Help | 1 | 24 | 0 | 0 | 24 |
|
||||
| Shell\\Commands\\Info | 1 | 1 | 0 | 0 | 1 |
|
||||
| Shell\\Commands\\Script | 3 | 37 | 0 | 3 | 40 |
|
||||
| Shell\\Commands\\User | 2 | 34 | 0 | 2 | 36 |
|
||||
| Shell\\Commands\\Utility | 5 | 729 | 0 | 100 | 829 |
|
||||
| System | 2 | 12 | -7 | -1 | 4 |
|
||||
| UI | 3 | 1,499 | 2 | 240 | 1,741 |
|
||||
| Utils | 1 | 5 | 0 | 1 | 6 |
|
||||
| docs | 17 | 136 | 0 | 28 | 164 |
|
||||
| docs\\cmleonos | 17 | 136 | 0 | 28 | 164 |
|
||||
| docs\\cmleonos\\docs | 17 | 136 | 0 | 28 | 164 |
|
||||
| docs\\cmleonos\\docs (Files) | 3 | 104 | 0 | 28 | 132 |
|
||||
| docs\\cmleonos\\docs\\.vuepress | 14 | 32 | 0 | 0 | 32 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\dist | 14 | 32 | 0 | 0 | 32 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\dist (Files) | 2 | 16 | 0 | 0 | 16 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\dist\\assets | 12 | 16 | 0 | 0 | 16 |
|
||||
|
||||
[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md)
|
||||
107
.VSCodeCounter/2026-02-11_18-21-42/diff.txt
Normal file
107
.VSCodeCounter/2026-02-11_18-21-42/diff.txt
Normal file
@@ -0,0 +1,107 @@
|
||||
Date : 2026-02-11 18:21:42
|
||||
Directory : c:\Users\leon\source\repos\CMLeonOS\CMLeonOS
|
||||
Total : 50 files, 3842 codes, 27 comments, 588 blanks, all 4457 lines
|
||||
|
||||
Languages
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
| language | files | code | comment | blank | total |
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
| C# | 27 | 3,552 | 25 | 538 | 4,115 |
|
||||
| Markdown | 3 | 104 | 0 | 28 | 132 |
|
||||
| Lua | 3 | 96 | 1 | 11 | 108 |
|
||||
| XML | 1 | 35 | 0 | 8 | 43 |
|
||||
| PowerShell | 1 | 22 | 0 | 3 | 25 |
|
||||
| HTML | 2 | 16 | 0 | 0 | 16 |
|
||||
| JavaScript | 12 | 16 | 0 | 0 | 16 |
|
||||
| Batch | 1 | 1 | 1 | 0 | 2 |
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
|
||||
Directories
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| path | files | code | comment | blank | total |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| . | 50 | 3,842 | 27 | 588 | 4,457 |
|
||||
| . (Files) | 5 | 192 | 31 | 38 | 261 |
|
||||
| Interpreter | 1 | 103 | 0 | 17 | 120 |
|
||||
| Interpreter\UniLua | 1 | 103 | 0 | 17 | 120 |
|
||||
| LuaApps | 3 | 96 | 1 | 11 | 108 |
|
||||
| Shell | 18 | 1,799 | 0 | 254 | 2,053 |
|
||||
| Shell (Files) | 3 | 305 | 0 | 44 | 349 |
|
||||
| Shell\Commands | 15 | 1,494 | 0 | 210 | 1,704 |
|
||||
| Shell\Commands (Files) | 1 | 583 | 0 | 102 | 685 |
|
||||
| Shell\Commands\Environment | 1 | 68 | 0 | 2 | 70 |
|
||||
| Shell\Commands\FileSystem | 1 | 18 | 0 | 1 | 19 |
|
||||
| Shell\Commands\Help | 1 | 24 | 0 | 0 | 24 |
|
||||
| Shell\Commands\Info | 1 | 1 | 0 | 0 | 1 |
|
||||
| Shell\Commands\Script | 3 | 37 | 0 | 3 | 40 |
|
||||
| Shell\Commands\User | 2 | 34 | 0 | 2 | 36 |
|
||||
| Shell\Commands\Utility | 5 | 729 | 0 | 100 | 829 |
|
||||
| System | 2 | 12 | -7 | -1 | 4 |
|
||||
| UI | 3 | 1,499 | 2 | 240 | 1,741 |
|
||||
| Utils | 1 | 5 | 0 | 1 | 6 |
|
||||
| docs | 17 | 136 | 0 | 28 | 164 |
|
||||
| docs\cmleonos | 17 | 136 | 0 | 28 | 164 |
|
||||
| docs\cmleonos\docs | 17 | 136 | 0 | 28 | 164 |
|
||||
| docs\cmleonos\docs (Files) | 3 | 104 | 0 | 28 | 132 |
|
||||
| docs\cmleonos\docs\.vuepress | 14 | 32 | 0 | 0 | 32 |
|
||||
| docs\cmleonos\docs\.vuepress\dist | 14 | 32 | 0 | 0 | 32 |
|
||||
| docs\cmleonos\docs\.vuepress\dist (Files) | 2 | 16 | 0 | 0 | 16 |
|
||||
| docs\cmleonos\docs\.vuepress\dist\assets | 12 | 16 | 0 | 0 | 16 |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
|
||||
Files
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| filename | language | code | comment | blank | total |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Build.bat | Batch | 1 | 1 | 0 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\CMLeonOS.csproj | XML | 35 | 0 | 8 | 43 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\GenerateGitCommit.ps1 | PowerShell | 22 | 0 | 3 | 25 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaOsLib.cs | C# | 103 | 0 | 17 | 120 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Kernel.cs | C# | 121 | 30 | 24 | 175 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps.cs | C# | 13 | 0 | 3 | 16 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\calculator.lua | Lua | 87 | 0 | 11 | 98 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\helloworld.lua | Lua | 3 | 0 | 0 | 3 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\testspeed.lua | Lua | 6 | 1 | 0 | 7 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs | C# | 15 | 0 | 0 | 15 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Environment\EnvCommand.cs | C# | 68 | 0 | 2 | 70 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmCommand.cs | C# | 18 | 0 | 1 | 19 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs | C# | 24 | 0 | 0 | 24 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\Version.cs | C# | 1 | 0 | 0 | 1 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\BransweCommand.cs | C# | 10 | 0 | 1 | 11 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\ComCommand.cs | C# | 11 | 0 | 1 | 12 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\LuaCommand.cs | C# | 16 | 0 | 1 | 17 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\TestTUICommand.cs | C# | 583 | 0 | 102 | 685 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\HostnameCommand.cs | C# | 11 | 0 | 1 | 12 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs | C# | 23 | 0 | 1 | 24 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\AppManagerCommand.cs | C# | 165 | 0 | 30 | 195 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\Base64Command.cs | C# | 31 | 0 | 2 | 33 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalcGuiCommand.cs | C# | 307 | 0 | 28 | 335 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\MatrixCommand.cs | C# | 62 | 0 | 13 | 75 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\SnakeCommand.cs | C# | 164 | 0 | 27 | 191 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs | C# | 79 | 0 | 13 | 92 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\UsageGenerator.cs | C# | 211 | 0 | 31 | 242 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\FileSystem.cs | C# | 4 | 4 | 0 | 8 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs | C# | 8 | -11 | -1 | -4 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\Components.cs | C# | 960 | 0 | 144 | 1,104 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\TUI.cs | C# | 260 | 2 | 42 | 304 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\TUIDemo.cs | C# | 279 | 0 | 54 | 333 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Version.cs | C# | 5 | 0 | 1 | 6 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-B-2P5V78.js | JavaScript | -1 | 0 | -1 | -2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-ByTdGTSm.js | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-BITa06va.js | JavaScript | -28 | -4 | -1 | -33 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-C1vKFkGc.js | JavaScript | 28 | 4 | 1 | 33 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-CJdMGWM7.js | JavaScript | -143 | 0 | -1 | -144 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-DsR2axk8.js | JavaScript | 153 | 0 | 1 | 154 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-CfHiKCXZ.js | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-D_vM18Nz.js | JavaScript | -1 | 0 | -1 | -2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-BMbDjf_W.js | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-DS7rXIvH.js | JavaScript | -1 | 0 | -1 | -2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-3_L4TJjQ.js | JavaScript | 303 | 0 | 1 | 304 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-DxDsLuB0.js | JavaScript | -297 | 0 | -1 | -298 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\commands.html | HTML | 10 | 0 | 0 | 10 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\lua.html | HTML | 6 | 0 | 0 | 6 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\commands.md | Markdown | 46 | 0 | 10 | 56 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\get-started.md | Markdown | 2 | 0 | 1 | 3 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\lua.md | Markdown | 56 | 0 | 17 | 73 |
|
||||
| Total | | 3,842 | 27 | 588 | 4,457 |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
147
.VSCodeCounter/2026-02-11_18-21-42/results.csv
Normal file
147
.VSCodeCounter/2026-02-11_18-21-42/results.csv
Normal file
@@ -0,0 +1,147 @@
|
||||
"filename", "language", "C#", "JSON", "PowerShell", "Batch", "Markdown", "XML", "Lua", "HTML", "YAML", "JavaScript", "PostCSS", "comment", "blank", "total"
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Branswe.md", "Markdown", 0, 0, 0, 0, 261, 0, 0, 0, 0, 0, 0, 0, 67, 328
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Build.bat", "Batch", 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\CMLeonOS.csproj", "XML", 0, 0, 0, 0, 0, 84, 0, 0, 0, 0, 0, 1, 14, 99
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Editor.cs", "C#", 267, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 35, 331
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Nano.cs", "C#", 727, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 93, 836
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\GenerateGitCommit.ps1", "PowerShell", 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 25
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\Branswe.cs", "C#", 482, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 53, 563
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\ByteString.cs", "C#", 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 48
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Coder.cs", "C#", 1101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 157, 1284
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Common.cs", "C#", 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 27, 129
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Do.cs", "C#", 269, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 50, 344
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Dump.cs", "C#", 187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 220
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LLex.cs", "C#", 627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 93, 760
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaAPI.cs", "C#", 1335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 240, 1639
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaAuxLib.cs", "C#", 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 92, 756
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaBaseLib.cs", "C#", 406, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 43, 458
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaBitLib.cs", "C#", 179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 205
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaCoroLib.cs", "C#", 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 153
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaDebug.cs", "C#", 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 55, 517
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaDebugLib.cs", "C#", 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 26
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaEncLib.cs", "C#", 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 64
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaFile.cs", "C#", 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 18, 135
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaFunc.cs", "C#", 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 20, 95
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaIOLib.cs", "C#", 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 19, 101
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaJsonLib.cs", "C#", 461, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 526
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaMathLib.cs", "C#", 285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 49, 344
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaObject.cs", "C#", 367, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 52, 420
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaOsLib.cs", "C#", 309, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 358
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaPkgLib.cs", "C#", 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 47, 360
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaState.cs", "C#", 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 51, 307
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaStrLib.cs", "C#", 869, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 61, 938
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaTable.cs", "C#", 465, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 80, 582
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaTableLib.cs", "C#", 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 24, 282
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\OpCodes.cs", "C#", 131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 27, 165
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Parser.cs", "C#", 1588, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 139, 219, 1946
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\TagMethod.cs", "C#", 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 10, 103
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\ULDebug.cs", "C#", 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 20
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Undump.cs", "C#", 321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 50, 377
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Util.cs", "C#", 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 39, 239
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\VM.cs", "C#", 1038, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 161, 1257
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Kernel.cs", "C#", 349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 67, 479
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LISENCE.md", "Markdown", 0, 0, 0, 0, 485, 0, 0, 0, 0, 0, 0, 0, 110, 595
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\LogEntry.cs", "C#", 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 46
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\LogLevel.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\Logger.cs", "C#", 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 112
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps.cs", "C#", 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 16
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\calculator.lua", "Lua", 0, 0, 0, 0, 0, 0, 87, 0, 0, 0, 0, 0, 11, 98
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\helloworld.lua", "Lua", 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 3
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\testspeed.lua", "Lua", 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 1, 0, 7
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\README.md", "Markdown", 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Settings\Settings.cs", "C#", 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 157
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs", "C#", 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 224
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Editor\EditCommand.cs", "C#", 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 27
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Editor\NanoCommand.cs", "C#", 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 27
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Environment\EnvCommand.cs", "C#", 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 185
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CatCommand.cs", "C#", 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 20
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CdCommand.cs", "C#", 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CopyCommand.cs", "C#", 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 46
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\DiskInfoCommand.cs", "C#", 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 33
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\FindCommand.cs", "C#", 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 42
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\HeadCommand.cs", "C#", 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 54
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\LsCommand.cs", "C#", 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\MkdirCommand.cs", "C#", 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 22
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\MoveCommand.cs", "C#", 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 48
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\PwdCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 13
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RenameCommand.cs", "C#", 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 57
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmCommand.cs", "C#", 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 66
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmdirCommand.cs", "C#", 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 30
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TailCommand.cs", "C#", 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 55
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TouchCommand.cs", "C#", 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 28
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TreeCommand.cs", "C#", 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 78
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\WordCountCommand.cs", "C#", 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 51
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs", "C#", 531, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 557
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\About.cs", "C#", 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 14
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\Version.cs", "C#", 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 19
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\LabyrinthCommand.cs", "C#", 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 248
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Power\RestartCommand.cs", "C#", 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 15
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Power\ShutdownCommand.cs", "C#", 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 15
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\BransweCommand.cs", "C#", 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 48
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\ComCommand.cs", "C#", 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 63
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\LuaCommand.cs", "C#", 181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 203
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\ClearCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 13
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\DateCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 13
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\EchoCommand.cs", "C#", 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 14
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\SettingsCommand.cs", "C#", 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 70
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\TimeCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 13
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\UptimeCommand.cs", "C#", 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 46
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\WhoamiCommand.cs", "C#", 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 18
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\TestGuiCommand.cs", "C#", 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 86
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\TestTUICommand.cs", "C#", 583, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102, 685
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\CpassCommand.cs", "C#", 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\HostnameCommand.cs", "C#", 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 31
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs", "C#", 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 109
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\AliasCommand.cs", "C#", 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 159
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\AppManagerCommand.cs", "C#", 165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 195
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\BackgroundCommand.cs", "C#", 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 117
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\Base64Command.cs", "C#", 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 101
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\BeepCommand.cs", "C#", 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 13
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalcCommand.cs", "C#", 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 60
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalcGuiCommand.cs", "C#", 307, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 335
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalendarCommand.cs", "C#", 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 70
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\HistoryCommand.cs", "C#", 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 17
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\MatrixCommand.cs", "C#", 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 75
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\PromptCommand.cs", "C#", 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 20
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\SnakeCommand.cs", "C#", 164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 191
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs", "C#", 1537, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 278, 1838
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\UsageGenerator.cs", "C#", 211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 242
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\FileSystem.cs", "C#", 404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 40, 465
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs", "C#", 691, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 104, 806
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\CUI.cs", "C#", 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 28, 158
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\Components.cs", "C#", 960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, 1104
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\TUI.cs", "C#", 260, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 42, 304
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\TUIDemo.cs", "C#", 279, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 333
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Base64.cs", "C#", 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 22, 164
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\EnvironmentVariableManager.cs", "C#", 151, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 17, 173
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\NetworkConfigManager.cs", "C#", 111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 127
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\SHA256.cs", "C#", 179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 41, 226
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Version.cs", "C#", 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 34
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\@vue_devtools-api.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 4356, 0, 145, 5, 4506
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\@vuepress_shared.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 0, 2, 1, 137
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\_metadata.json", "JSON", 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\chunk-OARA6QKZ.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 12582, 0, 238, 5, 12825
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\package.json", "JSON", 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\vue-router.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 2371, 0, 25, 9, 2405
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\vue.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 346, 0, 0, 1, 347
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\config.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 1, 7, 20
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\404.html", "HTML", 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 0, 4, 44
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-ByTdGTSm.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-C1vKFkGc.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 4, 1, 33
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-DsR2axk8.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 153, 0, 0, 1, 154
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-CfHiKCXZ.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-BMbDjf_W.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-3_L4TJjQ.js", "JavaScript", 0, 0, 0, 0, 0, 0, 0, 0, 0, 303, 0, 0, 1, 304
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\style-BmL0kmLr.css", "PostCSS", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\commands.html", "HTML", 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 4, 196
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\get-started.html", "HTML", 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 0, 4, 44
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\index.html", "HTML", 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 0, 4, 44
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\lua.html", "HTML", 0, 0, 0, 0, 0, 0, 0, 342, 0, 0, 0, 0, 4, 346
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\README.md", "Markdown", 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 4, 37
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\commands.md", "Markdown", 0, 0, 0, 0, 675, 0, 0, 0, 0, 0, 0, 0, 201, 876
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\get-started.md", "Markdown", 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 4, 20
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\lua.md", "Markdown", 0, 0, 0, 0, 996, 0, 0, 0, 0, 0, 0, 0, 356, 1352
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\package.json", "JSON", 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 21
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\pnpm-lock.yaml", "YAML", 0, 0, 0, 0, 0, 0, 0, 0, 2410, 0, 0, 0, 674, 3084
|
||||
"c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\global.json", "JSON", 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6
|
||||
"Total", "-", 24083, 66, 22, 1, 2468, 84, 96, 654, 2410, 20288, 1, 1262, 5030, 56465
|
||||
|
1
.VSCodeCounter/2026-02-11_18-21-42/results.json
Normal file
1
.VSCodeCounter/2026-02-11_18-21-42/results.json
Normal file
File diff suppressed because one or more lines are too long
68
.VSCodeCounter/2026-02-11_18-21-42/results.md
Normal file
68
.VSCodeCounter/2026-02-11_18-21-42/results.md
Normal file
@@ -0,0 +1,68 @@
|
||||
# Summary
|
||||
|
||||
Date : 2026-02-11 18:21:42
|
||||
|
||||
Directory c:\\Users\\leon\\source\\repos\\CMLeonOS\\CMLeonOS
|
||||
|
||||
Total : 145 files, 50173 codes, 1262 comments, 5030 blanks, all 56465 lines
|
||||
|
||||
Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
|
||||
## Languages
|
||||
| language | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| C# | 109 | 24,083 | 844 | 3,529 | 28,456 |
|
||||
| JavaScript | 12 | 20,288 | 415 | 34 | 20,737 |
|
||||
| Markdown | 7 | 2,468 | 0 | 742 | 3,210 |
|
||||
| YAML | 1 | 2,410 | 0 | 674 | 3,084 |
|
||||
| HTML | 5 | 654 | 0 | 20 | 674 |
|
||||
| Lua | 3 | 96 | 1 | 11 | 108 |
|
||||
| XML | 1 | 84 | 1 | 14 | 99 |
|
||||
| JSON | 4 | 66 | 0 | 2 | 68 |
|
||||
| PowerShell | 1 | 22 | 0 | 3 | 25 |
|
||||
| Batch | 1 | 1 | 1 | 0 | 2 |
|
||||
| PostCSS | 1 | 1 | 0 | 1 | 2 |
|
||||
|
||||
## Directories
|
||||
| path | files | code | comment | blank | total |
|
||||
| :--- | ---: | ---: | ---: | ---: | ---: |
|
||||
| . | 145 | 50,173 | 1,262 | 5,030 | 56,465 |
|
||||
| . (Files) | 9 | 1,223 | 65 | 264 | 1,552 |
|
||||
| Editor | 2 | 994 | 45 | 128 | 1,167 |
|
||||
| Interpreter | 34 | 13,160 | 604 | 1,957 | 15,721 |
|
||||
| Interpreter (Files) | 1 | 482 | 28 | 53 | 563 |
|
||||
| Interpreter\\UniLua | 33 | 12,678 | 576 | 1,904 | 15,158 |
|
||||
| Logger | 3 | 146 | 0 | 24 | 170 |
|
||||
| LuaApps | 3 | 96 | 1 | 11 | 108 |
|
||||
| Settings | 1 | 140 | 0 | 17 | 157 |
|
||||
| Shell | 56 | 6,010 | 23 | 819 | 6,852 |
|
||||
| Shell (Files) | 3 | 1,971 | 23 | 310 | 2,304 |
|
||||
| Shell\\Commands | 53 | 4,039 | 0 | 509 | 4,548 |
|
||||
| Shell\\Commands (Files) | 3 | 884 | 0 | 135 | 1,019 |
|
||||
| Shell\\Commands\\Editor | 2 | 48 | 0 | 6 | 54 |
|
||||
| Shell\\Commands\\Environment | 1 | 175 | 0 | 10 | 185 |
|
||||
| Shell\\Commands\\FileSystem | 17 | 580 | 0 | 85 | 665 |
|
||||
| Shell\\Commands\\Help | 1 | 531 | 0 | 26 | 557 |
|
||||
| Shell\\Commands\\Info | 2 | 29 | 0 | 4 | 33 |
|
||||
| Shell\\Commands\\Power | 2 | 26 | 0 | 4 | 30 |
|
||||
| Shell\\Commands\\Script | 3 | 277 | 0 | 37 | 314 |
|
||||
| Shell\\Commands\\System | 7 | 163 | 0 | 24 | 187 |
|
||||
| Shell\\Commands\\User | 3 | 134 | 0 | 17 | 151 |
|
||||
| Shell\\Commands\\Utility | 12 | 1,192 | 0 | 161 | 1,353 |
|
||||
| System | 2 | 1,095 | 32 | 144 | 1,271 |
|
||||
| UI | 4 | 1,621 | 10 | 268 | 1,899 |
|
||||
| Utils | 5 | 555 | 67 | 102 | 724 |
|
||||
| docs | 26 | 25,133 | 415 | 1,296 | 26,844 |
|
||||
| docs\\cmleonos | 26 | 25,133 | 415 | 1,296 | 26,844 |
|
||||
| docs\\cmleonos (Files) | 2 | 2,430 | 0 | 675 | 3,105 |
|
||||
| docs\\cmleonos\\docs | 24 | 22,703 | 415 | 621 | 23,739 |
|
||||
| docs\\cmleonos\\docs (Files) | 4 | 1,720 | 0 | 565 | 2,285 |
|
||||
| docs\\cmleonos\\docs\\.vuepress | 20 | 20,983 | 415 | 56 | 21,454 |
|
||||
| docs\\cmleonos\\docs\\.vuepress (Files) | 1 | 12 | 1 | 7 | 20 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\.cache | 7 | 19,829 | 410 | 22 | 20,261 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\.cache\\deps | 7 | 19,829 | 410 | 22 | 20,261 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\dist | 12 | 1,142 | 4 | 27 | 1,173 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\dist (Files) | 5 | 654 | 0 | 20 | 674 |
|
||||
| docs\\cmleonos\\docs\\.vuepress\\dist\\assets | 7 | 488 | 4 | 7 | 499 |
|
||||
|
||||
Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
|
||||
216
.VSCodeCounter/2026-02-11_18-21-42/results.txt
Normal file
216
.VSCodeCounter/2026-02-11_18-21-42/results.txt
Normal file
@@ -0,0 +1,216 @@
|
||||
Date : 2026-02-11 18:21:42
|
||||
Directory : c:\Users\leon\source\repos\CMLeonOS\CMLeonOS
|
||||
Total : 145 files, 50173 codes, 1262 comments, 5030 blanks, all 56465 lines
|
||||
|
||||
Languages
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
| language | files | code | comment | blank | total |
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
| C# | 109 | 24,083 | 844 | 3,529 | 28,456 |
|
||||
| JavaScript | 12 | 20,288 | 415 | 34 | 20,737 |
|
||||
| Markdown | 7 | 2,468 | 0 | 742 | 3,210 |
|
||||
| YAML | 1 | 2,410 | 0 | 674 | 3,084 |
|
||||
| HTML | 5 | 654 | 0 | 20 | 674 |
|
||||
| Lua | 3 | 96 | 1 | 11 | 108 |
|
||||
| XML | 1 | 84 | 1 | 14 | 99 |
|
||||
| JSON | 4 | 66 | 0 | 2 | 68 |
|
||||
| PowerShell | 1 | 22 | 0 | 3 | 25 |
|
||||
| Batch | 1 | 1 | 1 | 0 | 2 |
|
||||
| PostCSS | 1 | 1 | 0 | 1 | 2 |
|
||||
+------------+------------+------------+------------+------------+------------+
|
||||
|
||||
Directories
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| path | files | code | comment | blank | total |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| . | 145 | 50,173 | 1,262 | 5,030 | 56,465 |
|
||||
| . (Files) | 9 | 1,223 | 65 | 264 | 1,552 |
|
||||
| Editor | 2 | 994 | 45 | 128 | 1,167 |
|
||||
| Interpreter | 34 | 13,160 | 604 | 1,957 | 15,721 |
|
||||
| Interpreter (Files) | 1 | 482 | 28 | 53 | 563 |
|
||||
| Interpreter\UniLua | 33 | 12,678 | 576 | 1,904 | 15,158 |
|
||||
| Logger | 3 | 146 | 0 | 24 | 170 |
|
||||
| LuaApps | 3 | 96 | 1 | 11 | 108 |
|
||||
| Settings | 1 | 140 | 0 | 17 | 157 |
|
||||
| Shell | 56 | 6,010 | 23 | 819 | 6,852 |
|
||||
| Shell (Files) | 3 | 1,971 | 23 | 310 | 2,304 |
|
||||
| Shell\Commands | 53 | 4,039 | 0 | 509 | 4,548 |
|
||||
| Shell\Commands (Files) | 3 | 884 | 0 | 135 | 1,019 |
|
||||
| Shell\Commands\Editor | 2 | 48 | 0 | 6 | 54 |
|
||||
| Shell\Commands\Environment | 1 | 175 | 0 | 10 | 185 |
|
||||
| Shell\Commands\FileSystem | 17 | 580 | 0 | 85 | 665 |
|
||||
| Shell\Commands\Help | 1 | 531 | 0 | 26 | 557 |
|
||||
| Shell\Commands\Info | 2 | 29 | 0 | 4 | 33 |
|
||||
| Shell\Commands\Power | 2 | 26 | 0 | 4 | 30 |
|
||||
| Shell\Commands\Script | 3 | 277 | 0 | 37 | 314 |
|
||||
| Shell\Commands\System | 7 | 163 | 0 | 24 | 187 |
|
||||
| Shell\Commands\User | 3 | 134 | 0 | 17 | 151 |
|
||||
| Shell\Commands\Utility | 12 | 1,192 | 0 | 161 | 1,353 |
|
||||
| System | 2 | 1,095 | 32 | 144 | 1,271 |
|
||||
| UI | 4 | 1,621 | 10 | 268 | 1,899 |
|
||||
| Utils | 5 | 555 | 67 | 102 | 724 |
|
||||
| docs | 26 | 25,133 | 415 | 1,296 | 26,844 |
|
||||
| docs\cmleonos | 26 | 25,133 | 415 | 1,296 | 26,844 |
|
||||
| docs\cmleonos (Files) | 2 | 2,430 | 0 | 675 | 3,105 |
|
||||
| docs\cmleonos\docs | 24 | 22,703 | 415 | 621 | 23,739 |
|
||||
| docs\cmleonos\docs (Files) | 4 | 1,720 | 0 | 565 | 2,285 |
|
||||
| docs\cmleonos\docs\.vuepress | 20 | 20,983 | 415 | 56 | 21,454 |
|
||||
| docs\cmleonos\docs\.vuepress (Files) | 1 | 12 | 1 | 7 | 20 |
|
||||
| docs\cmleonos\docs\.vuepress\.cache | 7 | 19,829 | 410 | 22 | 20,261 |
|
||||
| docs\cmleonos\docs\.vuepress\.cache\deps | 7 | 19,829 | 410 | 22 | 20,261 |
|
||||
| docs\cmleonos\docs\.vuepress\dist | 12 | 1,142 | 4 | 27 | 1,173 |
|
||||
| docs\cmleonos\docs\.vuepress\dist (Files) | 5 | 654 | 0 | 20 | 674 |
|
||||
| docs\cmleonos\docs\.vuepress\dist\assets | 7 | 488 | 4 | 7 | 499 |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
|
||||
Files
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| filename | language | code | comment | blank | total |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Branswe.md | Markdown | 261 | 0 | 67 | 328 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Build.bat | Batch | 1 | 1 | 0 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\CMLeonOS.csproj | XML | 84 | 1 | 14 | 99 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Editor.cs | C# | 267 | 29 | 35 | 331 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Editor\Nano.cs | C# | 727 | 16 | 93 | 836 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\GenerateGitCommit.ps1 | PowerShell | 22 | 0 | 3 | 25 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\Branswe.cs | C# | 482 | 28 | 53 | 563 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\ByteString.cs | C# | 41 | 0 | 7 | 48 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Coder.cs | C# | 1,101 | 26 | 157 | 1,284 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Common.cs | C# | 99 | 3 | 27 | 129 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Do.cs | C# | 269 | 25 | 50 | 344 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Dump.cs | C# | 187 | 0 | 33 | 220 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LLex.cs | C# | 627 | 40 | 93 | 760 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaAPI.cs | C# | 1,335 | 64 | 240 | 1,639 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaAuxLib.cs | C# | 643 | 21 | 92 | 756 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaBaseLib.cs | C# | 406 | 9 | 43 | 458 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaBitLib.cs | C# | 179 | 0 | 26 | 205 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaCoroLib.cs | C# | 137 | 0 | 16 | 153 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaDebug.cs | C# | 443 | 19 | 55 | 517 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaDebugLib.cs | C# | 20 | 0 | 6 | 26 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaEncLib.cs | C# | 51 | 0 | 13 | 64 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaFile.cs | C# | 115 | 2 | 18 | 135 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaFunc.cs | C# | 69 | 6 | 20 | 95 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaIOLib.cs | C# | 70 | 12 | 19 | 101 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaJsonLib.cs | C# | 461 | 0 | 65 | 526 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaMathLib.cs | C# | 285 | 10 | 49 | 344 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaObject.cs | C# | 367 | 1 | 52 | 420 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaOsLib.cs | C# | 309 | 0 | 49 | 358 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaPkgLib.cs | C# | 256 | 57 | 47 | 360 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaState.cs | C# | 250 | 6 | 51 | 307 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaStrLib.cs | C# | 869 | 8 | 61 | 938 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaTable.cs | C# | 465 | 37 | 80 | 582 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\LuaTableLib.cs | C# | 250 | 8 | 24 | 282 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\OpCodes.cs | C# | 131 | 7 | 27 | 165 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Parser.cs | C# | 1,588 | 139 | 219 | 1,946 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\TagMethod.cs | C# | 91 | 2 | 10 | 103 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\ULDebug.cs | C# | 13 | 2 | 5 | 20 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Undump.cs | C# | 321 | 6 | 50 | 377 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\Util.cs | C# | 192 | 8 | 39 | 239 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Interpreter\UniLua\VM.cs | C# | 1,038 | 58 | 161 | 1,257 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Kernel.cs | C# | 349 | 63 | 67 | 479 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LISENCE.md | Markdown | 485 | 0 | 110 | 595 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\LogEntry.cs | C# | 41 | 0 | 5 | 46 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\LogLevel.cs | C# | 11 | 0 | 1 | 12 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Logger\Logger.cs | C# | 94 | 0 | 18 | 112 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps.cs | C# | 13 | 0 | 3 | 16 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\calculator.lua | Lua | 87 | 0 | 11 | 98 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\helloworld.lua | Lua | 3 | 0 | 0 | 3 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\LuaApps\testspeed.lua | Lua | 6 | 1 | 0 | 7 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\README.md | Markdown | 2 | 0 | 0 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Settings\Settings.cs | C# | 140 | 0 | 17 | 157 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\CommandList.cs | C# | 223 | 0 | 1 | 224 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Editor\EditCommand.cs | C# | 24 | 0 | 3 | 27 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Editor\NanoCommand.cs | C# | 24 | 0 | 3 | 27 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Environment\EnvCommand.cs | C# | 175 | 0 | 10 | 185 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CatCommand.cs | C# | 18 | 0 | 2 | 20 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CdCommand.cs | C# | 10 | 0 | 1 | 11 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\CopyCommand.cs | C# | 40 | 0 | 6 | 46 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\DiskInfoCommand.cs | C# | 28 | 0 | 5 | 33 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\FindCommand.cs | C# | 37 | 0 | 5 | 42 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\HeadCommand.cs | C# | 46 | 0 | 8 | 54 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\LsCommand.cs | C# | 10 | 0 | 1 | 11 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\MkdirCommand.cs | C# | 20 | 0 | 2 | 22 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\MoveCommand.cs | C# | 41 | 0 | 7 | 48 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\PwdCommand.cs | C# | 11 | 0 | 2 | 13 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RenameCommand.cs | C# | 48 | 0 | 9 | 57 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmCommand.cs | C# | 60 | 0 | 6 | 66 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\RmdirCommand.cs | C# | 27 | 0 | 3 | 30 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TailCommand.cs | C# | 47 | 0 | 8 | 55 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TouchCommand.cs | C# | 25 | 0 | 3 | 28 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\TreeCommand.cs | C# | 67 | 0 | 11 | 78 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\FileSystem\WordCountCommand.cs | C# | 45 | 0 | 6 | 51 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Help\Help.cs | C# | 531 | 0 | 26 | 557 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\About.cs | C# | 12 | 0 | 2 | 14 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Info\Version.cs | C# | 17 | 0 | 2 | 19 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\LabyrinthCommand.cs | C# | 224 | 0 | 24 | 248 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Power\RestartCommand.cs | C# | 13 | 0 | 2 | 15 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Power\ShutdownCommand.cs | C# | 13 | 0 | 2 | 15 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\BransweCommand.cs | C# | 42 | 0 | 6 | 48 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\ComCommand.cs | C# | 54 | 0 | 9 | 63 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Script\LuaCommand.cs | C# | 181 | 0 | 22 | 203 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\ClearCommand.cs | C# | 11 | 0 | 2 | 13 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\DateCommand.cs | C# | 11 | 0 | 2 | 13 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\EchoCommand.cs | C# | 12 | 0 | 2 | 14 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\SettingsCommand.cs | C# | 62 | 0 | 8 | 70 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\TimeCommand.cs | C# | 11 | 0 | 2 | 13 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\UptimeCommand.cs | C# | 40 | 0 | 6 | 46 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\System\WhoamiCommand.cs | C# | 16 | 0 | 2 | 18 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\TestGuiCommand.cs | C# | 77 | 0 | 9 | 86 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\TestTUICommand.cs | C# | 583 | 0 | 102 | 685 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\CpassCommand.cs | C# | 10 | 0 | 1 | 11 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\HostnameCommand.cs | C# | 27 | 0 | 4 | 31 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\User\UserCommand.cs | C# | 97 | 0 | 12 | 109 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\AliasCommand.cs | C# | 140 | 0 | 19 | 159 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\AppManagerCommand.cs | C# | 165 | 0 | 30 | 195 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\BackgroundCommand.cs | C# | 108 | 0 | 9 | 117 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\Base64Command.cs | C# | 89 | 0 | 12 | 101 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\BeepCommand.cs | C# | 11 | 0 | 2 | 13 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalcCommand.cs | C# | 56 | 0 | 4 | 60 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalcGuiCommand.cs | C# | 307 | 0 | 28 | 335 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\CalendarCommand.cs | C# | 57 | 0 | 13 | 70 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\HistoryCommand.cs | C# | 15 | 0 | 2 | 17 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\MatrixCommand.cs | C# | 62 | 0 | 13 | 75 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\PromptCommand.cs | C# | 18 | 0 | 2 | 20 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Commands\Utility\SnakeCommand.cs | C# | 164 | 0 | 27 | 191 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\Shell.cs | C# | 1,537 | 23 | 278 | 1,838 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Shell\UsageGenerator.cs | C# | 211 | 0 | 31 | 242 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\FileSystem.cs | C# | 404 | 21 | 40 | 465 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\System\UserSystem.cs | C# | 691 | 11 | 104 | 806 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\CUI.cs | C# | 122 | 8 | 28 | 158 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\Components.cs | C# | 960 | 0 | 144 | 1,104 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\TUI.cs | C# | 260 | 2 | 42 | 304 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\UI\TUIDemo.cs | C# | 279 | 0 | 54 | 333 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Base64.cs | C# | 86 | 56 | 22 | 164 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\EnvironmentVariableManager.cs | C# | 151 | 5 | 17 | 173 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\NetworkConfigManager.cs | C# | 111 | 0 | 16 | 127 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\SHA256.cs | C# | 179 | 6 | 41 | 226 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\Utils\Version.cs | C# | 28 | 0 | 6 | 34 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\@vue_devtools-api.js | JavaScript | 4,356 | 145 | 5 | 4,506 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\@vuepress_shared.js | JavaScript | 134 | 2 | 1 | 137 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\_metadata.json | JSON | 37 | 0 | 0 | 37 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\chunk-OARA6QKZ.js | JavaScript | 12,582 | 238 | 5 | 12,825 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\package.json | JSON | 3 | 0 | 1 | 4 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\vue-router.js | JavaScript | 2,371 | 25 | 9 | 2,405 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\.cache\deps\vue.js | JavaScript | 346 | 0 | 1 | 347 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\config.js | JavaScript | 12 | 1 | 7 | 20 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\404.html | HTML | 40 | 0 | 4 | 44 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\404.html-ByTdGTSm.js | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\app-C1vKFkGc.js | JavaScript | 28 | 4 | 1 | 33 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\commands.html-DsR2axk8.js | JavaScript | 153 | 0 | 1 | 154 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\get-started.html-CfHiKCXZ.js | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\index.html-BMbDjf_W.js | JavaScript | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\lua.html-3_L4TJjQ.js | JavaScript | 303 | 0 | 1 | 304 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\assets\style-BmL0kmLr.css | PostCSS | 1 | 0 | 1 | 2 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\commands.html | HTML | 192 | 0 | 4 | 196 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\get-started.html | HTML | 40 | 0 | 4 | 44 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\index.html | HTML | 40 | 0 | 4 | 44 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\.vuepress\dist\lua.html | HTML | 342 | 0 | 4 | 346 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\README.md | Markdown | 33 | 0 | 4 | 37 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\commands.md | Markdown | 675 | 0 | 201 | 876 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\get-started.md | Markdown | 16 | 0 | 4 | 20 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\docs\lua.md | Markdown | 996 | 0 | 356 | 1,352 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\package.json | JSON | 20 | 0 | 1 | 21 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\docs\cmleonos\pnpm-lock.yaml | YAML | 2,410 | 0 | 674 | 3,084 |
|
||||
| c:\Users\leon\source\repos\CMLeonOS\CMLeonOS\global.json | JSON | 6 | 0 | 0 | 6 |
|
||||
| Total | | 50,173 | 1,262 | 5,030 | 56,465 |
|
||||
+--------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -56,3 +56,5 @@ coverage/
|
||||
|
||||
# Release files
|
||||
*.release
|
||||
|
||||
main.map
|
||||
157
BootMenu.cs
Normal file
157
BootMenu.cs
Normal file
@@ -0,0 +1,157 @@
|
||||
using System;
|
||||
using Sys = Cosmos.System;
|
||||
using Cosmos.HAL;
|
||||
using Cosmos.Core;
|
||||
using System.Threading;
|
||||
|
||||
namespace CMLeonOS
|
||||
{
|
||||
public enum BootMenuAction
|
||||
{
|
||||
NormalBoot,
|
||||
Reboot,
|
||||
Shutdown
|
||||
}
|
||||
|
||||
internal static class BootMenu
|
||||
{
|
||||
private static void PrintOption(string text, bool selected)
|
||||
{
|
||||
Console.SetCursorPosition(1, Console.GetCursorPosition().Top);
|
||||
|
||||
Console.BackgroundColor = selected ? ConsoleColor.White : ConsoleColor.Black;
|
||||
Console.ForegroundColor = selected ? ConsoleColor.Black : ConsoleColor.White;
|
||||
|
||||
Console.WriteLine(text);
|
||||
}
|
||||
|
||||
private static void Render(int selIdx, int remainingTime)
|
||||
{
|
||||
Console.BackgroundColor = ConsoleColor.Black;
|
||||
Console.ForegroundColor = ConsoleColor.Cyan;
|
||||
|
||||
Console.SetCursorPosition(0, 0);
|
||||
|
||||
uint mem = Cosmos.Core.CPU.GetAmountOfRAM();
|
||||
Console.WriteLine($"{Version.DisplayVersion} [{mem} MB memory]");
|
||||
// 这里老显示 unknown,谁知道为啥
|
||||
// Console.WriteLine($"Git Commit: {Version.GitCommit}");
|
||||
Console.WriteLine($"Build Time: {GetBuildTime()}");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine($"Auto-select in {remainingTime} seconds...");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Select an option:");
|
||||
Console.WriteLine();
|
||||
|
||||
PrintOption("Normal Boot", selIdx == 0);
|
||||
PrintOption("Reboot", selIdx == 1);
|
||||
PrintOption("Shutdown", selIdx == 2);
|
||||
}
|
||||
|
||||
private static BootMenuAction Confirm(int selIdx)
|
||||
{
|
||||
Console.BackgroundColor = ConsoleColor.Black;
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
|
||||
Console.Clear();
|
||||
|
||||
Console.SetCursorPosition(0, 0);
|
||||
|
||||
Console.CursorVisible = true;
|
||||
|
||||
switch (selIdx)
|
||||
{
|
||||
case 0:
|
||||
return BootMenuAction.NormalBoot;
|
||||
case 1:
|
||||
Sys.Power.Reboot();
|
||||
return BootMenuAction.Reboot;
|
||||
case 2:
|
||||
Sys.Power.Shutdown();
|
||||
return BootMenuAction.Shutdown;
|
||||
default:
|
||||
return BootMenuAction.NormalBoot;
|
||||
}
|
||||
}
|
||||
|
||||
public static BootMenuAction Show()
|
||||
{
|
||||
Console.BackgroundColor = ConsoleColor.Black;
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
|
||||
Console.Clear();
|
||||
|
||||
Console.CursorVisible = false;
|
||||
|
||||
int selIdx = 0;
|
||||
int remainingTime = 10;
|
||||
int counter = 0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
Render(selIdx, remainingTime);
|
||||
|
||||
if (Sys.KeyboardManager.TryReadKey(out var key))
|
||||
{
|
||||
if (key.Key == Sys.ConsoleKeyEx.Enter)
|
||||
{
|
||||
return Confirm(selIdx);
|
||||
}
|
||||
else if (key.Key == Sys.ConsoleKeyEx.DownArrow)
|
||||
{
|
||||
selIdx++;
|
||||
remainingTime = 10;
|
||||
counter = 0;
|
||||
}
|
||||
else if (key.Key == Sys.ConsoleKeyEx.UpArrow)
|
||||
{
|
||||
selIdx--;
|
||||
remainingTime = 10;
|
||||
counter = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
counter++;
|
||||
|
||||
if (counter >= 10)
|
||||
{
|
||||
remainingTime--;
|
||||
counter = 0;
|
||||
|
||||
if (remainingTime <= 0)
|
||||
{
|
||||
return Confirm(selIdx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (selIdx < 0)
|
||||
{
|
||||
selIdx = 2;
|
||||
}
|
||||
|
||||
if (selIdx > 2)
|
||||
{
|
||||
selIdx = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetBuildTime()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Kernel.buildTimeFile != null && Kernel.buildTimeFile.Length > 0)
|
||||
{
|
||||
return System.Text.Encoding.UTF8.GetString(Kernel.buildTimeFile);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Build.bat
Normal file
2
Build.bat
Normal file
@@ -0,0 +1,2 @@
|
||||
"D:\Microsoft Visual Studio\18\Community\MSBuild\Current\Bin\amd64\MSBuild.exe" "CMLeonOS.csproj" /t:Build /p:Configuration=Fixed_Release /p:Platform=x64
|
||||
@REM "C:\Program Files (x86)\VMware\VMware Workstation\vmplayer.exe" "C:\Users\leon\AppData\Roaming\Cosmos User Kit\Build\VMware\Workstation\Cosmos.vmx"
|
||||
3
BuildTime.ps1
Normal file
3
BuildTime.ps1
Normal file
@@ -0,0 +1,3 @@
|
||||
$buildTime = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
|
||||
$buildTime | Out-File -FilePath "BuildTime.txt" -Encoding ASCII -NoNewline
|
||||
Write-Host "Build time written to BuildTime.txt: $buildTime"
|
||||
1
BuildTime.txt
Normal file
1
BuildTime.txt
Normal file
@@ -0,0 +1 @@
|
||||
2026-02-26 20:25:24
|
||||
@@ -6,7 +6,7 @@
|
||||
<Platform>cosmos</Platform>
|
||||
<SupportsX86Intrinsics>false</SupportsX86Intrinsics>
|
||||
<SelfContained>True</SelfContained>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<Platforms>AnyCPU;x64;ARM64</Platforms>
|
||||
<Configurations>Debug;Release;Fixed_Release</Configurations>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -20,18 +20,60 @@
|
||||
<Description>Use VMware Player or Workstation to deploy and debug.</Description>
|
||||
<PxeInterface>192.168.0.8</PxeInterface>
|
||||
<CompressionType>Gzip</CompressionType>
|
||||
<BinFormat>Elf</BinFormat>
|
||||
<BinFormat>Bin</BinFormat>
|
||||
<DebugEnabled>False</DebugEnabled>
|
||||
<CompileVBEMultiboot>False</CompileVBEMultiboot>
|
||||
<RemoveBootDebugOutput>False</RemoveBootDebugOutput>
|
||||
<RemoveBootDebugOutput>True</RemoveBootDebugOutput>
|
||||
<CosmosDisableDebugger>true</CosmosDisableDebugger>
|
||||
<CosmosDebugLevel>None</CosmosDebugLevel>
|
||||
<OptimizationLevel>2</OptimizationLevel>
|
||||
<VBEResolution>800x600x32</VBEResolution>
|
||||
<RunPostBuildEvent>Always</RunPostBuildEvent>
|
||||
<Timeout>1</Timeout>
|
||||
<UseUEFI>False</UseUEFI>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<WarningLevel>8</WarningLevel>
|
||||
<NoWarn>1603,1701;1702,8632</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<WarningLevel>8</WarningLevel>
|
||||
<NoWarn>1603,1701;1702,8632</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<WarningLevel>8</WarningLevel>
|
||||
<NoWarn>1603,1701;1702,8632</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<WarningLevel>8</WarningLevel>
|
||||
<NoWarn>1603,1701;1702,8632</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Fixed_Release|AnyCPU'">
|
||||
<WarningLevel>8</WarningLevel>
|
||||
<NoWarn>1603,1701;1702,8632</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Fixed_Release|x64'">
|
||||
<WarningLevel>8</WarningLevel>
|
||||
<NoWarn>1603,1701;1702,8632</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="font.psf" />
|
||||
<None Remove="Solarize.12x29.psf" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="font.psf" />
|
||||
<EmbeddedResource Include="Wallpapers\wallpaper.bmp" />
|
||||
<EmbeddedResource Include="GitCommit.txt" />
|
||||
<EmbeddedResource Include="BuildTime.txt" />
|
||||
<EmbeddedResource Include="LuaApps\*.lua" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -49,7 +91,12 @@
|
||||
<PackageReference Include="Cosmos.System2_Plugs" Version="0.1.0-localbuild20260201071815" />
|
||||
<PackageReference Include="CosmosFtpServer" Version="1.0.9" />
|
||||
<PackageReference Include="CosmosHttp" Version="1.0.4" />
|
||||
<PackageReference Include="IL2CPU.API" Version="0.1.0-localbuild20260203125852" />
|
||||
<PackageReference Include="IL2CPU.API" Version="0.1.0-localbuild20260225062300" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
<Exec Command="powershell -ExecutionPolicy Bypass -File GenerateGitCommit.ps1" WorkingDirectory="$(MSBuildProjectDirectory)" />
|
||||
<Exec Command="powershell -ExecutionPolicy Bypass -File BuildTime.ps1" WorkingDirectory="$(MSBuildProjectDirectory)" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
||||
25
GenerateGitCommit.ps1
Normal file
25
GenerateGitCommit.ps1
Normal file
@@ -0,0 +1,25 @@
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$gitPath = "git"
|
||||
$commitFile = "GitCommit.txt"
|
||||
|
||||
try {
|
||||
$commitHash = git rev-parse HEAD 2>&1
|
||||
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
$shortHash = $commitHash.Substring(0, 7).Trim()
|
||||
$trimmedHash = $commitHash.Trim()
|
||||
[System.IO.File]::WriteAllText($commitFile, $shortHash, [System.Text.Encoding]::ASCII)
|
||||
Write-Host "Git Commit Hash: $shortHash" -ForegroundColor Green
|
||||
Write-Host "Full Hash: $trimmedHash" -ForegroundColor Cyan
|
||||
}
|
||||
else {
|
||||
Write-Host "Warning: Not a git repository or git not found" -ForegroundColor Yellow
|
||||
Write-Host "Using default commit hash: unknown" -ForegroundColor Yellow
|
||||
"unknown" | Out-File -FilePath $commitFile -Encoding UTF8
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Host "Error: $_" -ForegroundColor Red
|
||||
"unknown" | Out-File -FilePath $commitFile -Encoding UTF8
|
||||
}
|
||||
1
GitCommit.txt
Normal file
1
GitCommit.txt
Normal file
@@ -0,0 +1 @@
|
||||
c1e0651
|
||||
284
Kernel.cs
284
Kernel.cs
@@ -1,19 +1,24 @@
|
||||
using CMLeonOS.Logger;
|
||||
using CMLeonOS.Settings;
|
||||
using Cosmos.HAL;
|
||||
using Cosmos.HAL.BlockDevice;
|
||||
using Cosmos.HAL.Drivers.Video;
|
||||
using Cosmos.System.FileSystem;
|
||||
using Cosmos.System.FileSystem.FAT;
|
||||
using Cosmos.System.FileSystem.VFS;
|
||||
using Cosmos.System.Graphics;
|
||||
using Cosmos.System.Graphics.Fonts;
|
||||
using Cosmos.System.Network.Config;
|
||||
using Cosmos.System.Network.IPv4.UDP.DHCP;
|
||||
using Cosmos.HAL.BlockDevice;
|
||||
using Cosmos.System.Network.IPv4;
|
||||
using Cosmos.System.Network.IPv4.UDP.DHCP;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection.Metadata.Ecma335;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using Sys = Cosmos.System;
|
||||
using CMLeonOS.Logger;
|
||||
using CMLeonOS.Settings;
|
||||
|
||||
namespace CMLeonOS
|
||||
{
|
||||
@@ -31,11 +36,43 @@ namespace CMLeonOS
|
||||
|
||||
public static Cosmos.HAL.NetworkDevice NetworkDevice = null;
|
||||
public static string IPAddress = "Unknown";
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.font.psf")]
|
||||
public static readonly byte[] file;
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.GitCommit.txt")]
|
||||
public static readonly byte[] gitCommitFile;
|
||||
|
||||
[IL2CPU.API.Attribs.ManifestResourceStream(ResourceName = "CMLeonOS.BuildTime.txt")]
|
||||
public static readonly byte[] buildTimeFile;
|
||||
|
||||
public static void ShowError(string message)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.WriteLine($"{message}");
|
||||
Console.ResetColor();
|
||||
}
|
||||
|
||||
protected override void BeforeRun()
|
||||
{
|
||||
Console.WriteLine("Kernel load done!");
|
||||
Console.WriteLine(@"-------------------------------------------------");
|
||||
BootMenuAction bootAction = BootMenu.Show();
|
||||
|
||||
switch (bootAction)
|
||||
{
|
||||
case BootMenuAction.Reboot:
|
||||
Sys.Power.Reboot();
|
||||
break;
|
||||
case BootMenuAction.Shutdown:
|
||||
Sys.Power.Shutdown();
|
||||
break;
|
||||
case BootMenuAction.NormalBoot:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Console.Clear();
|
||||
// Console.WriteLine("Kernel load done!");
|
||||
// Console.WriteLine(@"----------------------------------------------------------");
|
||||
Console.WriteLine(@" ____ __ __ _ ___ ____ ");
|
||||
Console.WriteLine(@" / ___| \/ | | ___ ___ _ __ / _ \/ ___| ");
|
||||
Console.WriteLine(@" | | | |\/| | | / _ \/ _ \| '_ \| | | \___ \ ");
|
||||
@@ -43,8 +80,8 @@ namespace CMLeonOS
|
||||
Console.WriteLine(@" \____|_| |_|_____\___|\___/|_| |_|____/|____/ ");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("The CMLeonOS Project");
|
||||
Console.WriteLine("By LeonOS 2 Developement Team");
|
||||
Console.WriteLine(@"-------------------------------------------------");
|
||||
Console.WriteLine("(C) LeonOS 2 Developer Team 2025-2026. All rights reserved.");
|
||||
Console.WriteLine(@"----------------------------------------------------------");
|
||||
|
||||
// 注册VFS
|
||||
_logger.Info("Kernel", "Starting VFS initialization");
|
||||
@@ -73,11 +110,57 @@ namespace CMLeonOS
|
||||
_logger.Info("Kernel", "Created system folder at 0:\\system");
|
||||
}
|
||||
|
||||
// 检查并创建apps文件夹
|
||||
string appsFolderPath = @"0:\apps";
|
||||
if (!System.IO.Directory.Exists(appsFolderPath))
|
||||
{
|
||||
System.IO.Directory.CreateDirectory(appsFolderPath);
|
||||
_logger.Info("Kernel", "Created apps folder at 0:\\apps");
|
||||
}
|
||||
|
||||
// 初始化用户系统
|
||||
_logger.Info("Kernel", "Initializing user system");
|
||||
userSystem = new UserSystem();
|
||||
_logger.Success("Kernel", "User system initialized");
|
||||
|
||||
// 读取 Git Commit hash
|
||||
if (gitCommitFile != null && gitCommitFile.Length > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
Version.GitCommit = System.Text.Encoding.UTF8.GetString(gitCommitFile);
|
||||
_logger.Info("Kernel", $"Git Commit: {Version.GitCommit}");
|
||||
}
|
||||
catch
|
||||
{
|
||||
Version.GitCommit = "unknown";
|
||||
_logger.Warning("Kernel", "Failed to read Git Commit, using 'unknown'");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Version.GitCommit = "unknown";
|
||||
_logger.Warning("Kernel", "Git Commit file not found, using 'unknown'");
|
||||
}
|
||||
|
||||
// 读取 Build Time
|
||||
if (buildTimeFile != null && buildTimeFile.Length > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
string buildTime = System.Text.Encoding.UTF8.GetString(buildTimeFile);
|
||||
_logger.Info("Kernel", $"Build Time: {buildTime}");
|
||||
}
|
||||
catch
|
||||
{
|
||||
_logger.Warning("Kernel", "Failed to read Build Time");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Warning("Kernel", "Build Time file not found");
|
||||
}
|
||||
|
||||
// 检查env.dat文件是否存在,如果不存在则创建并设置Test环境变量
|
||||
string envFilePath = @"0:\system\env.dat";
|
||||
if (!System.IO.File.Exists(envFilePath))
|
||||
@@ -171,6 +254,8 @@ namespace CMLeonOS
|
||||
// 检查并执行启动脚本
|
||||
ExecuteStartupScript();
|
||||
|
||||
ExecuteStartupTest();
|
||||
|
||||
if (System.IO.File.Exists("0:\\system\\zen"))
|
||||
{
|
||||
Console.WriteLine("=====================================");
|
||||
@@ -208,20 +293,131 @@ namespace CMLeonOS
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.Clear();
|
||||
Console.BackgroundColor = ConsoleColor.Red;
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Console.Clear();
|
||||
Console.WriteLine(":(");
|
||||
Console.WriteLine("A problem has been detected and CMLeonOS has been shutdown to prevent damage to your computer.");
|
||||
Console.WriteLine($"Error information: {ex.Message}");
|
||||
Console.WriteLine("If this is the first time you've seen this stop error screen, restart your computer and email to leonmmcoset@outlook.com WITH THE ERROR INFORMATION for technical support.");
|
||||
Console.WriteLine("Press any keys to restart.");
|
||||
Console.ReadKey();
|
||||
Sys.Power.Reboot();
|
||||
if (ex.Message.Contains("Read only"))
|
||||
{
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.Clear();
|
||||
|
||||
var formatWindow = new CMLeonOS.UI.Window(
|
||||
new CMLeonOS.UI.Rect(10, 5, 60, 12),
|
||||
"Format Disk",
|
||||
() => { },
|
||||
true
|
||||
);
|
||||
formatWindow.Render();
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(12, 8);
|
||||
global::System.Console.Write("Disk not formatted");
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Yellow, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(12, 9);
|
||||
global::System.Console.Write("Warning: This will erase all data!");
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(12, 11);
|
||||
global::System.Console.Write("Press any key to format...");
|
||||
|
||||
global::System.Console.ReadKey();
|
||||
|
||||
try {
|
||||
Disk targetDisk = fs.Disks[0];
|
||||
CreateMBRandPartitionTable(targetDisk);
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Green, global::System.ConsoleColor.Black);
|
||||
global::System.Console.Clear();
|
||||
formatWindow.Render();
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(12, 8);
|
||||
global::System.Console.Write("Disk formatted successfully!");
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(12, 9);
|
||||
global::System.Console.Write("Restarting in 3 seconds...");
|
||||
|
||||
System.Threading.Thread.Sleep(3000);
|
||||
Sys.Power.Reboot();
|
||||
}
|
||||
catch (Exception exe)
|
||||
{
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
|
||||
global::System.Console.Clear();
|
||||
formatWindow.Render();
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(12, 8);
|
||||
global::System.Console.Write("Format failed!");
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(12, 9);
|
||||
global::System.Console.Write($"Error: {exe.Message}");
|
||||
|
||||
global::System.Console.ReadKey();
|
||||
}
|
||||
}
|
||||
else{
|
||||
Console.Clear();
|
||||
Console.BackgroundColor = ConsoleColor.Red;
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Console.Clear();
|
||||
Console.Beep();
|
||||
Console.WriteLine(":(");
|
||||
Console.WriteLine("A problem has been detected and CMLeonOS has been shut down to prevent damage to your computer.");
|
||||
|
||||
string gitCommit = "unknown";
|
||||
if (gitCommitFile != null && gitCommitFile.Length > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
gitCommit = System.Text.Encoding.UTF8.GetString(gitCommitFile);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine($"Error information: {ex.Message}");
|
||||
Console.WriteLine($"Build version: {gitCommit}");
|
||||
Console.WriteLine("The operating system cannot recover from this exception and has halted immediately.");
|
||||
Console.WriteLine("If this is the first time you've seen this stop error screen, restart your computer.");
|
||||
Console.WriteLine("If this screen appears again, follow these steps:");
|
||||
Console.WriteLine("1. Check the system logs to ensure all kernel modules are loaded correctly.");
|
||||
Console.WriteLine("2. Record the system version and steps to reproduce the error.");
|
||||
Console.WriteLine("3. Send an post to the CMLeonOS official forum.");
|
||||
Console.WriteLine("Contact us via https://lbbs.ecuil.com/#/thread/category/10, including the error information for support.");
|
||||
Console.WriteLine("Please include the error information, system build version, runtime environment, and operation steps before the crash.");
|
||||
Console.WriteLine("Warning: Unsaved data in memory will be lost due to the emergency system shutdown.");
|
||||
Console.WriteLine("Press any key to restart.");
|
||||
Console.ReadKey();
|
||||
Sys.Power.Reboot();
|
||||
}
|
||||
// try {
|
||||
// Disk targetDisk = fs.Disks[0];
|
||||
// CreateMBRandPartitionTable(targetDisk);
|
||||
// }
|
||||
// catch (Exception exe)
|
||||
// {
|
||||
// Console.WriteLine($"Error creating MBR and partition table: {exe.Message}");
|
||||
// }
|
||||
// Console.WriteLine("Done.");
|
||||
}
|
||||
}
|
||||
|
||||
// 我他妈居然成功了,我在没有任何文档的情况下研究出来了
|
||||
private void CreateMBRandPartitionTable(Disk disk)
|
||||
{
|
||||
disk.Clear();
|
||||
ulong diskSize = (ulong)(disk.Size / 1024 / 1024);
|
||||
uint partSize = (uint)(diskSize - 2);
|
||||
|
||||
disk.CreatePartition((int)partSize);
|
||||
|
||||
var part = disk.Partitions[disk.Partitions.Count - 1];
|
||||
disk.FormatPartition(0, "FAT32", true);
|
||||
// Console.WriteLine($"Partition type: {part.GetType()}");
|
||||
}
|
||||
|
||||
private void ExecuteStartupScript()
|
||||
{
|
||||
string startupFilePath = @"0:\system\startup.cm";
|
||||
@@ -244,7 +440,7 @@ namespace CMLeonOS
|
||||
}
|
||||
|
||||
Console.WriteLine("Executing startup script...");
|
||||
Console.WriteLine("--------------------------------");
|
||||
// Console.WriteLine("--------------------------------");
|
||||
|
||||
// 逐行执行命令
|
||||
foreach (string line in lines)
|
||||
@@ -260,7 +456,7 @@ namespace CMLeonOS
|
||||
shell.ExecuteCommand(line);
|
||||
}
|
||||
|
||||
Console.WriteLine("--------------------------------");
|
||||
// Console.WriteLine("--------------------------------");
|
||||
_logger.Success("Kernel", "Startup script execution completed");
|
||||
}
|
||||
else
|
||||
@@ -277,6 +473,52 @@ namespace CMLeonOS
|
||||
}
|
||||
}
|
||||
|
||||
private void ExecuteStartupTest()
|
||||
{
|
||||
Console.WriteLine("------------------------------------------------------");
|
||||
Console.WriteLine($"Welcome to {Version.DisplayVersion}");
|
||||
Console.WriteLine("* Documentation: https://cmleonos.jjmm.ink/");
|
||||
Console.WriteLine("* Forum: https://lbbs.ecuil.com/#/category/10");
|
||||
// Console.WriteLine("");
|
||||
|
||||
// 感觉排版有点割裂,先注释掉
|
||||
// Console.BackgroundColor = ConsoleColor.Red;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.Yellow;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.Green;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.Cyan;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.Blue;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.Magenta;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.White;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.DarkBlue;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.DarkCyan;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.DarkGreen;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.DarkYellow;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.DarkRed;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.Gray;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.DarkGray;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.DarkMagenta;
|
||||
// Console.Write(" ");
|
||||
// Console.BackgroundColor = ConsoleColor.Black;
|
||||
// Console.Write(" ");
|
||||
// Console.WriteLine("");
|
||||
// Console.ResetColor();
|
||||
Console.WriteLine("------------------------------------------------------");
|
||||
}
|
||||
|
||||
private string FormatBytes(long bytes)
|
||||
{
|
||||
string[] units = { "B", "KB", "MB", "GB", "TB" };
|
||||
|
||||
27
LISENCE-Cosmos.txt
Normal file
27
LISENCE-Cosmos.txt
Normal file
@@ -0,0 +1,27 @@
|
||||
Copyright (c) 2007-2026, CosmosOS, COSMOS Project
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
16
LuaApps.cs
Normal file
16
LuaApps.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using IL2CPU.API.Attribs;
|
||||
|
||||
namespace CMLeonOS
|
||||
{
|
||||
public static class LuaApps
|
||||
{
|
||||
[ManifestResourceStream(ResourceName = "CMLeonOS.LuaApps.helloworld.lua")]
|
||||
public static readonly byte[] helloworld;
|
||||
|
||||
[ManifestResourceStream(ResourceName = "CMLeonOS.LuaApps.testspeed.lua")]
|
||||
public static readonly byte[] testspeed;
|
||||
|
||||
[ManifestResourceStream(ResourceName = "CMLeonOS.LuaApps.calculator.lua")]
|
||||
public static readonly byte[] calculator;
|
||||
}
|
||||
}
|
||||
98
LuaApps/calculator.lua
Normal file
98
LuaApps/calculator.lua
Normal file
@@ -0,0 +1,98 @@
|
||||
print("====================================")
|
||||
print(" Lua Calculator")
|
||||
print("====================================")
|
||||
print("Type 'exit' or 'quit' to exit")
|
||||
print("Type 'clear' to clear the result")
|
||||
print()
|
||||
|
||||
local result = nil
|
||||
local operator = nil
|
||||
local lastResult = nil
|
||||
|
||||
while true do
|
||||
io.write("calc> ")
|
||||
local input = io.read()
|
||||
|
||||
if input == nil or input == "" then
|
||||
goto continue
|
||||
end
|
||||
|
||||
input = input:lower()
|
||||
|
||||
if input == "exit" or input == "quit" then
|
||||
print("Exiting calculator...")
|
||||
break
|
||||
elseif input == "clear" then
|
||||
result = nil
|
||||
operator = nil
|
||||
lastResult = nil
|
||||
print("Calculator cleared.")
|
||||
goto continue
|
||||
elseif input == "help" then
|
||||
print("Available commands:")
|
||||
print(" + : Addition")
|
||||
print(" - : Subtraction")
|
||||
print(" * : Multiplication")
|
||||
print(" / : Division")
|
||||
print(" ^ : Power")
|
||||
print(" % : Modulo")
|
||||
print(" clear : Clear calculator")
|
||||
print(" exit : Exit calculator")
|
||||
goto continue
|
||||
end
|
||||
|
||||
local num = tonumber(input)
|
||||
|
||||
if num ~= nil then
|
||||
if operator == nil then
|
||||
result = num
|
||||
lastResult = num
|
||||
print("Result: " .. result)
|
||||
else
|
||||
local calcResult = nil
|
||||
if operator == "+" then
|
||||
calcResult = result + num
|
||||
elseif operator == "-" then
|
||||
calcResult = result - num
|
||||
elseif operator == "*" then
|
||||
calcResult = result * num
|
||||
elseif operator == "/" then
|
||||
if num == 0 then
|
||||
print("Error: Division by zero!")
|
||||
else
|
||||
calcResult = result / num
|
||||
end
|
||||
elseif operator == "^" then
|
||||
calcResult = result ^ num
|
||||
elseif operator == "%" then
|
||||
if num == 0 then
|
||||
print("Error: Modulo by zero!")
|
||||
else
|
||||
calcResult = result % num
|
||||
end
|
||||
end
|
||||
|
||||
if calcResult ~= nil then
|
||||
result = calcResult
|
||||
lastResult = calcResult
|
||||
print("Result: " .. result)
|
||||
end
|
||||
|
||||
operator = nil
|
||||
end
|
||||
else
|
||||
if input == "+" or input == "-" or input == "*" or input == "/" or input == "^" or input == "%" then
|
||||
operator = input
|
||||
print("Operator: " .. operator)
|
||||
else
|
||||
print("Invalid input: " .. input)
|
||||
print("Type 'help' for available commands")
|
||||
end
|
||||
end
|
||||
|
||||
::continue::
|
||||
end
|
||||
|
||||
print()
|
||||
print("Final result: " .. (lastResult or "No calculation"))
|
||||
print("Goodbye!")
|
||||
3
LuaApps/helloworld.lua
Normal file
3
LuaApps/helloworld.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
print("Hello, World!")
|
||||
print("Welcome to CMLeonOS!")
|
||||
print("This is a simple Lua application.")
|
||||
7
LuaApps/testspeed.lua
Normal file
7
LuaApps/testspeed.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
local loop = 100000000
|
||||
os.timerstart()
|
||||
for i = 1, loop do
|
||||
-- Nothing
|
||||
end
|
||||
cost = os.timerstop()
|
||||
print("Loop " .. loop .. ", cost " .. cost .. "s.")
|
||||
@@ -1,2 +1,2 @@
|
||||
# CMLeanOS 源代码仓库
|
||||
# CMLeonOS 源代码仓库
|
||||
需要 .NET 6.0 或更高版本,Cosmos版本为最新的修改版DevKit。
|
||||
@@ -14,6 +14,19 @@ namespace CMLeonOS
|
||||
currentDirectory = @"0:\";
|
||||
}
|
||||
|
||||
private static bool ContainsInvalidChars(string input)
|
||||
{
|
||||
char[] invalidChars = { '<', '>', '"', '|', '?', '*' };
|
||||
foreach (char c in invalidChars)
|
||||
{
|
||||
if (input.Contains(c.ToString()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public FileSystem(string initialPath)
|
||||
{
|
||||
if (string.IsNullOrEmpty(initialPath))
|
||||
@@ -28,7 +41,14 @@ namespace CMLeonOS
|
||||
|
||||
public string CurrentDirectory
|
||||
{
|
||||
get { return currentDirectory; }
|
||||
get
|
||||
{
|
||||
// if (currentDirectory == @"0:\apps")
|
||||
// {
|
||||
// return ":";
|
||||
// }
|
||||
return currentDirectory;
|
||||
}
|
||||
}
|
||||
|
||||
public void ChangeDirectory(string path)
|
||||
@@ -39,6 +59,18 @@ namespace CMLeonOS
|
||||
return;
|
||||
}
|
||||
|
||||
if (path == @"0:\")
|
||||
{
|
||||
currentDirectory = @"0:\";
|
||||
return;
|
||||
}
|
||||
|
||||
if (path == @"1:\")
|
||||
{
|
||||
currentDirectory = @"1:\";
|
||||
return;
|
||||
}
|
||||
|
||||
string fullPath = GetFullPath(path);
|
||||
|
||||
try
|
||||
@@ -60,6 +92,12 @@ namespace CMLeonOS
|
||||
|
||||
public void MakeDirectory(string path)
|
||||
{
|
||||
if (ContainsInvalidChars(path))
|
||||
{
|
||||
Console.WriteLine("Error: Directory name contains invalid characters: < > : \" | ?");
|
||||
return;
|
||||
}
|
||||
|
||||
string fullPath = GetFullPath(path);
|
||||
|
||||
try
|
||||
@@ -88,49 +126,51 @@ namespace CMLeonOS
|
||||
{
|
||||
if (Directory.Exists(fullPath))
|
||||
{
|
||||
// 列出当前目录下的文件和子目录
|
||||
Console.WriteLine($"Contents of {path}:");
|
||||
string displayPath = path == "." ? CurrentDirectory : path;
|
||||
Console.WriteLine($"Contents of {displayPath}:");
|
||||
|
||||
// 列出子目录
|
||||
try
|
||||
{
|
||||
var dirs = Directory.GetDirectories(fullPath);
|
||||
foreach (var dir in dirs)
|
||||
{
|
||||
// 使用Path.GetFileName获取目录名,避免Substring可能导致的问题
|
||||
string dirName = Path.GetFileName(dir);
|
||||
Console.ForegroundColor = ConsoleColor.Yellow;
|
||||
Console.WriteLine($"[DIR] {dirName}");
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 可能没有权限或其他错误
|
||||
}
|
||||
|
||||
// 列出文件
|
||||
try
|
||||
{
|
||||
var files = Directory.GetFiles(fullPath);
|
||||
foreach (var file in files)
|
||||
{
|
||||
// 使用Path.GetFileName获取文件名,避免Substring可能导致的问题
|
||||
string fileName = Path.GetFileName(file);
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Console.WriteLine($"[FILE] {fileName}");
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 可能没有权限或其他错误
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.WriteLine($"Directory not found: {path}");
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.WriteLine($"Error listing files: {ex.Message}");
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,7 +320,11 @@ namespace CMLeonOS
|
||||
{
|
||||
if (File.Exists(fullPath))
|
||||
{
|
||||
return File.ReadAllText(fullPath);
|
||||
using (FileStream fs = new FileStream(fullPath, FileMode.Open, FileAccess.Read))
|
||||
using (StreamReader sr = new StreamReader(fs))
|
||||
{
|
||||
return sr.ReadToEnd();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -350,26 +394,60 @@ namespace CMLeonOS
|
||||
|
||||
public string GetFullPath(string path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
return currentDirectory;
|
||||
}
|
||||
|
||||
if (path.Length > 255)
|
||||
{
|
||||
Console.WriteLine("Error: Path too long (maximum 255 characters)");
|
||||
return currentDirectory;
|
||||
}
|
||||
|
||||
//char[] invalidChars = { '<', '>', ':', '"', '|', '?', '*' };
|
||||
//foreach (char c in invalidChars)
|
||||
//{
|
||||
// if (path.Contains(c.ToString()))
|
||||
// {
|
||||
// Console.WriteLine($"Error: Invalid character in path: '{c}'");
|
||||
// return currentDirectory;
|
||||
// }
|
||||
//}
|
||||
|
||||
if (path.Contains("//") || path.Contains("\\\\"))
|
||||
{
|
||||
Console.WriteLine("Error: Path contains consecutive slashes");
|
||||
return currentDirectory;
|
||||
}
|
||||
|
||||
if (path.StartsWith(@"0:\"))
|
||||
{
|
||||
return path;
|
||||
}
|
||||
else if (path == ".")
|
||||
|
||||
if (path.StartsWith(@"1:\"))
|
||||
{
|
||||
return path;
|
||||
}
|
||||
|
||||
if (path == ".")
|
||||
{
|
||||
return currentDirectory;
|
||||
}
|
||||
else if (path == "..")
|
||||
|
||||
if (path == "..")
|
||||
{
|
||||
if (currentDirectory == @"0:\")
|
||||
if (currentDirectory == @"0:\" || currentDirectory == @"1:\")
|
||||
{
|
||||
return @"0:\";
|
||||
return currentDirectory;
|
||||
}
|
||||
else
|
||||
{
|
||||
int lastSlash = currentDirectory.LastIndexOf('\\');
|
||||
if (lastSlash == 2) // 0:\
|
||||
if (lastSlash == 2) // 0:\ or 1:\
|
||||
{
|
||||
return @"0:\";
|
||||
return currentDirectory.Substring(0, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -377,9 +455,15 @@ namespace CMLeonOS
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (path.StartsWith("../") || path.StartsWith("..\\"))
|
||||
|
||||
if (path.StartsWith("../") || path.StartsWith("..\\"))
|
||||
{
|
||||
// 支持多层..操作
|
||||
if (currentDirectory == @"0:\" || currentDirectory == @"1:\")
|
||||
{
|
||||
Console.WriteLine("Error: Cannot go above root directory");
|
||||
return currentDirectory;
|
||||
}
|
||||
|
||||
int level = 0;
|
||||
string tempPath = path;
|
||||
while (tempPath.StartsWith("../") || tempPath.StartsWith("..\\"))
|
||||
@@ -393,16 +477,21 @@ namespace CMLeonOS
|
||||
{
|
||||
tempPath = tempPath.Substring(3);
|
||||
}
|
||||
|
||||
if (level > 10)
|
||||
{
|
||||
Console.WriteLine("Error: Too many parent directory references");
|
||||
return currentDirectory;
|
||||
}
|
||||
}
|
||||
|
||||
// 向上移动level级
|
||||
string resultPath = currentDirectory;
|
||||
for (int i = 0; i < level; i++)
|
||||
{
|
||||
int lastSlash = resultPath.LastIndexOf('\\');
|
||||
if (lastSlash == 2) // 0:\
|
||||
if (lastSlash == 2) // 0:\ or 1:\
|
||||
{
|
||||
resultPath = @"0:\";
|
||||
resultPath = resultPath.Substring(0, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -411,12 +500,11 @@ namespace CMLeonOS
|
||||
}
|
||||
return resultPath;
|
||||
}
|
||||
else if (path.StartsWith("dir") || path.StartsWith("DIR"))
|
||||
|
||||
if (path.StartsWith("dir") || path.StartsWith("DIR"))
|
||||
{
|
||||
// 支持cd dir1/dir2/dir3等格式
|
||||
string dirName = path;
|
||||
|
||||
// 提取数字部分
|
||||
string numberPart = "";
|
||||
for (int i = 3; i < path.Length; i++)
|
||||
{
|
||||
@@ -430,7 +518,6 @@ namespace CMLeonOS
|
||||
}
|
||||
}
|
||||
|
||||
// 构建完整路径
|
||||
if (currentDirectory == @"0:\")
|
||||
{
|
||||
return $@"0:\{dirName}";
|
||||
@@ -440,16 +527,46 @@ namespace CMLeonOS
|
||||
return $@"{currentDirectory}\{dirName}";
|
||||
}
|
||||
}
|
||||
|
||||
string normalizedPath = path;
|
||||
|
||||
while (normalizedPath.Contains("//"))
|
||||
{
|
||||
normalizedPath = normalizedPath.Replace("//", "/");
|
||||
}
|
||||
|
||||
while (normalizedPath.Contains("\\\\"))
|
||||
{
|
||||
normalizedPath = normalizedPath.Replace("\\\\", "\\");
|
||||
}
|
||||
|
||||
if (normalizedPath.StartsWith("/"))
|
||||
{
|
||||
normalizedPath = normalizedPath.Substring(1);
|
||||
}
|
||||
|
||||
if (normalizedPath.StartsWith("\\"))
|
||||
{
|
||||
normalizedPath = normalizedPath.Substring(1);
|
||||
}
|
||||
|
||||
if (normalizedPath.EndsWith("/"))
|
||||
{
|
||||
normalizedPath = normalizedPath.Substring(0, normalizedPath.Length - 1);
|
||||
}
|
||||
|
||||
if (normalizedPath.EndsWith("\\"))
|
||||
{
|
||||
normalizedPath = normalizedPath.Substring(0, normalizedPath.Length - 1);
|
||||
}
|
||||
|
||||
if (currentDirectory == @"0:\")
|
||||
{
|
||||
return $@"0:\{normalizedPath}";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (currentDirectory == @"0:\")
|
||||
{
|
||||
return $@"0:\{path}";
|
||||
}
|
||||
else
|
||||
{
|
||||
return $@"{currentDirectory}\{path}";
|
||||
}
|
||||
return $@"{currentDirectory}\{normalizedPath}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using Sys = Cosmos.System;
|
||||
using CMLeonOS.Logger;
|
||||
|
||||
namespace CMLeonOS
|
||||
{
|
||||
@@ -23,6 +24,7 @@ namespace CMLeonOS
|
||||
private List<User> users;
|
||||
public bool fixmode = Kernel.FixMode;
|
||||
private User currentLoggedInUser;
|
||||
private static CMLeonOS.Logger.Logger _logger = CMLeonOS.Logger.Logger.Instance;
|
||||
|
||||
public User CurrentLoggedInUser
|
||||
{
|
||||
@@ -53,6 +55,19 @@ namespace CMLeonOS
|
||||
return Convert.ToBase64String(sha256.GetHash());
|
||||
}
|
||||
|
||||
private static bool ContainsInvalidChars(string input)
|
||||
{
|
||||
char[] invalidChars = { '<', '>', ':', '"', '|', '?', '*', '/', '\\', ' ' };
|
||||
foreach (char c in invalidChars)
|
||||
{
|
||||
if (input.Contains(c.ToString()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public UserSystem()
|
||||
{
|
||||
EnsureSysDirectoryExists();
|
||||
@@ -306,146 +321,207 @@ namespace CMLeonOS
|
||||
|
||||
public void FirstTimeSetup()
|
||||
{
|
||||
Console.WriteLine("====================================");
|
||||
Console.WriteLine(" First Time Setup");
|
||||
Console.WriteLine("====================================");
|
||||
Console.WriteLine();
|
||||
|
||||
Console.WriteLine("User Terms and Conditions:");
|
||||
Console.WriteLine("====================================");
|
||||
Console.WriteLine("1. This operating system is provided as-is without warranty");
|
||||
Console.WriteLine("2. You are responsible for your data and backups");
|
||||
Console.WriteLine("3. Unauthorized access attempts may be logged");
|
||||
Console.WriteLine("4. System administrators have full access to all data");
|
||||
Console.WriteLine("5. By using this system, you agree to these terms");
|
||||
Console.WriteLine("6. Data privacy: Your personal data is stored locally");
|
||||
Console.WriteLine("7. System updates may be installed automatically");
|
||||
Console.WriteLine("8. No liability for data loss or corruption");
|
||||
Console.WriteLine("9. Support available at: leonmmcoset@outlook.com");
|
||||
Console.WriteLine("10. This license is for personal use only");
|
||||
Console.WriteLine("====================================");
|
||||
Console.WriteLine();
|
||||
|
||||
bool termsAccepted = false;
|
||||
while (!termsAccepted)
|
||||
{
|
||||
Console.Write("Do you accept the User Terms? (yes/no): ");
|
||||
string response = Console.ReadLine()?.ToLower();
|
||||
|
||||
if (response == "yes" || response == "y")
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.Clear();
|
||||
|
||||
var termsBox = new CMLeonOS.UI.Window(new CMLeonOS.UI.Rect(5, 5, 70, 18), "User Terms and Conditions", () => { }, true);
|
||||
termsBox.Render();
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Gray, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(7, 7);
|
||||
global::System.Console.WriteLine("1. This operating system is provided as-is without warranty");
|
||||
global::System.Console.SetCursorPosition(7, 8);
|
||||
global::System.Console.WriteLine("2. You are responsible for your data and backups");
|
||||
global::System.Console.SetCursorPosition(7, 9);
|
||||
global::System.Console.WriteLine("3. Unauthorized access attempts may be logged");
|
||||
global::System.Console.SetCursorPosition(7, 10);
|
||||
global::System.Console.WriteLine("4. System administrators have full access to all data");
|
||||
global::System.Console.SetCursorPosition(7, 11);
|
||||
global::System.Console.WriteLine("5. By using this system, you agree to these terms");
|
||||
global::System.Console.SetCursorPosition(7, 12);
|
||||
global::System.Console.WriteLine("6. Data privacy: Your personal data is stored locally");
|
||||
global::System.Console.SetCursorPosition(7, 13);
|
||||
global::System.Console.WriteLine("7. System updates may be installed automatically");
|
||||
global::System.Console.SetCursorPosition(7, 14);
|
||||
global::System.Console.WriteLine("8. No liability for data loss or corruption");
|
||||
global::System.Console.SetCursorPosition(7, 15);
|
||||
global::System.Console.WriteLine("9. Support available at: https://lbbs.ecuil.com/#/thread/category/10");
|
||||
global::System.Console.SetCursorPosition(7, 16);
|
||||
global::System.Console.WriteLine("10. This license is for personal use only");
|
||||
global::System.Console.SetCursorPosition(7, 17);
|
||||
global::System.Console.WriteLine("11. Use of this OS requires recognition of the one-China principle");
|
||||
|
||||
bool termsAccepted = false;
|
||||
while (!termsAccepted)
|
||||
{
|
||||
termsAccepted = true;
|
||||
Console.WriteLine("Terms accepted.");
|
||||
Console.WriteLine();
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(5, 24);
|
||||
global::System.Console.Write("Do you accept the User Terms? (yes/no): ");
|
||||
string response = global::System.Console.ReadLine()?.ToLower();
|
||||
|
||||
if (response == "yes" || response == "y")
|
||||
{
|
||||
termsAccepted = true;
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Green, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(5, 24);
|
||||
global::System.Console.Write("Terms accepted. ");
|
||||
}
|
||||
else if (response == "no" || response == "n")
|
||||
{
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(5, 24);
|
||||
global::System.Console.Write("You must accept the User Terms to continue.");
|
||||
global::System.Threading.Thread.Sleep(2000);
|
||||
Sys.Power.Reboot();
|
||||
}
|
||||
else
|
||||
{
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(5, 24);
|
||||
global::System.Console.Write("Invalid response. Please enter 'yes' or 'no'.");
|
||||
}
|
||||
}
|
||||
else if (response == "no" || response == "n")
|
||||
{
|
||||
Console.WriteLine("You must accept the User Terms to continue.");
|
||||
Console.WriteLine("Please restart the setup process.");
|
||||
Thread.Sleep(2000);
|
||||
Sys.Power.Reboot();
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Invalid response. Please enter 'yes' or 'no'.");
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("Please set admin username and password:");
|
||||
|
||||
Console.Write("Username: ");
|
||||
string username = Console.ReadLine();
|
||||
|
||||
while (string.IsNullOrWhiteSpace(username))
|
||||
{
|
||||
ShowError("Username cannot be empty.");
|
||||
Console.Write("Username: ");
|
||||
username = Console.ReadLine();
|
||||
}
|
||||
|
||||
Console.WriteLine("Password: ");
|
||||
string password = ReadPassword();
|
||||
|
||||
Console.WriteLine("Please confirm your password:");
|
||||
string confirmPassword = ReadPassword();
|
||||
|
||||
while (password != confirmPassword)
|
||||
{
|
||||
ShowError("Passwords do not match. Please try again.");
|
||||
|
||||
Console.Write("Username: ");
|
||||
username = Console.ReadLine();
|
||||
|
||||
|
||||
global::System.Console.Clear();
|
||||
|
||||
var setupBox = new CMLeonOS.UI.Window(new CMLeonOS.UI.Rect(5, 5, 70, 12), "Admin Account Setup", () => { }, true);
|
||||
setupBox.Render();
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(7, 7);
|
||||
global::System.Console.Write("Username: ");
|
||||
string username = global::System.Console.ReadLine();
|
||||
|
||||
while (string.IsNullOrWhiteSpace(username))
|
||||
{
|
||||
ShowError("Username cannot be empty.");
|
||||
Console.Write("Username: ");
|
||||
username = Console.ReadLine();
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(7, 24);
|
||||
global::System.Console.Write("Username cannot be empty. ");
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(7, 7);
|
||||
global::System.Console.Write("Username: ");
|
||||
username = global::System.Console.ReadLine();
|
||||
}
|
||||
|
||||
Console.WriteLine("Password: ");
|
||||
password = ReadPassword();
|
||||
|
||||
Console.WriteLine("Please confirm your password:");
|
||||
confirmPassword = ReadPassword();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
User adminUser = new User
|
||||
|
||||
while (ContainsInvalidChars(username))
|
||||
{
|
||||
Username = username,
|
||||
Password = password,
|
||||
IsAdmin = true
|
||||
};
|
||||
users.Add(adminUser);
|
||||
SaveUsers();
|
||||
ShowSuccess("Admin user created successfully!");
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Please set system hostname:");
|
||||
Console.Write("Hostname: ");
|
||||
string hostname = Console.ReadLine();
|
||||
|
||||
while (string.IsNullOrWhiteSpace(hostname))
|
||||
{
|
||||
ShowError("Hostname cannot be empty.");
|
||||
Console.Write("Hostname: ");
|
||||
hostname = Console.ReadLine();
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(7, 24);
|
||||
global::System.Console.Write("Username contains invalid characters: < > : \" | ? * / \\ space");
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(7, 7);
|
||||
global::System.Console.Write("Username: ");
|
||||
username = global::System.Console.ReadLine();
|
||||
}
|
||||
|
||||
if (users.Count > 0)
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(7, 8);
|
||||
global::System.Console.Write("Password: ");
|
||||
string password = ReadPassword();
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(7, 9);
|
||||
global::System.Console.Write("Confirm Password: ");
|
||||
string confirmPassword = ReadPassword();
|
||||
|
||||
while (password != confirmPassword)
|
||||
{
|
||||
users[0].Hostname = hostname;
|
||||
SaveHostname();
|
||||
ShowSuccess($"Hostname set to: {hostname}");
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(7, 24);
|
||||
global::System.Console.Write("Passwords do not match. Please try again. ");
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(7, 7);
|
||||
global::System.Console.Write("Username: ");
|
||||
username = global::System.Console.ReadLine();
|
||||
|
||||
while (string.IsNullOrWhiteSpace(username))
|
||||
{
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(7, 24);
|
||||
global::System.Console.Write("Username cannot be empty. ");
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(7, 7);
|
||||
global::System.Console.Write("Username: ");
|
||||
username = global::System.Console.ReadLine();
|
||||
}
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(7, 8);
|
||||
global::System.Console.Write("Password: ");
|
||||
password = ReadPassword();
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(7, 9);
|
||||
global::System.Console.Write("Confirm Password: ");
|
||||
confirmPassword = ReadPassword();
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("System will restart in 3 seconds...");
|
||||
Console.WriteLine("Please wait...");
|
||||
Console.WriteLine();
|
||||
|
||||
for (int i = 3; i > 0; i--)
|
||||
|
||||
try
|
||||
{
|
||||
Console.Write($"\rRestarting in {i} seconds... ");
|
||||
Thread.Sleep(1000);
|
||||
User adminUser = new User
|
||||
{
|
||||
Username = username,
|
||||
Password = password,
|
||||
IsAdmin = true
|
||||
};
|
||||
users.Add(adminUser);
|
||||
SaveUsers();
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Green, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(7, 24);
|
||||
global::System.Console.Write("Admin user created successfully! ");
|
||||
global::System.Console.Clear();
|
||||
|
||||
var hostnameBox = new CMLeonOS.UI.Window(new CMLeonOS.UI.Rect(5, 5, 70, 8), "Hostname Setup", () => { }, true);
|
||||
hostnameBox.Render();
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(7, 7);
|
||||
global::System.Console.Write("Hostname: ");
|
||||
string hostname = global::System.Console.ReadLine();
|
||||
|
||||
while (string.IsNullOrWhiteSpace(hostname))
|
||||
{
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(7, 24);
|
||||
global::System.Console.Write("Hostname cannot be empty. ");
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(7, 7);
|
||||
global::System.Console.Write("Hostname: ");
|
||||
hostname = global::System.Console.ReadLine();
|
||||
}
|
||||
|
||||
if (users.Count > 0)
|
||||
{
|
||||
users[0].Hostname = hostname;
|
||||
SaveUsers();
|
||||
}
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Green, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(7, 24);
|
||||
global::System.Console.Write("Hostname set successfully! ");
|
||||
global::System.Threading.Thread.Sleep(2000);
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.Clear();
|
||||
global::System.Console.SetCursorPosition(30, 12);
|
||||
global::System.Console.Write("Setup completed!");
|
||||
global::System.Console.SetCursorPosition(20, 13);
|
||||
global::System.Console.Write("System will restart in 3 seconds...");
|
||||
global::System.Threading.Thread.Sleep(3000);
|
||||
|
||||
Sys.Power.Reboot();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ShowError($"Error creating admin user: {ex.Message}");
|
||||
}
|
||||
|
||||
Console.WriteLine("\rRestarting now!");
|
||||
Sys.Power.Reboot();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ShowError($"Error creating admin user: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateUserFolder(string username)
|
||||
{
|
||||
try
|
||||
{
|
||||
Console.WriteLine($"Creating user folder for {username}...");
|
||||
_logger.Info("UserSystem", $"Creating user folder for {username}...");
|
||||
|
||||
// 在user文件夹下创建用户文件夹
|
||||
string userFolderPath = Path.Combine(@"0:\user", username);
|
||||
@@ -454,144 +530,90 @@ namespace CMLeonOS
|
||||
if (!Directory.Exists(userFolderPath))
|
||||
{
|
||||
Directory.CreateDirectory(userFolderPath);
|
||||
Console.WriteLine($"Created user folder for {username}.");
|
||||
_logger.Info("UserSystem", $"Created user folder for {username}.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"User folder for {username} already exists.");
|
||||
_logger.Info("UserSystem", $"User folder for {username} already exists.");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ShowError($"Error creating user folder: {ex.Message}");
|
||||
_logger.Error("UserSystem", $"Error creating user folder for {username}: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
public bool Login()
|
||||
{
|
||||
Console.WriteLine("====================================");
|
||||
Console.WriteLine(" System Login");
|
||||
Console.WriteLine("====================================");
|
||||
// Console.ReadKey(true);
|
||||
|
||||
// 检测ALT+Space按键
|
||||
bool useFixMode = false;
|
||||
ConsoleKeyInfo keyInfo;
|
||||
try
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.Clear();
|
||||
|
||||
var loginBox = new CMLeonOS.UI.Window(new CMLeonOS.UI.Rect(15, 8, 50, 10), "Login", () => { }, true);
|
||||
loginBox.Render();
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(17, 10);
|
||||
global::System.Console.Write("Username: ");
|
||||
string username = global::System.Console.ReadLine();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(username))
|
||||
{
|
||||
if (fixmode == true) {
|
||||
keyInfo = Console.ReadKey(true);
|
||||
if (keyInfo.Key == ConsoleKey.Spacebar && (keyInfo.Modifiers & ConsoleModifiers.Alt) != 0)
|
||||
{
|
||||
// 检测到ALT+Space,进入修复模式
|
||||
useFixMode = true;
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Fix Mode Activated");
|
||||
Console.Write("Enter fix code: ");
|
||||
|
||||
string fixCode = "";
|
||||
while (true)
|
||||
{
|
||||
var codeKey = Console.ReadKey(true);
|
||||
if (codeKey.Key == ConsoleKey.Enter)
|
||||
{
|
||||
Console.WriteLine();
|
||||
break;
|
||||
}
|
||||
else if (codeKey.Key == ConsoleKey.Backspace)
|
||||
{
|
||||
if (fixCode.Length > 0)
|
||||
{
|
||||
fixCode = fixCode.Substring(0, fixCode.Length - 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fixCode += codeKey.KeyChar;
|
||||
Console.Write(codeKey.KeyChar);
|
||||
}
|
||||
}
|
||||
|
||||
if (fixCode == "FixMyComputer")
|
||||
{
|
||||
Console.WriteLine("Fix mode enabled!");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Invalid fix code. Exiting fix mode.");
|
||||
useFixMode = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 正常登录流程
|
||||
Console.Write("Username: ");
|
||||
string username = Console.ReadLine();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(username))
|
||||
{
|
||||
ShowError("Username cannot be empty.");
|
||||
return false;
|
||||
}
|
||||
|
||||
Console.Write("Password: ");
|
||||
string password = ReadPassword();
|
||||
|
||||
// 查找用户
|
||||
User foundUser = null;
|
||||
foreach (User user in users)
|
||||
{
|
||||
if (user.Username.ToLower() == username.ToLower())
|
||||
{
|
||||
foundUser = user;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundUser == null)
|
||||
{
|
||||
ShowError("User not found.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 使用SHA256加密输入的密码后比较
|
||||
string hashedInputPassword = HashPasswordSha256(password);
|
||||
// Console.WriteLine($"Hashed Input Password: {hashedInputPassword}");
|
||||
// Console.WriteLine($"Stored Password: {foundUser.Password}");
|
||||
|
||||
if (foundUser.Password != hashedInputPassword)
|
||||
{
|
||||
ShowError("Invalid password.");
|
||||
return false;
|
||||
}
|
||||
|
||||
ShowSuccess("Login successful!");
|
||||
Console.Beep();
|
||||
|
||||
// 设置当前登录用户
|
||||
currentLoggedInUser = foundUser;
|
||||
|
||||
// 创建用户文件夹
|
||||
CreateUserFolder(foundUser.Username);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 如果读取按键失败,使用普通登录
|
||||
ShowError("Error reading key input. Using normal login.");
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(17, 24);
|
||||
global::System.Console.Write("Username cannot be empty. ");
|
||||
global::System.Threading.Thread.Sleep(1000);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 如果使用了修复模式,返回true
|
||||
if (useFixMode)
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.White, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(17, 11);
|
||||
global::System.Console.Write("Password: ");
|
||||
string password = ReadPassword();
|
||||
|
||||
User foundUser = null;
|
||||
foreach (User user in users)
|
||||
{
|
||||
return true;
|
||||
if (user.Username.ToLower() == username.ToLower())
|
||||
{
|
||||
foundUser = user;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
if (foundUser == null)
|
||||
{
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(17, 24);
|
||||
global::System.Console.Write("User not found. ");
|
||||
global::System.Threading.Thread.Sleep(1000);
|
||||
return false;
|
||||
}
|
||||
|
||||
string hashedInputPassword = HashPasswordSha256(password);
|
||||
|
||||
if (foundUser.Password != hashedInputPassword)
|
||||
{
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Red, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(17, 24);
|
||||
global::System.Console.Write("Invalid password. ");
|
||||
global::System.Threading.Thread.Sleep(1000);
|
||||
return false;
|
||||
}
|
||||
|
||||
CMLeonOS.UI.TUIHelper.SetColors(global::System.ConsoleColor.Green, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(17, 24);
|
||||
global::System.Console.Write("Login successful! ");
|
||||
// global::System.Console.WriteLine("Please wait... ");
|
||||
global::System.Threading.Thread.Sleep(1500);
|
||||
global::System.Console.ResetColor();
|
||||
global::System.Console.Clear();
|
||||
|
||||
global::System.Console.Beep();
|
||||
|
||||
currentLoggedInUser = foundUser;
|
||||
CreateUserFolder(foundUser.Username);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool AddUser(string args, bool isAdmin)
|
||||
|
||||
1103
UI/Components.cs
Normal file
1103
UI/Components.cs
Normal file
File diff suppressed because it is too large
Load Diff
303
UI/TUI.cs
Normal file
303
UI/TUI.cs
Normal file
@@ -0,0 +1,303 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CMLeonOS.UI
|
||||
{
|
||||
public struct Point
|
||||
{
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
|
||||
public Point(int x, int y)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
}
|
||||
|
||||
public static Point operator +(Point a, Point b)
|
||||
{
|
||||
return new Point(a.X + b.X, a.Y + b.Y);
|
||||
}
|
||||
|
||||
public static Point operator -(Point a, Point b)
|
||||
{
|
||||
return new Point(a.X - b.X, a.Y - b.Y);
|
||||
}
|
||||
}
|
||||
|
||||
public struct Size
|
||||
{
|
||||
public int Width { get; set; }
|
||||
public int Height { get; set; }
|
||||
|
||||
public Size(int width, int height)
|
||||
{
|
||||
Width = width;
|
||||
Height = height;
|
||||
}
|
||||
}
|
||||
|
||||
public struct Rect
|
||||
{
|
||||
public Point Position { get; set; }
|
||||
public Size Size { get; set; }
|
||||
|
||||
public Rect(Point position, Size size)
|
||||
{
|
||||
Position = position;
|
||||
Size = size;
|
||||
}
|
||||
|
||||
public Rect(int x, int y, int width, int height)
|
||||
{
|
||||
Position = new Point(x, y);
|
||||
Size = new Size(width, height);
|
||||
}
|
||||
|
||||
public int Left => Position.X;
|
||||
public int Top => Position.Y;
|
||||
public int Right => Position.X + Size.Width;
|
||||
public int Bottom => Position.Y + Size.Height;
|
||||
public int Width => Size.Width;
|
||||
public int Height => Size.Height;
|
||||
|
||||
public bool Contains(Point point)
|
||||
{
|
||||
return point.X >= Left && point.X < Right && point.Y >= Top && point.Y < Bottom;
|
||||
}
|
||||
}
|
||||
|
||||
public enum ConsoleColorEx
|
||||
{
|
||||
Black = ConsoleColor.Black,
|
||||
DarkBlue = ConsoleColor.DarkBlue,
|
||||
DarkGreen = ConsoleColor.DarkGreen,
|
||||
DarkCyan = ConsoleColor.DarkCyan,
|
||||
DarkRed = ConsoleColor.DarkRed,
|
||||
DarkMagenta = ConsoleColor.DarkMagenta,
|
||||
DarkYellow = ConsoleColor.DarkYellow,
|
||||
Gray = ConsoleColor.Gray,
|
||||
DarkGray = ConsoleColor.DarkGray,
|
||||
Blue = ConsoleColor.Blue,
|
||||
Green = ConsoleColor.Green,
|
||||
Cyan = ConsoleColor.Cyan,
|
||||
Red = ConsoleColor.Red,
|
||||
Magenta = ConsoleColor.Magenta,
|
||||
Yellow = ConsoleColor.Yellow,
|
||||
White = ConsoleColor.White
|
||||
}
|
||||
|
||||
public static class TUIHelper
|
||||
{
|
||||
public static int ConsoleWidth => 80;
|
||||
public static int ConsoleHeight => 25;
|
||||
|
||||
public static void SetColors(ConsoleColor foreground, ConsoleColor background)
|
||||
{
|
||||
Console.ForegroundColor = foreground;
|
||||
Console.BackgroundColor = background;
|
||||
}
|
||||
|
||||
public static void ResetColors()
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Console.BackgroundColor = ConsoleColor.Black;
|
||||
}
|
||||
|
||||
public static void DrawBox(Rect rect, char horizontal = '-', char vertical = '|', char corner = '+', ConsoleColor? borderColor = null)
|
||||
{
|
||||
if (borderColor != null)
|
||||
{
|
||||
SetColors(borderColor.Value, ConsoleColor.Black);
|
||||
}
|
||||
|
||||
for (int y = rect.Top; y < rect.Bottom; y++)
|
||||
{
|
||||
Console.SetCursorPosition(rect.Left, y);
|
||||
|
||||
if (y == rect.Top || y == rect.Bottom - 1)
|
||||
{
|
||||
Console.Write(corner);
|
||||
for (int x = rect.Left + 1; x < rect.Right - 1; x++)
|
||||
{
|
||||
Console.Write(horizontal);
|
||||
}
|
||||
Console.Write(corner);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Write(vertical);
|
||||
for (int x = rect.Left + 1; x < rect.Right - 1; x++)
|
||||
{
|
||||
Console.Write(' ');
|
||||
}
|
||||
Console.Write(vertical);
|
||||
}
|
||||
}
|
||||
|
||||
ResetColors();
|
||||
}
|
||||
|
||||
public static void DrawBox(Rect rect, string title, ConsoleColor? borderColor = null)
|
||||
{
|
||||
if (borderColor != null)
|
||||
{
|
||||
SetColors(borderColor.Value, ConsoleColor.Black);
|
||||
}
|
||||
|
||||
char horizontal = '-';
|
||||
char vertical = '|';
|
||||
char corner = '+';
|
||||
|
||||
for (int y = rect.Top; y < rect.Bottom; y++)
|
||||
{
|
||||
Console.SetCursorPosition(rect.Left, y);
|
||||
|
||||
if (y == rect.Top)
|
||||
{
|
||||
Console.Write(corner);
|
||||
|
||||
// Calculate title position
|
||||
int titleX = rect.Left + (rect.Width - title.Length) / 2;
|
||||
int titleStart = titleX;
|
||||
int titleEnd = titleX + title.Length;
|
||||
|
||||
for (int x = rect.Left + 1; x < rect.Right - 1; x++)
|
||||
{
|
||||
// Skip drawing horizontal characters where title will be
|
||||
if (!string.IsNullOrEmpty(title) && x >= titleStart && x < titleEnd)
|
||||
{
|
||||
Console.Write(' ');
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Write(horizontal);
|
||||
}
|
||||
}
|
||||
Console.Write(corner);
|
||||
}
|
||||
else if (y == rect.Bottom - 1)
|
||||
{
|
||||
Console.Write(corner);
|
||||
for (int x = rect.Left + 1; x < rect.Right - 1; x++)
|
||||
{
|
||||
Console.Write(horizontal);
|
||||
}
|
||||
Console.Write(corner);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Write(vertical);
|
||||
for (int x = rect.Left + 1; x < rect.Right - 1; x++)
|
||||
{
|
||||
Console.Write(' ');
|
||||
}
|
||||
Console.Write(vertical);
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(title))
|
||||
{
|
||||
int titleX = rect.Left + (rect.Width - title.Length) / 2;
|
||||
Console.SetCursorPosition(titleX, rect.Top);
|
||||
Console.Write(title);
|
||||
}
|
||||
|
||||
ResetColors();
|
||||
}
|
||||
|
||||
public static void DrawText(Point position, string text, ConsoleColor? color = null)
|
||||
{
|
||||
if (color != null)
|
||||
{
|
||||
SetColors(color.Value, ConsoleColor.Black);
|
||||
}
|
||||
|
||||
Console.SetCursorPosition(position.X, position.Y);
|
||||
Console.Write(text);
|
||||
ResetColors();
|
||||
}
|
||||
|
||||
public static void DrawCenteredText(int y, string text, ConsoleColor? color = null)
|
||||
{
|
||||
if (color != null)
|
||||
{
|
||||
SetColors(color.Value, ConsoleColor.Black);
|
||||
}
|
||||
|
||||
int x = (ConsoleWidth - text.Length) / 2;
|
||||
Console.SetCursorPosition(x, y);
|
||||
Console.Write(text);
|
||||
ResetColors();
|
||||
}
|
||||
|
||||
public static void DrawHorizontalLine(int x, int y, int width, char c = '-', ConsoleColor? color = null)
|
||||
{
|
||||
if (color != null)
|
||||
{
|
||||
SetColors(color.Value, ConsoleColor.Black);
|
||||
}
|
||||
|
||||
Console.SetCursorPosition(x, y);
|
||||
Console.Write(new string(c, width));
|
||||
ResetColors();
|
||||
}
|
||||
|
||||
public static void DrawVerticalLine(int x, int y, int height, char c = '|', ConsoleColor? color = null)
|
||||
{
|
||||
if (color != null)
|
||||
{
|
||||
SetColors(color.Value, ConsoleColor.Black);
|
||||
}
|
||||
|
||||
for (int i = 0; i < height; i++)
|
||||
{
|
||||
Console.SetCursorPosition(x, y + i);
|
||||
Console.Write(c);
|
||||
}
|
||||
ResetColors();
|
||||
}
|
||||
|
||||
public static void ClearArea(Rect rect)
|
||||
{
|
||||
for (int y = rect.Top; y < rect.Bottom; y++)
|
||||
{
|
||||
Console.SetCursorPosition(rect.Left, y);
|
||||
Console.Write(new string(' ', rect.Width));
|
||||
}
|
||||
}
|
||||
|
||||
public static void SaveCursor()
|
||||
{
|
||||
Console.SetCursorPosition(Console.CursorLeft, Console.CursorTop);
|
||||
}
|
||||
|
||||
public static void HideCursor()
|
||||
{
|
||||
Console.CursorVisible = false;
|
||||
}
|
||||
|
||||
public static void ShowCursor()
|
||||
{
|
||||
Console.CursorVisible = true;
|
||||
}
|
||||
|
||||
public static string TruncateText(string text, int maxLength)
|
||||
{
|
||||
if (text.Length <= maxLength)
|
||||
{
|
||||
return text;
|
||||
}
|
||||
return text.Substring(0, maxLength - 3) + "...";
|
||||
}
|
||||
|
||||
public static string PadText(string text, int totalWidth, char padChar = ' ')
|
||||
{
|
||||
if (text.Length >= totalWidth)
|
||||
{
|
||||
return text;
|
||||
}
|
||||
return text + new string(padChar, totalWidth - text.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
332
UI/TUIDemo.cs
Normal file
332
UI/TUIDemo.cs
Normal file
@@ -0,0 +1,332 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using CMLeonOS.UI;
|
||||
|
||||
namespace CMLeonOS.UI.Examples
|
||||
{
|
||||
public static class TUIDemo
|
||||
{
|
||||
public static void Run()
|
||||
{
|
||||
Console.Clear();
|
||||
Console.Title = "CMLeonOS TUI Library Demo";
|
||||
|
||||
bool running = true;
|
||||
while (running)
|
||||
{
|
||||
ShowMainMenu();
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowMainMenu()
|
||||
{
|
||||
Console.Clear();
|
||||
|
||||
var menu = new Menu(new Rect(5, 5, 70, 15));
|
||||
menu.Items.Add(new MenuItem("Button Demo", () => ShowButtonDemo()));
|
||||
menu.Items.Add(new MenuItem("Input Box Demo", () => ShowInputBoxDemo()));
|
||||
menu.Items.Add(new MenuItem("Dialog Demo", () => ShowDialogDemo()));
|
||||
menu.Items.Add(new MenuItem("Progress Bar Demo", () => ShowProgressBarDemo()));
|
||||
menu.Items.Add(new MenuItem("Tab Control Demo", () => ShowTabControlDemo()));
|
||||
menu.Items.Add(new MenuItem("Exit", () => Environment.Exit(0)));
|
||||
|
||||
menu.Render();
|
||||
|
||||
bool menuRunning = true;
|
||||
while (menuRunning)
|
||||
{
|
||||
var key = Console.ReadKey(true);
|
||||
if (menu.HandleKey(key))
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
else if (key.Key == ConsoleKey.Escape)
|
||||
{
|
||||
menuRunning = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowButtonDemo()
|
||||
{
|
||||
Console.Clear();
|
||||
|
||||
var titleBar = new Window(new Rect(0, 0, 80, 3), "Button Demo", () =>
|
||||
{
|
||||
Console.Clear();
|
||||
ShowMainMenu();
|
||||
}, false);
|
||||
titleBar.Render();
|
||||
|
||||
var button1 = new Button(new Rect(10, 8, 20, 3), "Click Me!", ConsoleColor.Cyan, ConsoleColor.DarkBlue, ConsoleColor.White);
|
||||
var button2 = new Button(new Rect(35, 8, 20, 3), "Disabled", ConsoleColor.Gray, ConsoleColor.Black, ConsoleColor.DarkGray);
|
||||
button2.IsEnabled = false;
|
||||
var button3 = new Button(new Rect(60, 8, 20, 3), "Hover Me", ConsoleColor.Yellow, ConsoleColor.DarkRed, ConsoleColor.White);
|
||||
|
||||
button1.Render();
|
||||
button2.Render();
|
||||
button3.Render();
|
||||
|
||||
var label = new Label(new Point(10, 13), "Button Component Examples:");
|
||||
label.Render();
|
||||
|
||||
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
|
||||
statusBar.Items.Add(new StatusBarItem("Press ENTER to click, ESC to return"));
|
||||
statusBar.Render();
|
||||
|
||||
int focusedButton = 0;
|
||||
button1.IsFocused = true;
|
||||
|
||||
bool demoRunning = true;
|
||||
while (demoRunning)
|
||||
{
|
||||
var key = Console.ReadKey(true);
|
||||
|
||||
if (key.Key == ConsoleKey.Escape)
|
||||
{
|
||||
demoRunning = false;
|
||||
}
|
||||
else if (key.Key == ConsoleKey.Enter)
|
||||
{
|
||||
if (focusedButton == 0 && button1.IsEnabled)
|
||||
{
|
||||
Console.SetCursorPosition(10, 14);
|
||||
Console.Write("Clicked!");
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
}
|
||||
else if (key.Key == ConsoleKey.LeftArrow)
|
||||
{
|
||||
button1.IsFocused = false;
|
||||
button3.IsFocused = false;
|
||||
focusedButton = (focusedButton - 1 + 3) % 3;
|
||||
|
||||
if (focusedButton == 0 && button1.IsEnabled) button1.IsFocused = true;
|
||||
if (focusedButton == 2 && button2.IsEnabled) button2.IsFocused = true;
|
||||
if (focusedButton == 1 && button3.IsEnabled) button3.IsFocused = true;
|
||||
}
|
||||
else if (key.Key == ConsoleKey.RightArrow)
|
||||
{
|
||||
button1.IsFocused = false;
|
||||
button3.IsFocused = false;
|
||||
focusedButton = (focusedButton + 1) % 3;
|
||||
|
||||
if (focusedButton == 0 && button1.IsEnabled) button1.IsFocused = true;
|
||||
if (focusedButton == 2 && button2.IsEnabled) button2.IsFocused = true;
|
||||
if (focusedButton == 1 && button3.IsEnabled) button3.IsFocused = true;
|
||||
}
|
||||
|
||||
button1.Render();
|
||||
button2.Render();
|
||||
button3.Render();
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowInputBoxDemo()
|
||||
{
|
||||
Console.Clear();
|
||||
|
||||
var titleBar = new Window(new Rect(0, 0, 80, 3), "Input Box Demo", () =>
|
||||
{
|
||||
Console.Clear();
|
||||
ShowMainMenu();
|
||||
}, false);
|
||||
titleBar.Render();
|
||||
|
||||
var inputBox = new InputBox(new Rect(20, 8, 40, 3), "Enter your name:", "John Doe", 20, false, ConsoleColor.White, ConsoleColor.Black, ConsoleColor.White);
|
||||
inputBox.MaxLength = 20;
|
||||
|
||||
var button = new Button(new Rect(65, 8, 15, 3), "Submit");
|
||||
button.OnClick = () =>
|
||||
{
|
||||
Console.SetCursorPosition(20, 12);
|
||||
Console.Write($"Submitted: {inputBox.Value}");
|
||||
Thread.Sleep(2000);
|
||||
};
|
||||
|
||||
inputBox.Render();
|
||||
button.Render();
|
||||
|
||||
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
|
||||
statusBar.Items.Add(new StatusBarItem("Press ENTER to submit, ESC to return"));
|
||||
statusBar.Render();
|
||||
|
||||
bool demoRunning = true;
|
||||
while (demoRunning)
|
||||
{
|
||||
var key = Console.ReadKey(true);
|
||||
|
||||
if (key.Key == ConsoleKey.Escape)
|
||||
{
|
||||
demoRunning = false;
|
||||
}
|
||||
else if (inputBox.HandleKey(key))
|
||||
{
|
||||
inputBox.Render();
|
||||
}
|
||||
else if (button.HandleKey(key))
|
||||
{
|
||||
button.Render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowDialogDemo()
|
||||
{
|
||||
Console.Clear();
|
||||
|
||||
var titleBar = new Window(new Rect(0, 0, 80, 3), "Dialog Demo", () =>
|
||||
{
|
||||
Console.Clear();
|
||||
ShowMainMenu();
|
||||
}, false);
|
||||
titleBar.Render();
|
||||
|
||||
var dialog = new Dialog(new Rect(15, 5, 50, 7), "Confirm Action", "Are you sure you want to proceed?");
|
||||
|
||||
dialog.Buttons.Add(new Button(new Rect(17, 14, 12, 3), "Yes", ConsoleColor.White, ConsoleColor.DarkGreen, ConsoleColor.White));
|
||||
dialog.Buttons[0].OnClick = () =>
|
||||
{
|
||||
Console.SetCursorPosition(15, 13);
|
||||
Console.Write("Confirmed!");
|
||||
Thread.Sleep(1500);
|
||||
};
|
||||
|
||||
dialog.Buttons.Add(new Button(new Rect(31, 14, 12, 3), "No", ConsoleColor.White, ConsoleColor.DarkRed, ConsoleColor.White));
|
||||
dialog.Buttons[1].OnClick = () =>
|
||||
{
|
||||
Console.SetCursorPosition(31, 13);
|
||||
Console.Write("Cancelled!");
|
||||
Thread.Sleep(1500);
|
||||
};
|
||||
|
||||
dialog.Render();
|
||||
|
||||
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
|
||||
statusBar.Items.Add(new StatusBarItem("Use LEFT/RIGHT to select, ENTER to choose"));
|
||||
statusBar.Render();
|
||||
|
||||
bool demoRunning = true;
|
||||
while (demoRunning)
|
||||
{
|
||||
var key = Console.ReadKey(true);
|
||||
|
||||
if (key.Key == ConsoleKey.Escape)
|
||||
{
|
||||
demoRunning = false;
|
||||
}
|
||||
else if (dialog.HandleKey(key))
|
||||
{
|
||||
dialog.Render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowProgressBarDemo()
|
||||
{
|
||||
Console.Clear();
|
||||
|
||||
var titleBar = new Window(new Rect(0, 0, 80, 3), "Progress Bar Demo", () =>
|
||||
{
|
||||
Console.Clear();
|
||||
ShowMainMenu();
|
||||
}, false);
|
||||
titleBar.Render();
|
||||
|
||||
var progressBar = new ProgressBar(new Point(15, 10), 50, 100);
|
||||
progressBar.Value = 0;
|
||||
|
||||
var button = new Button(new Rect(35, 13, 15, 3), "Start");
|
||||
button.OnClick = () =>
|
||||
{
|
||||
for (int i = 0; i <= 100; i++)
|
||||
{
|
||||
progressBar.SetValue(i);
|
||||
progressBar.Render();
|
||||
Thread.Sleep(30);
|
||||
}
|
||||
};
|
||||
|
||||
progressBar.Render();
|
||||
button.Render();
|
||||
|
||||
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
|
||||
statusBar.Items.Add(new StatusBarItem("Press ENTER to start, ESC to return"));
|
||||
statusBar.Render();
|
||||
|
||||
bool demoRunning = true;
|
||||
while (demoRunning)
|
||||
{
|
||||
var key = Console.ReadKey(true);
|
||||
|
||||
if (key.Key == ConsoleKey.Escape)
|
||||
{
|
||||
demoRunning = false;
|
||||
}
|
||||
else if (button.HandleKey(key))
|
||||
{
|
||||
button.Render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowTabControlDemo()
|
||||
{
|
||||
Console.Clear();
|
||||
|
||||
var titleBar = new Window(new Rect(0, 0, 80, 3), "Tab Control Demo", () =>
|
||||
{
|
||||
Console.Clear();
|
||||
ShowMainMenu();
|
||||
}, false);
|
||||
titleBar.Render();
|
||||
|
||||
var tabControl = new TabControl(new Rect(5, 5, 70, 15));
|
||||
|
||||
tabControl.Pages.Add(new TabPage(new Rect(5, 8, 70, 11), "Tab 1", () =>
|
||||
{
|
||||
TUIHelper.SetColors(ConsoleColor.Cyan, ConsoleColor.Black);
|
||||
Console.SetCursorPosition(10, 10);
|
||||
Console.Write("Tab 1 Content");
|
||||
TUIHelper.ResetColors();
|
||||
}));
|
||||
|
||||
tabControl.Pages.Add(new TabPage(new Rect(5, 8, 70, 11), "Tab 2", () =>
|
||||
{
|
||||
TUIHelper.SetColors(ConsoleColor.Green, ConsoleColor.Black);
|
||||
Console.SetCursorPosition(10, 10);
|
||||
Console.Write("Tab 2 Content");
|
||||
TUIHelper.ResetColors();
|
||||
}));
|
||||
|
||||
tabControl.Pages.Add(new TabPage(new Rect(5, 8, 70, 11), "Tab 3", () =>
|
||||
{
|
||||
TUIHelper.SetColors(ConsoleColor.Magenta, ConsoleColor.Black);
|
||||
Console.SetCursorPosition(10, 10);
|
||||
Console.Write("Tab 3 Content");
|
||||
TUIHelper.ResetColors();
|
||||
}));
|
||||
|
||||
tabControl.Render();
|
||||
|
||||
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
|
||||
statusBar.Items.Add(new StatusBarItem("Use LEFT/RIGHT to switch tabs, ESC to return"));
|
||||
statusBar.Render();
|
||||
|
||||
bool demoRunning = true;
|
||||
while (demoRunning)
|
||||
{
|
||||
var key = Console.ReadKey(true);
|
||||
|
||||
if (key.Key == ConsoleKey.Escape)
|
||||
{
|
||||
demoRunning = false;
|
||||
}
|
||||
else if (tabControl.HandleKey(key))
|
||||
{
|
||||
tabControl.Render();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
8
docs/cmleonos/docs/.vuepress/dist/404.html
vendored
8
docs/cmleonos/docs/.vuepress/dist/404.html
vendored
@@ -33,11 +33,11 @@
|
||||
</script>
|
||||
<title>CMLeonOS官方文档站</title><meta name="description" content="CMLeonOS是一个基于微内核架构的操作系统,它的目标是提供一个简单、可靠、安全的操作系统环境。">
|
||||
<link rel="preload" href="/assets/style-BmL0kmLr.css" as="style"><link rel="stylesheet" href="/assets/style-BmL0kmLr.css">
|
||||
<link rel="modulepreload" href="/assets/app-BITa06va.js"><link rel="modulepreload" href="/assets/404.html-B-2P5V78.js">
|
||||
<link rel="prefetch" href="/assets/commands.html-CJdMGWM7.js" as="script"><link rel="prefetch" href="/assets/get-started.html-D_vM18Nz.js" as="script"><link rel="prefetch" href="/assets/lua.html-DxDsLuB0.js" as="script"><link rel="prefetch" href="/assets/index.html-DS7rXIvH.js" as="script">
|
||||
<link rel="modulepreload" href="/assets/app-C1vKFkGc.js"><link rel="modulepreload" href="/assets/404.html-ByTdGTSm.js">
|
||||
<link rel="prefetch" href="/assets/commands.html-DsR2axk8.js" as="script"><link rel="prefetch" href="/assets/get-started.html-CfHiKCXZ.js" as="script"><link rel="prefetch" href="/assets/lua.html-3_L4TJjQ.js" as="script"><link rel="prefetch" href="/assets/index.html-BMbDjf_W.js" as="script">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"><!--[--><div class="vp-theme-container" vp-container data-v-d32690b4><main class="page" data-v-d32690b4><div vp-content data-v-d32690b4><h1 data-v-d32690b4>404</h1><blockquote data-v-d32690b4>How did we get here?</blockquote><a class="route-link" href="/" data-v-d32690b4>Take me home</a></div></main></div><!--[--><!----><!--]--><!--]--></div>
|
||||
<script type="module" src="/assets/app-BITa06va.js" defer></script>
|
||||
<div id="app"><!--[--><div class="vp-theme-container" vp-container data-v-d32690b4><main class="page" data-v-d32690b4><div vp-content data-v-d32690b4><h1 data-v-d32690b4>404</h1><blockquote data-v-d32690b4>There's nothing here.</blockquote><a class="route-link" href="/" data-v-d32690b4>Take me home</a></div></main></div><!--[--><!----><!--]--><!--]--></div>
|
||||
<script type="module" src="/assets/app-C1vKFkGc.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1 +1 @@
|
||||
import{_ as e,c as o,b as a,o as n}from"./app-BITa06va.js";const l={};function r(s,t){return n(),o("div",null,[...t[0]||(t[0]=[a("p",null,"404 Not Found",-1)])])}const _=e(l,[["render",r]]),d=JSON.parse('{"path":"/404.html","title":"","lang":"zh-CN","frontmatter":{"layout":"NotFound"},"headers":[],"git":{},"filePathRelative":null}');export{_ as comp,d as data};
|
||||
import{_ as e,c as o,b as a,o as n}from"./app-C1vKFkGc.js";const l={};function r(s,t){return n(),o("div",null,[...t[0]||(t[0]=[a("p",null,"404 Not Found",-1)])])}const _=e(l,[["render",r]]),d=JSON.parse('{"path":"/404.html","title":"","lang":"zh-CN","frontmatter":{"layout":"NotFound"},"headers":[],"git":{},"filePathRelative":null}');export{_ as comp,d as data};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-CfHiKCXZ.js
vendored
Normal file
1
docs/cmleonos/docs/.vuepress/dist/assets/get-started.html-CfHiKCXZ.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import{_ as t,c as a,a as s,o as l}from"./app-C1vKFkGc.js";const o={};function n(i,e){return l(),a("div",null,[...e[0]||(e[0]=[s('<h1 id="配置教程" tabindex="-1"><a class="header-anchor" href="#配置教程"><span>配置教程</span></a></h1><h2 id="准备工作" tabindex="-1"><a class="header-anchor" href="#准备工作"><span>准备工作</span></a></h2><p>首先,准备一台实体机/虚拟机,确保这台机器等于或大于以下配置:</p><ul><li>处理器:一核以上</li><li>内存:512MB以上</li><li>硬盘:512MB以上</li><li>一个键盘</li><li>一个蜂鸣器或音频输出设备</li><li>建议装上AMD驱动的网卡(Intel驱动的网卡似乎无法运行)</li></ul><h2 id="配置硬盘" tabindex="-1"><a class="header-anchor" href="#配置硬盘"><span>配置硬盘</span></a></h2><blockquote><p>注:在准备发布的 1.0.0 PreRelease 2 版本中,不需要再执行这一步骤。 系统会在启动时自动检测硬盘是否格式化,如果未格式化,会提示用户并自动格式化硬盘。</p></blockquote><p>使用PE或其它工具格式化硬盘(注意只分一个区,文件系统选择FAT32)</p><h2 id="安装cmleonos" tabindex="-1"><a class="header-anchor" href="#安装cmleonos"><span>安装CMLeonOS</span></a></h2><p>将CMLeonOS的ISO文件挂载到虚拟机或实体机上,启动后按照提示进行 First time setup。</p><p>在 First time setup 中,系统会让你配置用户名、密码、主机名,配置完后会进行重启,重启之后正常登陆系统,然后就可以开始使用CMLeonOS了。</p>',10)])])}const m=t(o,[["render",n]]),r=JSON.parse('{"path":"/get-started.html","title":"配置教程","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"准备工作","slug":"准备工作","link":"#准备工作","children":[]},{"level":2,"title":"配置硬盘","slug":"配置硬盘","link":"#配置硬盘","children":[]},{"level":2,"title":"安装CMLeonOS","slug":"安装cmleonos","link":"#安装cmleonos","children":[]}],"git":{"updatedTime":1770548716000,"contributors":[{"name":"Leonmmcoset","username":"Leonmmcoset","email":"testmod@qq.com","commits":2,"url":"https://github.com/Leonmmcoset"}],"changelog":[{"hash":"ce90efeb3e81e83c7cfb468685933c2eabadf789","time":1770548716000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"文档更新"},{"hash":"33510365f48beba3a56b2dc6afd4c54b1fbdab60","time":1770190333000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"docs&Lua input()"}]},"filePathRelative":"get-started.md"}');export{m as comp,r as data};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as t,c as a,a as l,o as s}from"./app-BITa06va.js";const n={};function i(o,e){return s(),a("div",null,[...e[0]||(e[0]=[l('<h1 id="配置教程" tabindex="-1"><a class="header-anchor" href="#配置教程"><span>配置教程</span></a></h1><h2 id="准备工作" tabindex="-1"><a class="header-anchor" href="#准备工作"><span>准备工作</span></a></h2><p>首先,准备一台实体机/虚拟机,确保这台机器等于或大于以下配置:</p><ul><li>处理器:一核以上</li><li>内存:512MB以上</li><li>硬盘:512MB以上</li><li>一个键盘</li><li>一个蜂鸣器或音频输出设备</li><li>建议装上AMD驱动的网卡(Intel驱动的网卡似乎无法运行)</li></ul><h2 id="配置硬盘" tabindex="-1"><a class="header-anchor" href="#配置硬盘"><span>配置硬盘</span></a></h2><p>使用PE或其它工具格式化硬盘(注意只分一个区,文件系统选择FAT32)</p><h2 id="安装cmleonos" tabindex="-1"><a class="header-anchor" href="#安装cmleonos"><span>安装CMLeonOS</span></a></h2><p>将CMLeonOS的ISO文件挂载到虚拟机或实体机上,启动后按照提示进行 First time setup。</p><p>在 First time setup 中,系统会让你配置用户名、密码、主机名,配置完后会进行重启,重启之后正常登陆系统,然后就可以开始使用CMLeonOS了。</p>',9)])])}const r=t(n,[["render",i]]),m=JSON.parse('{"path":"/get-started.html","title":"配置教程","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"准备工作","slug":"准备工作","link":"#准备工作","children":[]},{"level":2,"title":"配置硬盘","slug":"配置硬盘","link":"#配置硬盘","children":[]},{"level":2,"title":"安装CMLeonOS","slug":"安装cmleonos","link":"#安装cmleonos","children":[]}],"git":{"updatedTime":1770190333000,"contributors":[{"name":"Leonmmcoset","username":"Leonmmcoset","email":"testmod@qq.com","commits":1,"url":"https://github.com/Leonmmcoset"}],"changelog":[{"hash":"33510365f48beba3a56b2dc6afd4c54b1fbdab60","time":1770190333000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"docs&Lua input()"}]},"filePathRelative":"get-started.md"}');export{r as comp,m as data};
|
||||
@@ -1 +1 @@
|
||||
import{_ as e,c as t,o as a}from"./app-BITa06va.js";const o={};function m(s,i){return a(),t("div")}const c=e(o,[["render",m]]),l=JSON.parse('{"path":"/","title":"主页","lang":"zh-CN","frontmatter":{"home":true,"title":"主页","actions":[{"text":"开始配置","link":"/get-started.html","type":"primary"},{"text":"Lua 文档","link":"/lua.html","type":"secondary"},{"text":"命令列表","link":"/commands.html","type":"secondary"}],"features":[{"title":"安全用户系统","details":"用户系统是直接绑定在内核下的,通过 SHA-256 密码哈希算法对用户密码进行加密存储,确保用户密码的安全性。"},{"title":"Lua 脚本支持","details":"CMLeonOS支持 Lua 脚本,用户可以通过 Lua 脚本实现自定义功能。"},{"title":"网络","details":"CMLeonOS支持 TCP/IP 协议栈,用户可以通过网络连接到其他设备。"},{"title":"FTP 服务器","details":"CMLeonOS支持 FTP 服务器,用户可以通过 FTP 协议上传下载文件。"},{"title":"内置编辑器","details":"CMLeonOS支持内置编辑器,用户可以直接在CMLeonOS中编辑文件。"},{"title":"硬盘存储","details":"CMLeonOS支持硬盘存储,用户可以将文件持久存储在硬盘中。"},{"title":"命令别名","details":"CMLeonOS支持命令别名功能,用户可以创建自定义命令快捷方式。"}]},"headers":[],"git":{"updatedTime":1770300033000,"contributors":[{"name":"Leonmmcoset","username":"Leonmmcoset","email":"testmod@qq.com","commits":2,"url":"https://github.com/Leonmmcoset"}],"changelog":[{"hash":"4384578fdb936483c76ffe61512a6530b54cf9ce","time":1770300033000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"update"},{"hash":"33510365f48beba3a56b2dc6afd4c54b1fbdab60","time":1770190333000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"docs&Lua input()"}]},"filePathRelative":"README.md"}');export{c as comp,l as data};
|
||||
import{_ as e,c as t,o as a}from"./app-C1vKFkGc.js";const o={};function m(s,i){return a(),t("div")}const c=e(o,[["render",m]]),l=JSON.parse('{"path":"/","title":"主页","lang":"zh-CN","frontmatter":{"home":true,"title":"主页","actions":[{"text":"开始配置","link":"/get-started.html","type":"primary"},{"text":"Lua 文档","link":"/lua.html","type":"secondary"},{"text":"命令列表","link":"/commands.html","type":"secondary"}],"features":[{"title":"安全用户系统","details":"用户系统是直接绑定在内核下的,通过 SHA-256 密码哈希算法对用户密码进行加密存储,确保用户密码的安全性。"},{"title":"Lua 脚本支持","details":"CMLeonOS支持 Lua 脚本,用户可以通过 Lua 脚本实现自定义功能。"},{"title":"网络","details":"CMLeonOS支持 TCP/IP 协议栈,用户可以通过网络连接到其他设备。"},{"title":"FTP 服务器","details":"CMLeonOS支持 FTP 服务器,用户可以通过 FTP 协议上传下载文件。"},{"title":"内置编辑器","details":"CMLeonOS支持内置编辑器,用户可以直接在CMLeonOS中编辑文件。"},{"title":"硬盘存储","details":"CMLeonOS支持硬盘存储,用户可以将文件持久存储在硬盘中。"},{"title":"命令别名","details":"CMLeonOS支持命令别名功能,用户可以创建自定义命令快捷方式。"}]},"headers":[],"git":{"updatedTime":1770300033000,"contributors":[{"name":"Leonmmcoset","username":"Leonmmcoset","email":"testmod@qq.com","commits":2,"url":"https://github.com/Leonmmcoset"}],"changelog":[{"hash":"4384578fdb936483c76ffe61512a6530b54cf9ce","time":1770300033000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"update"},{"hash":"33510365f48beba3a56b2dc6afd4c54b1fbdab60","time":1770190333000,"email":"testmod@qq.com","author":"Leonmmcoset","message":"docs&Lua input()"}]},"filePathRelative":"README.md"}');export{c as comp,l as data};
|
||||
File diff suppressed because one or more lines are too long
20
docs/cmleonos/docs/.vuepress/dist/commands.html
vendored
20
docs/cmleonos/docs/.vuepress/dist/commands.html
vendored
@@ -33,8 +33,8 @@
|
||||
</script>
|
||||
<title>命令列表 | CMLeonOS官方文档站</title><meta name="description" content="CMLeonOS是一个基于微内核架构的操作系统,它的目标是提供一个简单、可靠、安全的操作系统环境。">
|
||||
<link rel="preload" href="/assets/style-BmL0kmLr.css" as="style"><link rel="stylesheet" href="/assets/style-BmL0kmLr.css">
|
||||
<link rel="modulepreload" href="/assets/app-BITa06va.js"><link rel="modulepreload" href="/assets/commands.html-CJdMGWM7.js">
|
||||
<link rel="prefetch" href="/assets/get-started.html-D_vM18Nz.js" as="script"><link rel="prefetch" href="/assets/lua.html-DxDsLuB0.js" as="script"><link rel="prefetch" href="/assets/index.html-DS7rXIvH.js" as="script"><link rel="prefetch" href="/assets/404.html-B-2P5V78.js" as="script">
|
||||
<link rel="modulepreload" href="/assets/app-C1vKFkGc.js"><link rel="modulepreload" href="/assets/commands.html-DsR2axk8.js">
|
||||
<link rel="prefetch" href="/assets/get-started.html-CfHiKCXZ.js" as="script"><link rel="prefetch" href="/assets/lua.html-3_L4TJjQ.js" as="script"><link rel="prefetch" href="/assets/index.html-BMbDjf_W.js" as="script"><link rel="prefetch" href="/assets/404.html-ByTdGTSm.js" as="script">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"><!--[--><div class="vp-theme-container external-link-icon" vp-container><!--[--><header class="vp-navbar" vp-navbar><div class="vp-toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a class="route-link" href="/"><!----><span class="vp-site-name" aria-hidden="true">CMLeonOS官方文档站</span></a></span><div class="vp-navbar-items-wrapper" style=""><!--[--><!--]--><nav class="vp-navbar-items vp-hide-mobile" aria-label="site navigation"><!--[--><div class="vp-navbar-item"><a class="route-link auto-link" href="/" aria-label="主页"><!--[--><!--[--><!--]--><!--]-->主页<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/get-started.html" aria-label="配置教程"><!--[--><!--[--><!--]--><!--]-->配置教程<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/lua.html" aria-label="CMLeonOS Lua API 文档"><!--[--><!--[--><!--]--><!--]-->CMLeonOS Lua API 文档<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link route-link-active auto-link" href="/commands.html" aria-label="命令列表"><!--[--><!--[--><!--]--><!--]-->命令列表<!--[--><!--[--><!--]--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button type="button" class="vp-toggle-color-mode-button" title="toggle color mode"><svg class="light-icon" viewbox="0 0 32 32" style=""><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg class="dark-icon" viewbox="0 0 32 32" style="display:none;"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!----></div></header><!--]--><div class="vp-sidebar-mask"></div><!--[--><aside class="vp-sidebar" vp-sidebar><nav class="vp-navbar-items" aria-label="site navigation"><!--[--><div class="vp-navbar-item"><a class="route-link auto-link" href="/" aria-label="主页"><!--[--><!--[--><!--]--><!--]-->主页<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/get-started.html" aria-label="配置教程"><!--[--><!--[--><!--]--><!--]-->配置教程<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/lua.html" aria-label="CMLeonOS Lua API 文档"><!--[--><!--[--><!--]--><!--]-->CMLeonOS Lua API 文档<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link route-link-active auto-link" href="/commands.html" aria-label="命令列表"><!--[--><!--[--><!--]--><!--]-->命令列表<!--[--><!--[--><!--]--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="vp-sidebar-items"><!--[--><li><p tabindex="0" class="vp-sidebar-item vp-sidebar-heading">命令列表 <!----></p><!----></li><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="vp-page"><!--[--><!--]--><div vp-content><!--[--><!--]--><div><h1 id="命令列表" tabindex="-1"><a class="header-anchor" href="#命令列表"><span>命令列表</span></a></h1><p>CMLeonOS 提供了丰富的命令行工具,以下是所有可用命令的详细说明。</p><h2 id="系统命令" tabindex="-1"><a class="header-anchor" href="#系统命令"><span>系统命令</span></a></h2><h3 id="echo" tabindex="-1"><a class="header-anchor" href="#echo"><span>echo</span></a></h3><p>输出文本到控制台。</p><p><strong>用法:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line"><span class="token builtin class-name">echo</span> <span class="token operator"><</span>text<span class="token operator">></span></span>
|
||||
@@ -143,7 +143,17 @@
|
||||
<span class="line">base64 decode <span class="token operator"><</span>text<span class="token operator">></span> <span class="token comment"># 解码</span></span>
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>示例:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line">base64 encode <span class="token string">"Hello World"</span></span>
|
||||
<span class="line">base64 decode <span class="token string">"SGVsbG8gV29ybGQ="</span></span>
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="alias" tabindex="-1"><a class="header-anchor" href="#alias"><span>alias</span></a></h3><p>创建命令别名。</p><p><strong>用法:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line"><span class="token builtin class-name">alias</span> <span class="token comment"># 列出所有别名</span></span>
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="matrix" tabindex="-1"><a class="header-anchor" href="#matrix"><span>matrix</span></a></h3><p>显示黑客帝国矩阵效果。</p><p><strong>用法:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line">matrix</span>
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><p><strong>说明:</strong></p><ul><li>显示《黑客帝国》风格的矩阵雨效果</li><li>绿色字符在黑色背景上显示</li><li>随机字符和下落速度</li><li>按 ESC 或 Q 键退出</li></ul><h3 id="app" tabindex="-1"><a class="header-anchor" href="#app"><span>app</span></a></h3><p>应用程序管理器。</p><p><strong>用法:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line">app list <span class="token comment"># 列出所有可用应用</span></span>
|
||||
<span class="line">app <span class="token function">install</span> <span class="token operator"><</span>name<span class="token operator">></span> <span class="token comment"># 安装应用</span></span>
|
||||
<span class="line">app uninstall <span class="token operator"><</span>name<span class="token operator">></span> <span class="token comment"># 卸载应用</span></span>
|
||||
<span class="line">app installed <span class="token comment"># 列出已安装应用</span></span>
|
||||
<span class="line">app <span class="token builtin class-name">help</span> <span class="token comment"># 显示帮助信息</span></span>
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>示例:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line">app list</span>
|
||||
<span class="line">app <span class="token function">install</span> helloworld.lua</span>
|
||||
<span class="line">app uninstall helloworld.lua</span>
|
||||
<span class="line">app installed</span>
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>说明:</strong></p><ul><li>应用存储在嵌入资源中</li><li>安装的应用保存在 <code>0:\apps</code> 目录</li><li>安装的应用可以使用 <code>lua</code> 命令运行</li></ul><h3 id="alias" tabindex="-1"><a class="header-anchor" href="#alias"><span>alias</span></a></h3><p>创建命令别名。</p><p><strong>用法:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line"><span class="token builtin class-name">alias</span> <span class="token comment"># 列出所有别名</span></span>
|
||||
<span class="line"><span class="token builtin class-name">alias</span> <span class="token operator"><</span>name<span class="token operator">></span> <span class="token operator"><</span>command<span class="token operator">></span> <span class="token comment"># 创建新别名</span></span>
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>示例:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line"><span class="token builtin class-name">alias</span> ll <span class="token string">'ls -l'</span></span>
|
||||
<span class="line"><span class="token builtin class-name">alias</span> home <span class="token string">'cd /home'</span></span>
|
||||
@@ -179,7 +189,7 @@
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>示例:</strong></p><div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh"><pre><code><span class="line"><span class="token function">env</span></span>
|
||||
<span class="line"><span class="token function">env</span> <span class="token environment constant">PATH</span></span>
|
||||
<span class="line"><span class="token function">env</span> MYVAR hello</span>
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="注意事项" tabindex="-1"><a class="header-anchor" href="#注意事项"><span>注意事项</span></a></h2><ol><li>所有命令不区分大小写</li><li>使用 <code>help</code> 命令可以查看所有可用命令</li><li>使用 <code>help <command></code> 可以查看特定命令的详细帮助</li><li>文件路径使用反斜杠 <code>\</code> 或正斜杠 <code>/</code> 均可</li><li>支持相对路径和绝对路径</li></ol></div><!--[--><!--]--></div><footer class="vp-page-meta"><!----><div class="vp-meta-item git-info"><div class="vp-meta-item last-updated"><span class="meta-item-label">最近更新:: </span><time class="meta-item-info" datetime="2026-02-06T08:18:30.000Z" data-allow-mismatch>2026/2/6 16:18</time></div><div class="vp-meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: testmod@qq.com">Leonmmcoset</span><!----><!--]--><!--]--></span></div></div></footer><!----><!--[--><!--]--></main><!--]--></div><!--[--><!----><!--]--><!--]--></div>
|
||||
<script type="module" src="/assets/app-BITa06va.js" defer></script>
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="注意事项" tabindex="-1"><a class="header-anchor" href="#注意事项"><span>注意事项</span></a></h2><ol><li>所有命令不区分大小写</li><li>使用 <code>help</code> 命令可以查看所有可用命令</li><li>使用 <code>help <command></code> 可以查看特定命令的详细帮助</li><li>文件路径使用反斜杠 <code>\</code> 或正斜杠 <code>/</code> 均可</li><li>支持相对路径和绝对路径</li></ol></div><!--[--><!--]--></div><footer class="vp-page-meta"><!----><div class="vp-meta-item git-info"><div class="vp-meta-item last-updated"><span class="meta-item-label">最近更新:: </span><time class="meta-item-info" datetime="2026-02-06T09:30:12.000Z" data-allow-mismatch>2026/2/6 17:30</time></div><div class="vp-meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: testmod@qq.com">Leonmmcoset</span><!----><!--]--><!--]--></span></div></div></footer><!----><!--[--><!--]--></main><!--]--></div><!--[--><!----><!--]--><!--]--></div>
|
||||
<script type="module" src="/assets/app-C1vKFkGc.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
File diff suppressed because one or more lines are too long
6
docs/cmleonos/docs/.vuepress/dist/index.html
vendored
6
docs/cmleonos/docs/.vuepress/dist/index.html
vendored
File diff suppressed because one or more lines are too long
16
docs/cmleonos/docs/.vuepress/dist/lua.html
vendored
16
docs/cmleonos/docs/.vuepress/dist/lua.html
vendored
@@ -33,8 +33,8 @@
|
||||
</script>
|
||||
<title>CMLeonOS Lua API 文档 | CMLeonOS官方文档站</title><meta name="description" content="CMLeonOS是一个基于微内核架构的操作系统,它的目标是提供一个简单、可靠、安全的操作系统环境。">
|
||||
<link rel="preload" href="/assets/style-BmL0kmLr.css" as="style"><link rel="stylesheet" href="/assets/style-BmL0kmLr.css">
|
||||
<link rel="modulepreload" href="/assets/app-BITa06va.js"><link rel="modulepreload" href="/assets/lua.html-DxDsLuB0.js">
|
||||
<link rel="prefetch" href="/assets/commands.html-CJdMGWM7.js" as="script"><link rel="prefetch" href="/assets/get-started.html-D_vM18Nz.js" as="script"><link rel="prefetch" href="/assets/index.html-DS7rXIvH.js" as="script"><link rel="prefetch" href="/assets/404.html-B-2P5V78.js" as="script">
|
||||
<link rel="modulepreload" href="/assets/app-C1vKFkGc.js"><link rel="modulepreload" href="/assets/lua.html-3_L4TJjQ.js">
|
||||
<link rel="prefetch" href="/assets/commands.html-DsR2axk8.js" as="script"><link rel="prefetch" href="/assets/get-started.html-CfHiKCXZ.js" as="script"><link rel="prefetch" href="/assets/index.html-BMbDjf_W.js" as="script"><link rel="prefetch" href="/assets/404.html-ByTdGTSm.js" as="script">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"><!--[--><div class="vp-theme-container external-link-icon" vp-container><!--[--><header class="vp-navbar" vp-navbar><div class="vp-toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a class="route-link" href="/"><!----><span class="vp-site-name" aria-hidden="true">CMLeonOS官方文档站</span></a></span><div class="vp-navbar-items-wrapper" style=""><!--[--><!--]--><nav class="vp-navbar-items vp-hide-mobile" aria-label="site navigation"><!--[--><div class="vp-navbar-item"><a class="route-link auto-link" href="/" aria-label="主页"><!--[--><!--[--><!--]--><!--]-->主页<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/get-started.html" aria-label="配置教程"><!--[--><!--[--><!--]--><!--]-->配置教程<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link route-link-active auto-link" href="/lua.html" aria-label="CMLeonOS Lua API 文档"><!--[--><!--[--><!--]--><!--]-->CMLeonOS Lua API 文档<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/commands.html" aria-label="命令列表"><!--[--><!--[--><!--]--><!--]-->命令列表<!--[--><!--[--><!--]--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button type="button" class="vp-toggle-color-mode-button" title="toggle color mode"><svg class="light-icon" viewbox="0 0 32 32" style=""><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg class="dark-icon" viewbox="0 0 32 32" style="display:none;"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!----></div></header><!--]--><div class="vp-sidebar-mask"></div><!--[--><aside class="vp-sidebar" vp-sidebar><nav class="vp-navbar-items" aria-label="site navigation"><!--[--><div class="vp-navbar-item"><a class="route-link auto-link" href="/" aria-label="主页"><!--[--><!--[--><!--]--><!--]-->主页<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/get-started.html" aria-label="配置教程"><!--[--><!--[--><!--]--><!--]-->配置教程<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link route-link-active auto-link" href="/lua.html" aria-label="CMLeonOS Lua API 文档"><!--[--><!--[--><!--]--><!--]-->CMLeonOS Lua API 文档<!--[--><!--[--><!--]--><!--]--></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/commands.html" aria-label="命令列表"><!--[--><!--[--><!--]--><!--]-->命令列表<!--[--><!--[--><!--]--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="vp-sidebar-items"><!--[--><li><p tabindex="0" class="vp-sidebar-item vp-sidebar-heading">CMLeonOS Lua API 文档 <!----></p><!----></li><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="vp-page"><!--[--><!--]--><div vp-content><!--[--><!--]--><div><h1 id="cmleonos-lua-api-文档" tabindex="-1"><a class="header-anchor" href="#cmleonos-lua-api-文档"><span>CMLeonOS Lua API 文档</span></a></h1><p>本文档记录了 CMLeonOS 中 Lua 支持的所有函数和库。</p><h2 id="基础库-base" tabindex="-1"><a class="header-anchor" href="#基础库-base"><span>基础库 (base)</span></a></h2><h3 id="assert-v-message" tabindex="-1"><a class="header-anchor" href="#assert-v-message"><span>assert(v [, message])</span></a></h3><p>如果 v 为 false 或 nil,则抛出错误。可选参数 message 为错误信息。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line"><span class="token function">assert</span><span class="token punctuation">(</span><span class="token keyword">true</span><span class="token punctuation">,</span> <span class="token string">"This should be true"</span><span class="token punctuation">)</span></span>
|
||||
@@ -205,7 +205,13 @@
|
||||
<span class="line"><span class="token keyword">end</span></span>
|
||||
<span class="line"><span class="token keyword">local</span> elapsed <span class="token operator">=</span> os<span class="token punctuation">.</span><span class="token function">timerstop</span><span class="token punctuation">(</span><span class="token punctuation">)</span></span>
|
||||
<span class="line"><span class="token function">print</span><span class="token punctuation">(</span><span class="token string">"Elapsed time:"</span><span class="token punctuation">,</span> elapsed<span class="token punctuation">,</span> <span class="token string">"seconds"</span><span class="token punctuation">)</span></span>
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>注意</strong>:</p><ul><li>如果在未调用 <code>timerstart</code> 的情况下调用 <code>timerstop</code>,将返回 <code>nil</code></li><li>每次调用 <code>timerstop</code> 后,计时器会被重置</li><li>返回的时间单位为秒(浮点数)</li></ul><hr><h2 id="输入输出库-io" tabindex="-1"><a class="header-anchor" href="#输入输出库-io"><span>输入输出库 (io)</span></a></h2><h3 id="io-close-file" tabindex="-1"><a class="header-anchor" href="#io-close-file"><span>io.close(file)</span></a></h3><p>关闭文件。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line"><span class="token keyword">local</span> file <span class="token operator">=</span> io<span class="token punctuation">.</span><span class="token function">open</span><span class="token punctuation">(</span><span class="token string">"test.txt"</span><span class="token punctuation">,</span> <span class="token string">"w"</span><span class="token punctuation">)</span></span>
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>注意</strong>:</p><ul><li>如果在未调用 <code>timerstart</code> 的情况下调用 <code>timerstop</code>,将返回 <code>nil</code></li><li>每次调用 <code>timerstop</code> 后,计时器会被重置</li><li>返回的时间单位为秒(浮点数)</li></ul><h3 id="os-tui-drawbox-x-y-width-height-title-bordercolor-backgroundcolor" tabindex="-1"><a class="header-anchor" href="#os-tui-drawbox-x-y-width-height-title-bordercolor-backgroundcolor"><span>os.tui_drawbox(x, y, width, height, title, borderColor, backgroundColor)</span></a></h3><p>绘制带边框和标题的矩形框。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line">os<span class="token punctuation">.</span><span class="token function">tui_drawbox</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">,</span> <span class="token number">40</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token string">"Title"</span><span class="token punctuation">,</span> <span class="token string">"white"</span><span class="token punctuation">,</span> <span class="token string">"darkblue"</span><span class="token punctuation">)</span></span>
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><p><strong>参数</strong>:</p><ul><li><code>x</code> - 矩形框的左上角 X 坐标</li><li><code>y</code> - 矩形框的左上角 Y 坐标</li><li><code>width</code> - 矩形框的宽度</li><li><code>height</code> - 矩形框的高度</li><li><code>title</code> - 矩形框的标题(可选)</li><li><code>borderColor</code> - 边框颜色(black, blue, cyan, darkblue, darkcyan, darkgray, darkgreen, darkmagenta, darkred, darkyellow, gray, green, magenta, red, white, yellow)</li><li><code>backgroundColor</code> - 背景颜色(同上)</li></ul><h3 id="os-tui-drawtext-x-y-text-foregroundcolor-backgroundcolor" tabindex="-1"><a class="header-anchor" href="#os-tui-drawtext-x-y-text-foregroundcolor-backgroundcolor"><span>os.tui_drawtext(x, y, text, foregroundColor, backgroundColor)</span></a></h3><p>在指定位置绘制文本。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line">os<span class="token punctuation">.</span><span class="token function">tui_drawtext</span><span class="token punctuation">(</span><span class="token number">15</span><span class="token punctuation">,</span> <span class="token number">8</span><span class="token punctuation">,</span> <span class="token string">"Hello World!"</span><span class="token punctuation">,</span> <span class="token string">"yellow"</span><span class="token punctuation">,</span> <span class="token string">"black"</span><span class="token punctuation">)</span></span>
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><p><strong>参数</strong>:</p><ul><li><code>x</code> - 文本的 X 坐标</li><li><code>y</code> - 文本的 Y 坐标</li><li><code>text</code> - 要绘制的文本内容</li><li><code>foregroundColor</code> - 前景色(同上)</li><li><code>backgroundColor</code> - 背景色(同上)</li></ul><h3 id="os-tui-setcolor-foregroundcolor-backgroundcolor" tabindex="-1"><a class="header-anchor" href="#os-tui-setcolor-foregroundcolor-backgroundcolor"><span>os.tui_setcolor(foregroundColor, backgroundColor)</span></a></h3><p>设置前景色和背景色。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line">os<span class="token punctuation">.</span><span class="token function">tui_setcolor</span><span class="token punctuation">(</span><span class="token string">"white"</span><span class="token punctuation">,</span> <span class="token string">"black"</span><span class="token punctuation">)</span></span>
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><p><strong>参数</strong>:</p><ul><li><code>foregroundColor</code> - 前景色(black, blue, cyan, darkblue, darkcyan, darkgray, darkgreen, darkmagenta, darkred, darkyellow, gray, green, magenta, red, white, yellow)</li><li><code>backgroundColor</code> - 背景色(同上)</li></ul><h3 id="os-tui-setcursor-x-y" tabindex="-1"><a class="header-anchor" href="#os-tui-setcursor-x-y"><span>os.tui_setcursor(x, y)</span></a></h3><p>设置光标位置。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line">os<span class="token punctuation">.</span><span class="token function">tui_setcursor</span><span class="token punctuation">(</span><span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">10</span><span class="token punctuation">)</span></span>
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><p><strong>参数</strong>:</p><ul><li><code>x</code> - 光标的 X 坐标</li><li><code>y</code> - 光标的 Y 坐标</li></ul><h3 id="os-tui-clear" tabindex="-1"><a class="header-anchor" href="#os-tui-clear"><span>os.tui_clear()</span></a></h3><p>清屏。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line">os<span class="token punctuation">.</span><span class="token function">tui_clear</span><span class="token punctuation">(</span><span class="token punctuation">)</span></span>
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><h3 id="os-tui-drawline-x-y-length-character-color" tabindex="-1"><a class="header-anchor" href="#os-tui-drawline-x-y-length-character-color"><span>os.tui_drawline(x, y, length, character, color)</span></a></h3><p>绘制水平线。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line">os<span class="token punctuation">.</span><span class="token function">tui_drawline</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">15</span><span class="token punctuation">,</span> <span class="token number">30</span><span class="token punctuation">,</span> <span class="token string">"-"</span><span class="token punctuation">,</span> <span class="token string">"green"</span><span class="token punctuation">)</span></span>
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><p><strong>参数</strong>:</p><ul><li><code>x</code> - 线的起始 X 坐标</li><li><code>y</code> - 线的起始 Y 坐标</li><li><code>length</code> - 线的长度</li><li><code>character</code> - 用于绘制线的字符</li><li><code>color</code> - 线的颜色(同上)</li></ul><hr><h2 id="输入输出库-io" tabindex="-1"><a class="header-anchor" href="#输入输出库-io"><span>输入输出库 (io)</span></a></h2><h3 id="io-close-file" tabindex="-1"><a class="header-anchor" href="#io-close-file"><span>io.close(file)</span></a></h3><p>关闭文件。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line"><span class="token keyword">local</span> file <span class="token operator">=</span> io<span class="token punctuation">.</span><span class="token function">open</span><span class="token punctuation">(</span><span class="token string">"test.txt"</span><span class="token punctuation">,</span> <span class="token string">"w"</span><span class="token punctuation">)</span></span>
|
||||
<span class="line">file<span class="token punctuation">:</span><span class="token function">write</span><span class="token punctuation">(</span><span class="token string">"Hello"</span><span class="token punctuation">)</span></span>
|
||||
<span class="line">io<span class="token punctuation">.</span><span class="token function">close</span><span class="token punctuation">(</span>file<span class="token punctuation">)</span></span>
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="io-flush" tabindex="-1"><a class="header-anchor" href="#io-flush"><span>io.flush()</span></a></h3><p>刷新所有打开文件的输出缓冲区。</p><div class="language-lua line-numbers-mode" data-highlighter="prismjs" data-ext="lua"><pre><code><span class="line">io<span class="token punctuation">.</span><span class="token function">flush</span><span class="token punctuation">(</span><span class="token punctuation">)</span></span>
|
||||
@@ -333,7 +339,7 @@
|
||||
<span class="line"><span class="token function">print</span><span class="token punctuation">(</span><span class="token string">"Hash:"</span><span class="token punctuation">,</span> hash<span class="token punctuation">)</span></span>
|
||||
<span class="line"><span class="token function">print</span><span class="token punctuation">(</span><span class="token string">"Encoded:"</span><span class="token punctuation">,</span> encoded<span class="token punctuation">)</span></span>
|
||||
<span class="line"><span class="token function">print</span><span class="token punctuation">(</span><span class="token string">"Decoded:"</span><span class="token punctuation">,</span> decoded<span class="token punctuation">)</span></span>
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="注意事项" tabindex="-1"><a class="header-anchor" href="#注意事项"><span>注意事项</span></a></h2><ol><li><strong>交互模式</strong>:使用 <code>lua --shell</code> 进入交互式 Lua Shell</li><li><strong>错误处理</strong>:所有 Lua 执行错误都会被捕获并显示</li><li><strong>系统函数</strong>:<code>os</code> 库包含 CMLeonOS 特定的系统函数</li><li><strong>加密支持</strong>:支持 SHA256 和 Base64 编码/解码</li><li><strong>标准 Lua</strong>:完全兼容 Lua 5.1 标准</li></ol><h2 id="版本信息" tabindex="-1"><a class="header-anchor" href="#版本信息"><span>版本信息</span></a></h2><ul><li><strong>Lua 版本</strong>:5.2</li><li><strong>CMLeonOS 版本</strong>:最新</li></ul></div><!--[--><!--]--></div><footer class="vp-page-meta"><!----><div class="vp-meta-item git-info"><div class="vp-meta-item last-updated"><span class="meta-item-label">最近更新:: </span><time class="meta-item-info" datetime="2026-02-05T05:15:17.000Z" data-allow-mismatch>2026/2/5 13:15</time></div><div class="vp-meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: testmod@qq.com">Leonmmcoset</span><!----><!--]--><!--]--></span></div></div></footer><!----><!--[--><!--]--></main><!--]--></div><!--[--><!----><!--]--><!--]--></div>
|
||||
<script type="module" src="/assets/app-BITa06va.js" defer></script>
|
||||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="注意事项" tabindex="-1"><a class="header-anchor" href="#注意事项"><span>注意事项</span></a></h2><ol><li><strong>交互模式</strong>:使用 <code>lua --shell</code> 进入交互式 Lua Shell</li><li><strong>错误处理</strong>:所有 Lua 执行错误都会被捕获并显示</li><li><strong>系统函数</strong>:<code>os</code> 库包含 CMLeonOS 特定的系统函数</li><li><strong>加密支持</strong>:支持 SHA256 和 Base64 编码/解码</li><li><strong>标准 Lua</strong>:完全兼容 Lua 5.1 标准</li></ol><h2 id="版本信息" tabindex="-1"><a class="header-anchor" href="#版本信息"><span>版本信息</span></a></h2><ul><li><strong>Lua 版本</strong>:5.2</li><li><strong>CMLeonOS 版本</strong>:最新</li></ul></div><!--[--><!--]--></div><footer class="vp-page-meta"><!----><div class="vp-meta-item git-info"><div class="vp-meta-item last-updated"><span class="meta-item-label">最近更新:: </span><time class="meta-item-info" datetime="2026-02-07T10:54:10.000Z" data-allow-mismatch>2026/2/7 18:54</time></div><div class="vp-meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: testmod@qq.com">Leonmmcoset</span><!----><!--]--><!--]--></span></div></div></footer><!----><!--[--><!--]--></main><!--]--></div><!--[--><!----><!--]--><!--]--></div>
|
||||
<script type="module" src="/assets/app-C1vKFkGc.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -613,6 +613,45 @@ base64 encode "Hello World"
|
||||
base64 decode "SGVsbG8gV29ybGQ="
|
||||
```
|
||||
|
||||
### matrix
|
||||
显示黑客帝国矩阵效果。
|
||||
|
||||
**用法:**
|
||||
```bash
|
||||
matrix
|
||||
```
|
||||
|
||||
**说明:**
|
||||
- 显示《黑客帝国》风格的矩阵雨效果
|
||||
- 绿色字符在黑色背景上显示
|
||||
- 随机字符和下落速度
|
||||
- 按 ESC 或 Q 键退出
|
||||
|
||||
### app
|
||||
应用程序管理器。
|
||||
|
||||
**用法:**
|
||||
```bash
|
||||
app list # 列出所有可用应用
|
||||
app install <name> # 安装应用
|
||||
app uninstall <name> # 卸载应用
|
||||
app installed # 列出已安装应用
|
||||
app help # 显示帮助信息
|
||||
```
|
||||
|
||||
**示例:**
|
||||
```bash
|
||||
app list
|
||||
app install helloworld.lua
|
||||
app uninstall helloworld.lua
|
||||
app installed
|
||||
```
|
||||
|
||||
**说明:**
|
||||
- 应用存储在嵌入资源中
|
||||
- 安装的应用保存在 `0:\apps` 目录
|
||||
- 安装的应用可以使用 `lua` 命令运行
|
||||
|
||||
### alias
|
||||
创建命令别名。
|
||||
|
||||
@@ -652,6 +691,18 @@ unalias ll
|
||||
version
|
||||
```
|
||||
|
||||
**输出:**
|
||||
```
|
||||
CMLeonOS v1.0.0 (PreRelease 2) - Git: b80c5b4
|
||||
Major: 1
|
||||
Minor: 0
|
||||
Patch: 0
|
||||
Type: PreRelease 2
|
||||
Full Version: 1.0.0-PreRelease 2
|
||||
Git Commit: b80c5b4
|
||||
Build Time: 2026-02-12 15:30:45
|
||||
```
|
||||
|
||||
### settings
|
||||
查看或修改系统设置。
|
||||
|
||||
@@ -716,34 +767,6 @@ restart
|
||||
shutdown
|
||||
```
|
||||
|
||||
## 备份与恢复命令
|
||||
|
||||
### backup
|
||||
备份系统。
|
||||
|
||||
**用法:**
|
||||
```bash
|
||||
backup <backup_file>
|
||||
```
|
||||
|
||||
**示例:**
|
||||
```bash
|
||||
backup mybackup.zip
|
||||
```
|
||||
|
||||
### restore
|
||||
恢复系统备份。
|
||||
|
||||
**用法:**
|
||||
```bash
|
||||
restore <backup_file>
|
||||
```
|
||||
|
||||
**示例:**
|
||||
```bash
|
||||
restore mybackup.zip
|
||||
```
|
||||
|
||||
## 测试命令
|
||||
|
||||
### cuitest
|
||||
@@ -754,6 +777,14 @@ restore mybackup.zip
|
||||
cuitest
|
||||
```
|
||||
|
||||
### testtui
|
||||
测试 TUI 框架。
|
||||
|
||||
**用法:**
|
||||
```bash
|
||||
testtui
|
||||
```
|
||||
|
||||
### testgui
|
||||
测试图形界面。
|
||||
|
||||
@@ -778,6 +809,23 @@ labyrinth
|
||||
- 出口位置用红色 E 表示
|
||||
- 迷宫使用递归回溯算法随机生成
|
||||
|
||||
### snake
|
||||
玩贪吃蛇游戏。
|
||||
|
||||
**用法:**
|
||||
```bash
|
||||
snake
|
||||
```
|
||||
|
||||
**说明:**
|
||||
- 使用方向键 (↑ ↓ ← →) 控制蛇的移动
|
||||
- 按 ESC 或 Q 键退出游戏
|
||||
- 蛇身用绿色 # 表示
|
||||
- 食物用红色 O 表示
|
||||
- 吃到食物得分 +10 分
|
||||
- 撞到墙壁或自己身体游戏结束
|
||||
- 游戏区域:40x20 字符
|
||||
|
||||
### diff
|
||||
比较两个文件的差异。
|
||||
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
- 建议装上AMD驱动的网卡(Intel驱动的网卡似乎无法运行)
|
||||
|
||||
## 配置硬盘
|
||||
> 注:在准备发布的 1.0.0 PreRelease 2 版本中,不需要再执行这一步骤。
|
||||
> 系统会在启动时自动检测硬盘是否格式化,如果未格式化,会提示用户并自动格式化硬盘。
|
||||
|
||||
使用PE或其它工具格式化硬盘(注意只分一个区,文件系统选择FAT32)
|
||||
|
||||
## 安装CMLeonOS
|
||||
|
||||
@@ -721,6 +721,79 @@ print("Elapsed time:", elapsed, "seconds")
|
||||
- 每次调用 `timerstop` 后,计时器会被重置
|
||||
- 返回的时间单位为秒(浮点数)
|
||||
|
||||
### os.tui_drawbox(x, y, width, height, title, borderColor, backgroundColor)
|
||||
绘制带边框和标题的矩形框。
|
||||
|
||||
```lua
|
||||
os.tui_drawbox(10, 5, 40, 10, "Title", "white", "darkblue")
|
||||
```
|
||||
|
||||
**参数**:
|
||||
- `x` - 矩形框的左上角 X 坐标
|
||||
- `y` - 矩形框的左上角 Y 坐标
|
||||
- `width` - 矩形框的宽度
|
||||
- `height` - 矩形框的高度
|
||||
- `title` - 矩形框的标题(可选)
|
||||
- `borderColor` - 边框颜色(black, blue, cyan, darkblue, darkcyan, darkgray, darkgreen, darkmagenta, darkred, darkyellow, gray, green, magenta, red, white, yellow)
|
||||
- `backgroundColor` - 背景颜色(同上)
|
||||
|
||||
### os.tui_drawtext(x, y, text, foregroundColor, backgroundColor)
|
||||
在指定位置绘制文本。
|
||||
|
||||
```lua
|
||||
os.tui_drawtext(15, 8, "Hello World!", "yellow", "black")
|
||||
```
|
||||
|
||||
**参数**:
|
||||
- `x` - 文本的 X 坐标
|
||||
- `y` - 文本的 Y 坐标
|
||||
- `text` - 要绘制的文本内容
|
||||
- `foregroundColor` - 前景色(同上)
|
||||
- `backgroundColor` - 背景色(同上)
|
||||
|
||||
### os.tui_setcolor(foregroundColor, backgroundColor)
|
||||
设置前景色和背景色。
|
||||
|
||||
```lua
|
||||
os.tui_setcolor("white", "black")
|
||||
```
|
||||
|
||||
**参数**:
|
||||
- `foregroundColor` - 前景色(black, blue, cyan, darkblue, darkcyan, darkgray, darkgreen, darkmagenta, darkred, darkyellow, gray, green, magenta, red, white, yellow)
|
||||
- `backgroundColor` - 背景色(同上)
|
||||
|
||||
### os.tui_setcursor(x, y)
|
||||
设置光标位置。
|
||||
|
||||
```lua
|
||||
os.tui_setcursor(20, 10)
|
||||
```
|
||||
|
||||
**参数**:
|
||||
- `x` - 光标的 X 坐标
|
||||
- `y` - 光标的 Y 坐标
|
||||
|
||||
### os.tui_clear()
|
||||
清屏。
|
||||
|
||||
```lua
|
||||
os.tui_clear()
|
||||
```
|
||||
|
||||
### os.tui_drawline(x, y, length, character, color)
|
||||
绘制水平线。
|
||||
|
||||
```lua
|
||||
os.tui_drawline(10, 15, 30, "-", "green")
|
||||
```
|
||||
|
||||
**参数**:
|
||||
- `x` - 线的起始 X 坐标
|
||||
- `y` - 线的起始 Y 坐标
|
||||
- `length` - 线的长度
|
||||
- `character` - 用于绘制线的字符
|
||||
- `color` - 线的颜色(同上)
|
||||
|
||||
---
|
||||
|
||||
## 输入输出库 (io)
|
||||
|
||||
707
editor/Nano.cs
707
editor/Nano.cs
@@ -1,9 +1,73 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UniLua;
|
||||
|
||||
namespace CMLeonOS
|
||||
{
|
||||
public class NanoSettings
|
||||
{
|
||||
public bool EnableSmartIndent { get; set; } = true;
|
||||
public bool EnableAutoCompleteBrackets { get; set; } = true;
|
||||
public bool EnableAutoCompleteQuotes { get; set; } = true;
|
||||
public bool EnableSmartDelete { get; set; } = true;
|
||||
public bool EnableSyntaxHighlight { get; set; } = true;
|
||||
|
||||
public void Save(string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
bool smartIndent = EnableSmartIndent;
|
||||
bool autoBrackets = EnableAutoCompleteBrackets;
|
||||
bool autoQuotes = EnableAutoCompleteQuotes;
|
||||
bool smartDelete = EnableSmartDelete;
|
||||
bool syntaxHighlight = EnableSyntaxHighlight;
|
||||
|
||||
string content = $"{smartIndent},{autoBrackets},{autoQuotes},{smartDelete},{syntaxHighlight}";
|
||||
using (StreamWriter sw = new StreamWriter(filePath))
|
||||
{
|
||||
sw.Write(content);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public void Load(string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
using (StreamReader sr = new StreamReader(filePath))
|
||||
{
|
||||
string content = sr.ReadToEnd();
|
||||
string[] parts = content.Split(',');
|
||||
if (parts.Length >= 5)
|
||||
{
|
||||
bool smartIndent, autoBrackets, autoQuotes, smartDelete, syntaxHighlight;
|
||||
bool.TryParse(parts[0], out smartIndent);
|
||||
bool.TryParse(parts[1], out autoBrackets);
|
||||
bool.TryParse(parts[2], out autoQuotes);
|
||||
bool.TryParse(parts[3], out smartDelete);
|
||||
bool.TryParse(parts[4], out syntaxHighlight);
|
||||
|
||||
EnableSmartIndent = smartIndent;
|
||||
EnableAutoCompleteBrackets = autoBrackets;
|
||||
EnableAutoCompleteQuotes = autoQuotes;
|
||||
EnableSmartDelete = smartDelete;
|
||||
EnableSyntaxHighlight = syntaxHighlight;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Nano
|
||||
{
|
||||
private string path;
|
||||
@@ -22,6 +86,7 @@ namespace CMLeonOS
|
||||
private FileSystem fileSystem;
|
||||
private UserSystem userSystem;
|
||||
private Shell shell;
|
||||
private NanoSettings settings = new NanoSettings();
|
||||
|
||||
private readonly (string, string)[] SHORTCUTS = new (string, string)[]
|
||||
{
|
||||
@@ -47,15 +112,22 @@ namespace CMLeonOS
|
||||
|
||||
if (value != null && fileSystem != null)
|
||||
{
|
||||
string fullPath = fileSystem.GetFullPath(value);
|
||||
|
||||
if (System.IO.File.Exists(fullPath))
|
||||
try
|
||||
{
|
||||
string fullPath = fileSystem.GetFullPath(value);
|
||||
string text = fileSystem.ReadFile(fullPath);
|
||||
text = text.Replace("\r\n", "\n");
|
||||
lines.AddRange(text.Split('\n'));
|
||||
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
text = text.Replace("\r\n", "\n");
|
||||
lines.AddRange(text.Split('\n'));
|
||||
}
|
||||
else
|
||||
{
|
||||
lines.Add(string.Empty);
|
||||
}
|
||||
}
|
||||
else
|
||||
catch
|
||||
{
|
||||
lines.Add(string.Empty);
|
||||
}
|
||||
@@ -90,7 +162,6 @@ namespace CMLeonOS
|
||||
{
|
||||
int y = i - scrollY + TITLEBAR_HEIGHT;
|
||||
if (y < TITLEBAR_HEIGHT || y >= consoleHeight - SHORTCUT_BAR_HEIGHT) continue;
|
||||
|
||||
Console.SetCursorPosition(0, y);
|
||||
|
||||
if (i >= lines.Count || scrollX >= lines[i].Length)
|
||||
@@ -100,7 +171,15 @@ namespace CMLeonOS
|
||||
else
|
||||
{
|
||||
string line = lines[i].Substring(scrollX, Math.Min(consoleWidth, lines[i].Length - scrollX));
|
||||
Console.Write(line + new string(' ', Math.Max(0, consoleWidth - line.Length)));
|
||||
|
||||
if (IsLuaFile() && settings.EnableSyntaxHighlight)
|
||||
{
|
||||
RenderLuaLine(line, consoleWidth);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Write(line + new string(' ', Math.Max(0, consoleWidth - line.Length)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,34 +190,410 @@ namespace CMLeonOS
|
||||
Console.SetCursorPosition(linePos - scrollX, currentLine + TITLEBAR_HEIGHT - scrollY);
|
||||
}
|
||||
|
||||
private bool IsLuaFile()
|
||||
{
|
||||
if (path != null)
|
||||
{
|
||||
string extension = System.IO.Path.GetExtension(path)?.ToLower();
|
||||
return extension == ".lua";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void RenderLuaLine(string line, int consoleWidth)
|
||||
{
|
||||
int pos = 0;
|
||||
bool inString = false;
|
||||
bool inComment = false;
|
||||
bool inLongComment = false;
|
||||
char stringDelimiter = '\0';
|
||||
|
||||
while (pos < line.Length && pos < consoleWidth)
|
||||
{
|
||||
if (inComment)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
else if (inLongComment)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
if (pos + 1 < line.Length && line[pos] == ']' && line[pos + 1] == ']')
|
||||
{
|
||||
inLongComment = false;
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
else if (pos + 1 < line.Length && line[pos] == '-' && line[pos + 1] == '-')
|
||||
{
|
||||
if (pos + 3 < line.Length && line[pos + 2] == '[' && line[pos + 3] == '[')
|
||||
{
|
||||
inLongComment = true;
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Write(line.Substring(pos));
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
inComment = true;
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
Console.Write(line.Substring(pos));
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (inString)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Yellow;
|
||||
if (line[pos] == stringDelimiter)
|
||||
{
|
||||
if (pos + 1 < line.Length && line[pos + 1] == stringDelimiter)
|
||||
{
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Write(line[pos]);
|
||||
inString = false;
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
else if (line[pos] == '\\')
|
||||
{
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
if (pos < line.Length)
|
||||
{
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (line[pos] == '"' || line[pos] == '\'')
|
||||
{
|
||||
inString = true;
|
||||
stringDelimiter = line[pos];
|
||||
Console.ForegroundColor = ConsoleColor.Yellow;
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
else if (IsLuaNumber(line, pos))
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Magenta;
|
||||
while (pos < line.Length && IsLuaNumber(line, pos))
|
||||
{
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
else if (IsLuaOperator(line, pos))
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.DarkYellow;
|
||||
if (pos + 1 < line.Length && IsLuaOperator(line, pos + 1))
|
||||
{
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
else if (IsLuaKeyword(line, pos))
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Cyan;
|
||||
string keyword = GetLuaKeyword(line, pos);
|
||||
Console.Write(keyword);
|
||||
pos += keyword.Length;
|
||||
}
|
||||
else if (IsLuaBuiltin(line, pos))
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.DarkCyan;
|
||||
string builtin = GetLuaBuiltin(line, pos);
|
||||
Console.Write(builtin);
|
||||
pos += builtin.Length;
|
||||
}
|
||||
else if (IsLuaFunctionCall(line, pos))
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.DarkMagenta;
|
||||
string funcName = GetLuaFunctionName(line, pos);
|
||||
Console.Write(funcName);
|
||||
pos += funcName.Length;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Console.Write(line[pos]);
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pos < consoleWidth)
|
||||
{
|
||||
Console.Write(new string(' ', consoleWidth - pos));
|
||||
}
|
||||
|
||||
Console.ResetColor();
|
||||
}
|
||||
|
||||
private bool IsLuaNumber(string line, int pos)
|
||||
{
|
||||
if (pos >= line.Length) return false;
|
||||
|
||||
char c = line[pos];
|
||||
if (!char.IsDigit(c) && c != '.') return false;
|
||||
|
||||
if (c == '.')
|
||||
{
|
||||
if (pos + 1 >= line.Length) return false;
|
||||
return char.IsDigit(line[pos + 1]);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool IsLuaOperator(string line, int pos)
|
||||
{
|
||||
if (pos >= line.Length) return false;
|
||||
|
||||
char c = line[pos];
|
||||
return c == '+' || c == '-' || c == '*' || c == '/' || c == '^' ||
|
||||
c == '%' || c == '#' || c == '=' || c == '~' ||
|
||||
c == '<' || c == '>' || c == '&' || c == '|' ||
|
||||
c == '(' || c == ')' || c == '[' || c == ']' ||
|
||||
c == '{' || c == '}' || c == ',' || c == ';';
|
||||
}
|
||||
|
||||
private bool IsLuaKeyword(string line, int pos)
|
||||
{
|
||||
string[] keywords = {
|
||||
"function", "end", "if", "then", "else", "elseif", "while", "do",
|
||||
"for", "return", "local", "true", "false", "nil", "and", "or",
|
||||
"not", "break", "repeat", "until", "in", "goto", "self"
|
||||
};
|
||||
|
||||
foreach (string keyword in keywords)
|
||||
{
|
||||
if (pos + keyword.Length <= line.Length && line.Substring(pos, keyword.Length) == keyword)
|
||||
{
|
||||
char prevChar = pos > 0 ? line[pos - 1] : ' ';
|
||||
char nextChar = pos + keyword.Length < line.Length ? line[pos + keyword.Length] : ' ';
|
||||
|
||||
if (!char.IsLetterOrDigit(prevChar) && !char.IsLetterOrDigit(nextChar) && prevChar != '_' && nextChar != '_')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private string GetLuaKeyword(string line, int pos)
|
||||
{
|
||||
string[] keywords = {
|
||||
"function", "end", "if", "then", "else", "elseif", "while", "do",
|
||||
"for", "return", "local", "true", "false", "nil", "and", "or",
|
||||
"not", "break", "repeat", "until", "in", "goto", "self"
|
||||
};
|
||||
|
||||
foreach (string keyword in keywords)
|
||||
{
|
||||
if (pos + keyword.Length <= line.Length && line.Substring(pos, keyword.Length) == keyword)
|
||||
{
|
||||
char prevChar = pos > 0 ? line[pos - 1] : ' ';
|
||||
char nextChar = pos + keyword.Length < line.Length ? line[pos + keyword.Length] : ' ';
|
||||
|
||||
if (!char.IsLetterOrDigit(prevChar) && !char.IsLetterOrDigit(nextChar) && prevChar != '_' && nextChar != '_')
|
||||
{
|
||||
return keyword;
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private bool IsLuaBuiltin(string line, int pos)
|
||||
{
|
||||
string[] builtins = {
|
||||
"print", "type", "tonumber", "tostring", "pairs", "ipairs",
|
||||
"next", "select", "unpack", "assert", "error", "pcall",
|
||||
"xpcall", "load", "loadstring", "loadfile", "dofile",
|
||||
"require", "setmetatable", "getmetatable", "rawget", "rawset",
|
||||
"rawequal", "rawlen", "gcinfo", "collectgarbage", "newproxy"
|
||||
};
|
||||
|
||||
foreach (string builtin in builtins)
|
||||
{
|
||||
if (pos + builtin.Length <= line.Length && line.Substring(pos, builtin.Length) == builtin)
|
||||
{
|
||||
char prevChar = pos > 0 ? line[pos - 1] : ' ';
|
||||
char nextChar = pos + builtin.Length < line.Length ? line[pos + builtin.Length] : ' ';
|
||||
|
||||
if (!char.IsLetterOrDigit(prevChar) && !char.IsLetterOrDigit(nextChar) && prevChar != '_' && nextChar != '_')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private string GetLuaBuiltin(string line, int pos)
|
||||
{
|
||||
string[] builtins = {
|
||||
"print", "type", "tonumber", "tostring", "pairs", "ipairs",
|
||||
"next", "select", "unpack", "assert", "error", "pcall",
|
||||
"xpcall", "load", "loadstring", "loadfile", "dofile",
|
||||
"require", "setmetatable", "getmetatable", "rawget", "rawset",
|
||||
"rawequal", "rawlen", "gcinfo", "collectgarbage", "newproxy"
|
||||
};
|
||||
|
||||
foreach (string builtin in builtins)
|
||||
{
|
||||
if (pos + builtin.Length <= line.Length && line.Substring(pos, builtin.Length) == builtin)
|
||||
{
|
||||
char prevChar = pos > 0 ? line[pos - 1] : ' ';
|
||||
char nextChar = pos + builtin.Length < line.Length ? line[pos + builtin.Length] : ' ';
|
||||
|
||||
if (!char.IsLetterOrDigit(prevChar) && !char.IsLetterOrDigit(nextChar) && prevChar != '_' && nextChar != '_')
|
||||
{
|
||||
return builtin;
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private bool IsLuaFunctionCall(string line, int pos)
|
||||
{
|
||||
if (pos >= line.Length || !char.IsLetter(line[pos]) && line[pos] != '_') return false;
|
||||
|
||||
int endPos = pos;
|
||||
while (endPos < line.Length && (char.IsLetterOrDigit(line[endPos]) || line[endPos] == '_'))
|
||||
{
|
||||
endPos++;
|
||||
}
|
||||
|
||||
if (endPos < line.Length && line[endPos] == '(')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private string GetLuaFunctionName(string line, int pos)
|
||||
{
|
||||
int endPos = pos;
|
||||
while (endPos < line.Length && (char.IsLetterOrDigit(line[endPos]) || line[endPos] == '_'))
|
||||
{
|
||||
endPos++;
|
||||
}
|
||||
return line.Substring(pos, endPos - pos);
|
||||
}
|
||||
|
||||
// Insert a new line at the cursor.
|
||||
private void InsertLine()
|
||||
{
|
||||
string line = lines[currentLine];
|
||||
if (linePos == line.Length)
|
||||
|
||||
if (IsLuaFile() && settings.EnableSmartIndent)
|
||||
{
|
||||
lines.Insert(currentLine + 1, string.Empty);
|
||||
string currentIndent = GetLineIndent(line);
|
||||
|
||||
if (linePos == line.Length)
|
||||
{
|
||||
lines.Insert(currentLine + 1, currentIndent);
|
||||
}
|
||||
else
|
||||
{
|
||||
lines.Insert(currentLine + 1, currentIndent + line.Substring(linePos, line.Length - linePos));
|
||||
lines[currentLine] = line.Remove(linePos, line.Length - linePos);
|
||||
}
|
||||
|
||||
if (line.TrimEnd().EndsWith("then") || line.TrimEnd().EndsWith("do") || line.TrimEnd().EndsWith("else") || line.TrimEnd().EndsWith("elseif") || line.TrimEnd().EndsWith("repeat"))
|
||||
{
|
||||
lines[currentLine + 1] = lines[currentLine + 1] + " ";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lines.Insert(currentLine + 1, line.Substring(linePos, line.Length - linePos));
|
||||
lines[currentLine] = line.Remove(linePos, line.Length - linePos);
|
||||
if (linePos == line.Length)
|
||||
{
|
||||
lines.Insert(currentLine + 1, string.Empty);
|
||||
}
|
||||
else
|
||||
{
|
||||
lines.Insert(currentLine + 1, line.Substring(linePos, line.Length - linePos));
|
||||
lines[currentLine] = line.Remove(linePos, line.Length - linePos);
|
||||
}
|
||||
}
|
||||
|
||||
updatedLinesStart = currentLine;
|
||||
updatedLinesEnd = lines.Count - 1;
|
||||
|
||||
currentLine += 1;
|
||||
linePos = 0;
|
||||
linePos = lines[currentLine].Length;
|
||||
|
||||
modified = true;
|
||||
}
|
||||
|
||||
private string GetLineIndent(string line)
|
||||
{
|
||||
int indent = 0;
|
||||
foreach (char c in line)
|
||||
{
|
||||
if (c == ' ')
|
||||
{
|
||||
indent++;
|
||||
}
|
||||
else if (c == '\t')
|
||||
{
|
||||
indent += 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new string(' ', indent);
|
||||
}
|
||||
|
||||
// Insert text at the cursor.
|
||||
private void Insert(string text)
|
||||
{
|
||||
for (int i = 0; i < text.Length; i++)
|
||||
{
|
||||
lines[currentLine] = lines[currentLine].Insert(linePos, text[i].ToString());
|
||||
char c = text[i];
|
||||
|
||||
if (IsLuaFile())
|
||||
{
|
||||
c = HandleLuaAutoComplete(c);
|
||||
}
|
||||
|
||||
lines[currentLine] = lines[currentLine].Insert(linePos, c.ToString());
|
||||
linePos++;
|
||||
|
||||
updatedLinesStart = currentLine;
|
||||
@@ -147,6 +602,54 @@ namespace CMLeonOS
|
||||
modified = true;
|
||||
}
|
||||
|
||||
private char HandleLuaAutoComplete(char c)
|
||||
{
|
||||
string line = lines[currentLine];
|
||||
|
||||
if (settings.EnableAutoCompleteBrackets)
|
||||
{
|
||||
if (c == '(')
|
||||
{
|
||||
lines[currentLine] = lines[currentLine].Insert(linePos, ")");
|
||||
return '(';
|
||||
}
|
||||
else if (c == '[')
|
||||
{
|
||||
lines[currentLine] = lines[currentLine].Insert(linePos, "]");
|
||||
return '[';
|
||||
}
|
||||
else if (c == '{')
|
||||
{
|
||||
lines[currentLine] = lines[currentLine].Insert(linePos, "}");
|
||||
return '{';
|
||||
}
|
||||
}
|
||||
|
||||
if (settings.EnableAutoCompleteQuotes)
|
||||
{
|
||||
if (c == '"')
|
||||
{
|
||||
if (linePos > 0 && line[linePos - 1] == '\\')
|
||||
{
|
||||
return '"';
|
||||
}
|
||||
lines[currentLine] = lines[currentLine].Insert(linePos, "\"");
|
||||
return '"';
|
||||
}
|
||||
else if (c == '\'')
|
||||
{
|
||||
if (linePos > 0 && line[linePos - 1] == '\\')
|
||||
{
|
||||
return '\'';
|
||||
}
|
||||
lines[currentLine] = lines[currentLine].Insert(linePos, "'");
|
||||
return '\'';
|
||||
}
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
private void InsertTab()
|
||||
{
|
||||
Insert(" ");
|
||||
@@ -169,6 +672,17 @@ namespace CMLeonOS
|
||||
}
|
||||
else
|
||||
{
|
||||
if (IsLuaFile() && settings.EnableSmartDelete)
|
||||
{
|
||||
string line = lines[currentLine];
|
||||
char charToDelete = line[linePos - 1];
|
||||
|
||||
if (linePos < line.Length && IsMatchingPair(charToDelete, line[linePos]))
|
||||
{
|
||||
lines[currentLine] = lines[currentLine].Remove(linePos, 1);
|
||||
}
|
||||
}
|
||||
|
||||
lines[currentLine] = lines[currentLine].Remove(linePos - 1, 1);
|
||||
linePos--;
|
||||
|
||||
@@ -178,6 +692,15 @@ namespace CMLeonOS
|
||||
modified = true;
|
||||
}
|
||||
|
||||
private bool IsMatchingPair(char open, char close)
|
||||
{
|
||||
return (open == '(' && close == ')') ||
|
||||
(open == '[' && close == ']') ||
|
||||
(open == '{' && close == '}') ||
|
||||
(open == '"' && close == '"') ||
|
||||
(open == '\'' && close == '\'');
|
||||
}
|
||||
|
||||
// Move the cursor left.
|
||||
private void MoveLeft()
|
||||
{
|
||||
@@ -702,6 +1225,9 @@ namespace CMLeonOS
|
||||
}
|
||||
switch (key.Key)
|
||||
{
|
||||
case ConsoleKey.F2:
|
||||
ShowSettingsMenu();
|
||||
return true;
|
||||
case ConsoleKey.Tab:
|
||||
InsertTab();
|
||||
break;
|
||||
@@ -807,12 +1333,163 @@ namespace CMLeonOS
|
||||
RenderShortcuts(SHORTCUTS);
|
||||
}
|
||||
|
||||
private void ShowSettingsMenu()
|
||||
{
|
||||
Console.BackgroundColor = ConsoleColor.Blue;
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Console.Clear();
|
||||
|
||||
int consoleWidth = 80;
|
||||
int consoleHeight = 25;
|
||||
|
||||
string title = " Nano Settings";
|
||||
string[] options = new string[]
|
||||
{
|
||||
"1. Smart Indent",
|
||||
"2. Auto Complete Brackets",
|
||||
"3. Auto Complete Quotes",
|
||||
"4. Smart Delete",
|
||||
"5. Syntax Highlight",
|
||||
"6. Save and Exit"
|
||||
};
|
||||
|
||||
int maxOptionLength = 0;
|
||||
foreach (string option in options)
|
||||
{
|
||||
if (option.Length > maxOptionLength)
|
||||
{
|
||||
maxOptionLength = option.Length;
|
||||
}
|
||||
}
|
||||
|
||||
int menuWidth = maxOptionLength + 10;
|
||||
int menuHeight = options.Length + 4;
|
||||
int menuX = (consoleWidth - menuWidth) / 2;
|
||||
int menuY = (consoleHeight - menuHeight) / 2;
|
||||
|
||||
int titleX = menuX + (menuWidth - title.Length) / 2;
|
||||
Console.SetCursorPosition(titleX, menuY);
|
||||
Console.Write(title);
|
||||
|
||||
int borderLeft = menuX;
|
||||
int borderRight = menuX + menuWidth - 1;
|
||||
int borderTop = menuY;
|
||||
int borderBottom = menuY + menuHeight - 1;
|
||||
|
||||
for (int i = 0; i < menuWidth; i++)
|
||||
{
|
||||
Console.SetCursorPosition(borderLeft + i, borderTop);
|
||||
Console.Write("-");
|
||||
}
|
||||
|
||||
for (int i = 0; i < menuHeight; i++)
|
||||
{
|
||||
Console.SetCursorPosition(borderLeft, borderTop + 1 + i);
|
||||
Console.Write("|");
|
||||
Console.SetCursorPosition(borderRight, borderTop + 1 + i);
|
||||
Console.Write("|");
|
||||
}
|
||||
|
||||
for (int i = 0; i < menuWidth; i++)
|
||||
{
|
||||
Console.SetCursorPosition(borderLeft + i, borderBottom);
|
||||
Console.Write("-");
|
||||
}
|
||||
|
||||
for (int i = 0; i < options.Length; i++)
|
||||
{
|
||||
int optionY = borderTop + 2 + i;
|
||||
Console.SetCursorPosition(borderLeft + 2, optionY);
|
||||
Console.Write(options[i]);
|
||||
|
||||
string status = GetSettingStatus(i);
|
||||
int statusX = borderRight - status.Length - 2;
|
||||
Console.SetCursorPosition(statusX, optionY);
|
||||
Console.Write($"[{status}]");
|
||||
}
|
||||
|
||||
int promptY = borderBottom - 2;
|
||||
string prompt = "Use 1-6 to toggle, ESC to exit";
|
||||
int promptX = menuX + (menuWidth - prompt.Length) / 2;
|
||||
Console.SetCursorPosition(promptX, promptY);
|
||||
Console.Write(prompt);
|
||||
|
||||
while (true)
|
||||
{
|
||||
ConsoleKeyInfo key = Console.ReadKey(true);
|
||||
|
||||
if (key.Key == ConsoleKey.Escape)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if (key.KeyChar >= '1' && key.KeyChar <= '6')
|
||||
{
|
||||
int option = key.KeyChar - '1';
|
||||
ToggleSetting(option);
|
||||
ShowSettingsMenu();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Console.BackgroundColor = ConsoleColor.Black;
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Console.Clear();
|
||||
RenderUI();
|
||||
updatedLinesStart = 0;
|
||||
updatedLinesEnd = lines.Count - 1;
|
||||
}
|
||||
|
||||
private string GetSettingStatus(int option)
|
||||
{
|
||||
switch (option)
|
||||
{
|
||||
case 0:
|
||||
return settings.EnableSmartIndent ? "ON " : "OFF";
|
||||
case 1:
|
||||
return settings.EnableAutoCompleteBrackets ? "ON " : "OFF";
|
||||
case 2:
|
||||
return settings.EnableAutoCompleteQuotes ? "ON " : "OFF";
|
||||
case 3:
|
||||
return settings.EnableSmartDelete ? "ON " : "OFF";
|
||||
case 4:
|
||||
return settings.EnableSyntaxHighlight ? "ON " : "OFF";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleSetting(int option)
|
||||
{
|
||||
switch (option)
|
||||
{
|
||||
case 0:
|
||||
settings.EnableSmartIndent = !settings.EnableSmartIndent;
|
||||
break;
|
||||
case 1:
|
||||
settings.EnableAutoCompleteBrackets = !settings.EnableAutoCompleteBrackets;
|
||||
break;
|
||||
case 2:
|
||||
settings.EnableAutoCompleteQuotes = !settings.EnableAutoCompleteQuotes;
|
||||
break;
|
||||
case 3:
|
||||
settings.EnableSmartDelete = !settings.EnableSmartDelete;
|
||||
break;
|
||||
case 4:
|
||||
settings.EnableSyntaxHighlight = !settings.EnableSyntaxHighlight;
|
||||
break;
|
||||
case 5:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
Console.BackgroundColor = ConsoleColor.Black;
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Console.Clear();
|
||||
|
||||
settings.Load(@"0:\system\nano.dat");
|
||||
|
||||
RenderUI();
|
||||
while (!quit)
|
||||
{
|
||||
@@ -826,6 +1503,8 @@ namespace CMLeonOS
|
||||
HandleInput();
|
||||
UpdateScrolling();
|
||||
}
|
||||
|
||||
settings.Save(@"0:\system\nano.dat");
|
||||
|
||||
Console.BackgroundColor = ConsoleColor.Black;
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
|
||||
45
example.bran
45
example.bran
@@ -1,45 +0,0 @@
|
||||
# Branswe代码示例
|
||||
# 这个文件展示了Branswe编程语言的基本功能
|
||||
|
||||
# 示例1:简单的Hello World
|
||||
conshow hello
|
||||
var(text) hello = Hello, Branswe!
|
||||
|
||||
# 示例2:变量操作
|
||||
var() name = LeonOS
|
||||
var(text) greeting = Hello, name!
|
||||
conshow greeting
|
||||
|
||||
# 示例3:条件判断
|
||||
if hello == hello
|
||||
then
|
||||
conshow match
|
||||
else
|
||||
conshow no match
|
||||
end
|
||||
|
||||
# 示例4:循环
|
||||
loop 5
|
||||
conshow count: i
|
||||
var(text) count = i
|
||||
conshow count: count
|
||||
end
|
||||
|
||||
# 示例5:计算
|
||||
var(text) result = 10
|
||||
var(text) num1 = 5
|
||||
var(text) num2 = 3
|
||||
rstr result + num1 + num2
|
||||
conshow result
|
||||
|
||||
# 示例6:扬声器响声
|
||||
conbeep
|
||||
|
||||
# 示例7:睡眠
|
||||
sleep 1000
|
||||
|
||||
# 示例8:清屏
|
||||
concls
|
||||
|
||||
# 示例9:结束
|
||||
end
|
||||
@@ -4,6 +4,7 @@ namespace UniLua
|
||||
using System.Diagnostics;
|
||||
using System;
|
||||
using CMLeonOS;
|
||||
using CMLeonOS.UI;
|
||||
using Sys = Cosmos.System;
|
||||
using System.Threading;
|
||||
|
||||
@@ -38,10 +39,18 @@ namespace UniLua
|
||||
new NameFuncPair("base64decrypt", OS_Base64Decrypt),
|
||||
new NameFuncPair("timerstart", OS_TimerStart),
|
||||
new NameFuncPair("timerstop", OS_TimerStop),
|
||||
new NameFuncPair("osversion", OS_Osversion),
|
||||
new NameFuncPair("tui_drawbox", OS_TUIDrawBox),
|
||||
new NameFuncPair("tui_drawtext", OS_TUIDrawText),
|
||||
new NameFuncPair("tui_setcolor", OS_TUISetColor),
|
||||
new NameFuncPair("tui_setcursor", OS_TUISetCursor),
|
||||
new NameFuncPair("tui_clear", OS_TUIClear),
|
||||
new NameFuncPair("tui_drawline", OS_TUIDrawLine),
|
||||
#endif
|
||||
};
|
||||
|
||||
lua.L_NewLib( define );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -231,6 +240,125 @@ namespace UniLua
|
||||
_timerStartTime = null;
|
||||
return 1;
|
||||
}
|
||||
|
||||
private static int OS_Osversion(ILuaState lua)
|
||||
{
|
||||
string version = CMLeonOS.Version.FullVersion;
|
||||
lua.PushString(version);
|
||||
return 1;
|
||||
}
|
||||
|
||||
private static int OS_TUIDrawBox(ILuaState lua)
|
||||
{
|
||||
int x = (int)lua.L_CheckNumber(1);
|
||||
int y = (int)lua.L_CheckNumber(2);
|
||||
int width = (int)lua.L_CheckNumber(3);
|
||||
int height = (int)lua.L_CheckNumber(4);
|
||||
string title = lua.L_CheckString(5);
|
||||
string borderColor = lua.L_CheckString(6);
|
||||
string backgroundColor = lua.L_CheckString(7);
|
||||
|
||||
ConsoleColor borderColorEnum = ParseColor(borderColor);
|
||||
ConsoleColor backgroundColorEnum = ParseColor(backgroundColor);
|
||||
|
||||
var rect = new Rect(x, y, width, height);
|
||||
TUIHelper.SetColors(borderColorEnum, backgroundColorEnum);
|
||||
TUIHelper.DrawBox(rect, title, borderColorEnum);
|
||||
lua.PushBoolean(true);
|
||||
return 1;
|
||||
}
|
||||
|
||||
private static int OS_TUIDrawText(ILuaState lua)
|
||||
{
|
||||
int x = (int)lua.L_CheckNumber(1);
|
||||
int y = (int)lua.L_CheckNumber(2);
|
||||
string text = lua.L_CheckString(3);
|
||||
string foregroundColor = lua.L_CheckString(4);
|
||||
string backgroundColor = lua.L_CheckString(5);
|
||||
|
||||
ConsoleColor foregroundColorEnum = ParseColor(foregroundColor);
|
||||
ConsoleColor backgroundColorEnum = ParseColor(backgroundColor);
|
||||
|
||||
TUIHelper.SetColors(foregroundColorEnum, backgroundColorEnum);
|
||||
Console.SetCursorPosition(x, y);
|
||||
Console.Write(text);
|
||||
lua.PushBoolean(true);
|
||||
return 1;
|
||||
}
|
||||
|
||||
private static int OS_TUISetColor(ILuaState lua)
|
||||
{
|
||||
string foregroundColor = lua.L_CheckString(1);
|
||||
string backgroundColor = lua.L_CheckString(2);
|
||||
|
||||
ConsoleColor foregroundColorEnum = ParseColor(foregroundColor);
|
||||
ConsoleColor backgroundColorEnum = ParseColor(backgroundColor);
|
||||
|
||||
TUIHelper.SetColors(foregroundColorEnum, backgroundColorEnum);
|
||||
lua.PushBoolean(true);
|
||||
return 1;
|
||||
}
|
||||
|
||||
private static int OS_TUISetCursor(ILuaState lua)
|
||||
{
|
||||
int x = (int)lua.L_CheckNumber(1);
|
||||
int y = (int)lua.L_CheckNumber(2);
|
||||
|
||||
Console.SetCursorPosition(x, y);
|
||||
lua.PushBoolean(true);
|
||||
return 1;
|
||||
}
|
||||
|
||||
private static int OS_TUIClear(ILuaState lua)
|
||||
{
|
||||
Console.Clear();
|
||||
lua.PushBoolean(true);
|
||||
return 1;
|
||||
}
|
||||
|
||||
private static int OS_TUIDrawLine(ILuaState lua)
|
||||
{
|
||||
int x = (int)lua.L_CheckNumber(1);
|
||||
int y = (int)lua.L_CheckNumber(2);
|
||||
int length = (int)lua.L_CheckNumber(3);
|
||||
char character = lua.L_CheckString(4)[0];
|
||||
string color = lua.L_CheckString(5);
|
||||
|
||||
ConsoleColor colorEnum = ParseColor(color);
|
||||
|
||||
TUIHelper.SetColors(colorEnum, ConsoleColor.Black);
|
||||
Console.SetCursorPosition(x, y);
|
||||
for (int i = 0; i < length; i++)
|
||||
{
|
||||
Console.Write(character);
|
||||
}
|
||||
lua.PushBoolean(true);
|
||||
return 1;
|
||||
}
|
||||
|
||||
private static ConsoleColor ParseColor(string colorName)
|
||||
{
|
||||
switch (colorName.ToLower())
|
||||
{
|
||||
case "black": return ConsoleColor.Black;
|
||||
case "blue": return ConsoleColor.Blue;
|
||||
case "cyan": return ConsoleColor.Cyan;
|
||||
case "darkblue": return ConsoleColor.DarkBlue;
|
||||
case "darkcyan": return ConsoleColor.DarkCyan;
|
||||
case "darkgray": return ConsoleColor.DarkGray;
|
||||
case "darkgreen": return ConsoleColor.DarkGreen;
|
||||
case "darkmagenta": return ConsoleColor.DarkMagenta;
|
||||
case "darkred": return ConsoleColor.DarkRed;
|
||||
case "darkyellow": return ConsoleColor.DarkYellow;
|
||||
case "gray": return ConsoleColor.Gray;
|
||||
case "green": return ConsoleColor.Green;
|
||||
case "magenta": return ConsoleColor.Magenta;
|
||||
case "red": return ConsoleColor.Red;
|
||||
case "white": return ConsoleColor.White;
|
||||
case "yellow": return ConsoleColor.Yellow;
|
||||
default: return ConsoleColor.White;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ namespace CMLeonOS.shell
|
||||
case "calc":
|
||||
shell.Calculate(args);
|
||||
break;
|
||||
case "calcgui":
|
||||
shell.ShowCalculatorGUI();
|
||||
break;
|
||||
case "history":
|
||||
shell.ShowHistory();
|
||||
break;
|
||||
@@ -49,6 +52,12 @@ namespace CMLeonOS.shell
|
||||
case "nano":
|
||||
shell.NanoFile(args);
|
||||
break;
|
||||
case "matrix":
|
||||
shell.ShowMatrix();
|
||||
break;
|
||||
case "app":
|
||||
shell.ProcessApp(args);
|
||||
break;
|
||||
case "diff":
|
||||
shell.DiffFiles(args);
|
||||
break;
|
||||
@@ -157,12 +166,6 @@ namespace CMLeonOS.shell
|
||||
case "grep":
|
||||
shell.GrepFile(args);
|
||||
break;
|
||||
case "backup":
|
||||
shell.BackupSystem(args);
|
||||
break;
|
||||
case "restore":
|
||||
shell.RestoreSystem(args);
|
||||
break;
|
||||
case "ftp":
|
||||
shell.CreateFTP();
|
||||
break;
|
||||
@@ -190,9 +193,15 @@ namespace CMLeonOS.shell
|
||||
case "testgui":
|
||||
shell.ProcessTestGui();
|
||||
break;
|
||||
case "testtui":
|
||||
shell.ProcessTestTUI();
|
||||
break;
|
||||
case "labyrinth":
|
||||
shell.ProcessLabyrinth();
|
||||
break;
|
||||
case "snake":
|
||||
shell.PlaySnake();
|
||||
break;
|
||||
case "alias":
|
||||
shell.ProcessAlias(args);
|
||||
break;
|
||||
|
||||
@@ -14,8 +14,8 @@ namespace CMLeonOS.Commands.Editor
|
||||
|
||||
try
|
||||
{
|
||||
var editor = new CMLeonOS.Editor(fileName, fileSystem);
|
||||
editor.Run();
|
||||
var nano = new CMLeonOS.Nano(fileName, true, fileSystem);
|
||||
nano.Start();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CMLeonOS;
|
||||
|
||||
namespace CMLeonOS.Commands.Environment
|
||||
{
|
||||
@@ -11,7 +13,41 @@ namespace CMLeonOS.Commands.Environment
|
||||
|
||||
if (parts.Length == 0)
|
||||
{
|
||||
envManager.ListVariables();
|
||||
var commandInfos = new List<UsageGenerator.CommandInfo>
|
||||
{
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "list",
|
||||
Description = "List all environment variables",
|
||||
IsOptional = false
|
||||
},
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "see <varname>",
|
||||
Description = "View environment variable value",
|
||||
IsOptional = false
|
||||
},
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "add <varname> <value>",
|
||||
Description = "Add environment variable",
|
||||
IsOptional = false
|
||||
},
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "change <varname> <value>",
|
||||
Description = "Change environment variable",
|
||||
IsOptional = false
|
||||
},
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "delete <varname>",
|
||||
Description = "Delete environment variable",
|
||||
IsOptional = false
|
||||
}
|
||||
};
|
||||
|
||||
showError(UsageGenerator.GenerateUsage("env", commandInfos));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -39,7 +75,7 @@ namespace CMLeonOS.Commands.Environment
|
||||
else
|
||||
{
|
||||
showError("Error: Please specify variable name");
|
||||
showError("Usage: env see <varname>");
|
||||
showError(UsageGenerator.GenerateSimpleUsage("env", "see <varname>"));
|
||||
}
|
||||
break;
|
||||
case "add":
|
||||
@@ -60,7 +96,7 @@ namespace CMLeonOS.Commands.Environment
|
||||
else
|
||||
{
|
||||
showError("Error: Please specify variable name and value");
|
||||
showError("Usage: env add <varname> <value>");
|
||||
showError(UsageGenerator.GenerateSimpleUsage("env", "add <varname> <value>"));
|
||||
}
|
||||
break;
|
||||
case "change":
|
||||
@@ -81,7 +117,7 @@ namespace CMLeonOS.Commands.Environment
|
||||
else
|
||||
{
|
||||
showError("Error: Please specify variable name and value");
|
||||
showError("Usage: env change <varname> <value>");
|
||||
showError(UsageGenerator.GenerateSimpleUsage("env", "change <varname> <value>"));
|
||||
}
|
||||
break;
|
||||
case "delete":
|
||||
@@ -101,12 +137,46 @@ namespace CMLeonOS.Commands.Environment
|
||||
else
|
||||
{
|
||||
showError("Error: Please specify variable name");
|
||||
showError("Usage: env delete <varname>");
|
||||
showError(UsageGenerator.GenerateSimpleUsage("env", "delete <varname>"));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
var commandInfos = new List<UsageGenerator.CommandInfo>
|
||||
{
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "list",
|
||||
Description = "List all environment variables",
|
||||
IsOptional = false
|
||||
},
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "see <varname>",
|
||||
Description = "View environment variable value",
|
||||
IsOptional = false
|
||||
},
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "add <varname> <value>",
|
||||
Description = "Add environment variable",
|
||||
IsOptional = false
|
||||
},
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "change <varname> <value>",
|
||||
Description = "Change environment variable",
|
||||
IsOptional = false
|
||||
},
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "delete <varname>",
|
||||
Description = "Delete environment variable",
|
||||
IsOptional = false
|
||||
}
|
||||
};
|
||||
|
||||
showError("Error: Invalid env command");
|
||||
showError("Usage: env [list] | env see <varname> | env add <varname> <value> | env change <varname> <value> | env delete <varname>");
|
||||
showError(UsageGenerator.GenerateUsage("env", commandInfos));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CMLeonOS;
|
||||
|
||||
namespace CMLeonOS.Commands.FileSystem
|
||||
{
|
||||
@@ -8,7 +10,24 @@ namespace CMLeonOS.Commands.FileSystem
|
||||
{
|
||||
if (string.IsNullOrEmpty(args))
|
||||
{
|
||||
showError("Please specify a file name");
|
||||
var commandInfos = new List<UsageGenerator.CommandInfo>
|
||||
{
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "<file>",
|
||||
Description = "Delete file",
|
||||
IsOptional = false
|
||||
},
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "<file> -norisk",
|
||||
Description = "Delete file in sys folder without confirmation",
|
||||
IsOptional = false
|
||||
}
|
||||
};
|
||||
|
||||
showError(UsageGenerator.GenerateUsage("rm", commandInfos));
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -29,7 +48,7 @@ namespace CMLeonOS.Commands.FileSystem
|
||||
if (!hasNorisk)
|
||||
{
|
||||
showError("Cannot delete files in sys folder without -norisk parameter");
|
||||
showError("Usage: rm <file> -norisk");
|
||||
showError(UsageGenerator.GenerateSimpleUsage("rm", "<file> -norisk"));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -70,6 +70,12 @@ namespace CMLeonOS.Commands
|
||||
Description = "Simple calculator"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "calcgui",
|
||||
Parameters = "",
|
||||
Description = "TUI calculator"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "history",
|
||||
Parameters = "",
|
||||
@@ -94,6 +100,12 @@ namespace CMLeonOS.Commands
|
||||
Description = "Play maze escape game"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "snake",
|
||||
Parameters = "",
|
||||
Description = "Play snake game"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "edit",
|
||||
Parameters = "<file>",
|
||||
@@ -248,24 +260,24 @@ namespace CMLeonOS.Commands
|
||||
Description = "Show system uptime"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "matrix",
|
||||
Parameters = "",
|
||||
Description = "Show Matrix effect (The Matrix movie)"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "app",
|
||||
Parameters = "<command>",
|
||||
Description = "Application manager"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "branswe",
|
||||
Parameters = "<filename>",
|
||||
Description = "Execute Branswe code file"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "backup",
|
||||
Parameters = "<name>",
|
||||
Description = "Backup system files"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "restore",
|
||||
Parameters = "<name>",
|
||||
Description = "Restore system files"
|
||||
},
|
||||
new CommandInfo
|
||||
{
|
||||
Command = "grep",
|
||||
Parameters = "<pattern> <file>",
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CMLeonOS.Commands
|
||||
public static void ProcessAbout()
|
||||
{
|
||||
Console.WriteLine("CMLeonOS Project");
|
||||
Console.WriteLine("By LeonOS 2 Developement Team");
|
||||
Console.WriteLine("By LeonOS 2 Developer Team");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,24 @@
|
||||
using System;
|
||||
using IL2CPU.API.Attribs;
|
||||
|
||||
namespace CMLeonOS.Commands
|
||||
{
|
||||
public static class VersionCommand
|
||||
{
|
||||
[ManifestResourceStream(ResourceName = "CMLeonOS.BuildTime.txt")]
|
||||
private static byte[] buildTimeResource;
|
||||
|
||||
public static void ProcessVersion()
|
||||
{
|
||||
Console.WriteLine(Version.DisplayVersion);
|
||||
string buildTime = global::System.Text.Encoding.UTF8.GetString(buildTimeResource);
|
||||
Console.WriteLine(Version.DisplayVersionWithGit);
|
||||
Console.WriteLine($"Major: {Version.Major}");
|
||||
Console.WriteLine($"Minor: {Version.Minor}");
|
||||
Console.WriteLine($"Patch: {Version.Patch}");
|
||||
Console.WriteLine($"Type: {Version.VersionType}");
|
||||
Console.WriteLine($"Full Version: {Version.FullVersion}");
|
||||
Console.WriteLine($"Git Commit: {Version.GitCommit}");
|
||||
Console.WriteLine($"Build Time: {buildTime}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using CMLeonOS;
|
||||
|
||||
namespace CMLeonOS.Commands.Script
|
||||
{
|
||||
@@ -9,8 +11,17 @@ namespace CMLeonOS.Commands.Script
|
||||
{
|
||||
if (string.IsNullOrEmpty(args))
|
||||
{
|
||||
showError("Error: Please specify file name");
|
||||
showError("Usage: branswe <filename>");
|
||||
var commandInfos = new List<UsageGenerator.CommandInfo>
|
||||
{
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "<filename>",
|
||||
Description = "Execute Branswe file",
|
||||
IsOptional = false
|
||||
}
|
||||
};
|
||||
|
||||
showError(UsageGenerator.GenerateUsage("branswe", commandInfos));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using CMLeonOS;
|
||||
|
||||
namespace CMLeonOS.Commands.Script
|
||||
{
|
||||
@@ -9,7 +11,17 @@ namespace CMLeonOS.Commands.Script
|
||||
{
|
||||
if (string.IsNullOrEmpty(args))
|
||||
{
|
||||
showError("Usage: com <filename.cm>");
|
||||
var commandInfos = new List<UsageGenerator.CommandInfo>
|
||||
{
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "<filename.cm>",
|
||||
Description = "Execute command file",
|
||||
IsOptional = false
|
||||
}
|
||||
};
|
||||
|
||||
showError(UsageGenerator.GenerateUsage("com", commandInfos));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UniLua;
|
||||
using CMLeonOS;
|
||||
|
||||
namespace CMLeonOS.Commands.Script
|
||||
{
|
||||
@@ -12,8 +14,23 @@ namespace CMLeonOS.Commands.Script
|
||||
|
||||
if (parts.Length == 0)
|
||||
{
|
||||
showError("Error: Please specify Lua script file or use --shell for interactive mode");
|
||||
showError("Usage: lua <file> or lua --shell");
|
||||
var commandInfos = new List<UsageGenerator.CommandInfo>
|
||||
{
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "<file>",
|
||||
Description = "Execute Lua script file",
|
||||
IsOptional = false
|
||||
},
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "--shell",
|
||||
Description = "Enter Lua interactive shell",
|
||||
IsOptional = false
|
||||
}
|
||||
};
|
||||
|
||||
showError(UsageGenerator.GenerateUsage("lua", commandInfos));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
684
shell/Commands/TestTUICommand.cs
Normal file
684
shell/Commands/TestTUICommand.cs
Normal file
@@ -0,0 +1,684 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using CMLeonOS.UI;
|
||||
|
||||
namespace CMLeonOS.Commands
|
||||
{
|
||||
public static class TestTUICommand
|
||||
{
|
||||
public static void RunTestTUI()
|
||||
{
|
||||
global::System.Console.Clear();
|
||||
|
||||
while (true)
|
||||
{
|
||||
ShowMainMenu();
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowMainMenu()
|
||||
{
|
||||
global::System.Console.Clear();
|
||||
|
||||
var menu = new Menu(new Rect(5, 5, 70, 15));
|
||||
menu.Items.Add(new MenuItem("Button Demo", () => ShowButtonDemo()));
|
||||
menu.Items.Add(new MenuItem("Input Box Demo", () => ShowInputBoxDemo()));
|
||||
menu.Items.Add(new MenuItem("Dialog Demo", () => ShowDialogDemo()));
|
||||
menu.Items.Add(new MenuItem("Progress Bar Demo", () => ShowProgressBarDemo()));
|
||||
menu.Items.Add(new MenuItem("Tab Control Demo", () => ShowTabControlDemo()));
|
||||
menu.Items.Add(new MenuItem("Menu Demo", () => ShowMenuDemo()));
|
||||
menu.Items.Add(new MenuItem("ListBox Demo", () => ShowListBoxDemo()));
|
||||
menu.Items.Add(new MenuItem("CheckBox Demo", () => ShowCheckBoxDemo()));
|
||||
menu.Items.Add(new MenuItem("RadioButton Demo", () => ShowRadioButtonDemo()));
|
||||
menu.Items.Add(new MenuItem("TreeView Demo", () => ShowTreeViewDemo()));
|
||||
menu.Items.Add(new MenuItem("ScrollBar Demo", () => ShowScrollBarDemo()));
|
||||
menu.Items.Add(new MenuItem("Exit", () => global::System.Environment.Exit(0)));
|
||||
|
||||
menu.Render();
|
||||
|
||||
bool menuRunning = true;
|
||||
while (menuRunning)
|
||||
{
|
||||
var key = global::System.Console.ReadKey(true);
|
||||
if (menu.HandleKey(key))
|
||||
{
|
||||
if (key.Key == global::System.ConsoleKey.Enter)
|
||||
{
|
||||
menuRunning = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
menu.Render();
|
||||
global::System.Threading.Thread.Sleep(100);
|
||||
}
|
||||
}
|
||||
else if (key.Key == global::System.ConsoleKey.Escape)
|
||||
{
|
||||
menuRunning = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowButtonDemo()
|
||||
{
|
||||
global::System.Console.Clear();
|
||||
|
||||
var label = new Label(new Point(10, 13), "Button Component Examples:");
|
||||
label.Render();
|
||||
|
||||
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
|
||||
statusBar.Items.Add(new StatusBarItem("Press ENTER to click, ESC to return"));
|
||||
statusBar.Render();
|
||||
|
||||
var button1 = new Button(new Rect(10, 8, 20, 3), "Click Me!", global::System.ConsoleColor.Cyan, global::System.ConsoleColor.DarkBlue, global::System.ConsoleColor.White);
|
||||
var button2 = new Button(new Rect(35, 8, 20, 3), "Disabled", global::System.ConsoleColor.Gray, global::System.ConsoleColor.Black, global::System.ConsoleColor.DarkGray);
|
||||
button2.IsEnabled = false;
|
||||
var button3 = new Button(new Rect(60, 8, 20, 3), "Hover Me", global::System.ConsoleColor.Yellow, global::System.ConsoleColor.DarkRed, global::System.ConsoleColor.White);
|
||||
|
||||
button1.Render();
|
||||
button2.Render();
|
||||
button3.Render();
|
||||
|
||||
int focusedButton = 0;
|
||||
button1.IsFocused = true;
|
||||
|
||||
bool demoRunning = true;
|
||||
while (demoRunning)
|
||||
{
|
||||
var key = global::System.Console.ReadKey(true);
|
||||
|
||||
if (key.Key == global::System.ConsoleKey.Escape)
|
||||
{
|
||||
demoRunning = false;
|
||||
}
|
||||
else if (key.Key == global::System.ConsoleKey.Enter)
|
||||
{
|
||||
if (focusedButton == 0 && button1.IsEnabled)
|
||||
{
|
||||
global::System.Console.SetCursorPosition(10, 14);
|
||||
global::System.Console.Write("Clicked!");
|
||||
global::System.Threading.Thread.Sleep(1000);
|
||||
}
|
||||
}
|
||||
else if (key.Key == global::System.ConsoleKey.LeftArrow)
|
||||
{
|
||||
button1.IsFocused = false;
|
||||
button3.IsFocused = false;
|
||||
focusedButton = (focusedButton - 1 + 3) % 3;
|
||||
|
||||
if (focusedButton == 0 && button1.IsEnabled) button1.IsFocused = true;
|
||||
if (focusedButton == 1 && button2.IsEnabled) button2.IsFocused = true;
|
||||
if (focusedButton == 2 && button3.IsEnabled) button3.IsFocused = true;
|
||||
}
|
||||
else if (key.Key == global::System.ConsoleKey.RightArrow)
|
||||
{
|
||||
button1.IsFocused = false;
|
||||
button3.IsFocused = false;
|
||||
focusedButton = (focusedButton + 1) % 3;
|
||||
|
||||
if (focusedButton == 0 && button1.IsEnabled) button1.IsFocused = true;
|
||||
if (focusedButton == 1 && button2.IsEnabled) button2.IsFocused = true;
|
||||
if (focusedButton == 2 && button3.IsEnabled) button3.IsFocused = true;
|
||||
}
|
||||
|
||||
button1.Render();
|
||||
button2.Render();
|
||||
button3.Render();
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowInputBoxDemo()
|
||||
{
|
||||
global::System.Console.Clear();
|
||||
|
||||
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
|
||||
statusBar.Items.Add(new StatusBarItem("Press ENTER to submit, ESC to return"));
|
||||
statusBar.Render();
|
||||
|
||||
var inputBox = new InputBox(new Rect(20, 8, 40, 3), "Enter your name:", "John Doe", 20, false, global::System.ConsoleColor.White, global::System.ConsoleColor.Black, global::System.ConsoleColor.White);
|
||||
inputBox.MaxLength = 20;
|
||||
inputBox.IsFocused = true;
|
||||
|
||||
var button = new Button(new Rect(65, 8, 15, 3), "Submit");
|
||||
button.OnClick = () =>
|
||||
{
|
||||
global::System.Console.SetCursorPosition(20, 12);
|
||||
global::System.Console.Write($"Submitted: {inputBox.Value}");
|
||||
global::System.Threading.Thread.Sleep(2000);
|
||||
};
|
||||
|
||||
inputBox.Render();
|
||||
button.Render();
|
||||
|
||||
bool demoRunning = true;
|
||||
while (demoRunning)
|
||||
{
|
||||
var key = global::System.Console.ReadKey(true);
|
||||
|
||||
if (key.Key == global::System.ConsoleKey.Escape)
|
||||
{
|
||||
demoRunning = false;
|
||||
}
|
||||
else if (inputBox.HandleKey(key))
|
||||
{
|
||||
inputBox.Render();
|
||||
}
|
||||
else if (button.HandleKey(key))
|
||||
{
|
||||
button.Render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowDialogDemo()
|
||||
{
|
||||
global::System.Console.Clear();
|
||||
|
||||
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
|
||||
statusBar.Items.Add(new StatusBarItem("Use LEFT/RIGHT to select, ENTER to choose"));
|
||||
statusBar.Render();
|
||||
|
||||
var dialog = new Dialog(new Rect(15, 5, 50, 7), "Confirm Action", "Are you sure you want to proceed?");
|
||||
|
||||
dialog.Buttons.Add(new Button(new Rect(17, 14, 12, 3), "Yes", global::System.ConsoleColor.White, global::System.ConsoleColor.DarkGreen, global::System.ConsoleColor.White));
|
||||
dialog.Buttons[0].OnClick = () =>
|
||||
{
|
||||
global::System.Console.SetCursorPosition(15, 13);
|
||||
global::System.Console.Write("Confirmed!");
|
||||
global::System.Threading.Thread.Sleep(1500);
|
||||
};
|
||||
|
||||
dialog.Buttons.Add(new Button(new Rect(31, 14, 12, 3), "No", global::System.ConsoleColor.White, global::System.ConsoleColor.DarkRed, global::System.ConsoleColor.White));
|
||||
dialog.Buttons[1].OnClick = () =>
|
||||
{
|
||||
global::System.Console.SetCursorPosition(31, 13);
|
||||
global::System.Console.Write("Cancelled!");
|
||||
global::System.Threading.Thread.Sleep(1500);
|
||||
};
|
||||
|
||||
dialog.Render();
|
||||
|
||||
bool demoRunning = true;
|
||||
while (demoRunning)
|
||||
{
|
||||
var key = global::System.Console.ReadKey(true);
|
||||
|
||||
if (key.Key == global::System.ConsoleKey.Escape)
|
||||
{
|
||||
demoRunning = false;
|
||||
}
|
||||
else if (dialog.HandleKey(key))
|
||||
{
|
||||
dialog.Render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowProgressBarDemo()
|
||||
{
|
||||
global::System.Console.Clear();
|
||||
|
||||
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
|
||||
statusBar.Items.Add(new StatusBarItem("Press ENTER to start, ESC to return"));
|
||||
statusBar.Render();
|
||||
|
||||
var progressBar = new ProgressBar(new Point(15, 10), 50, 100);
|
||||
progressBar.Value = 0;
|
||||
|
||||
var button = new Button(new Rect(35, 13, 15, 3), "Start");
|
||||
button.OnClick = () =>
|
||||
{
|
||||
for (int i = 0; i <= 100; i++)
|
||||
{
|
||||
progressBar.SetValue(i);
|
||||
progressBar.Render();
|
||||
global::System.Threading.Thread.Sleep(30);
|
||||
}
|
||||
};
|
||||
|
||||
progressBar.Render();
|
||||
button.Render();
|
||||
|
||||
bool demoRunning = true;
|
||||
while (demoRunning)
|
||||
{
|
||||
var key = global::System.Console.ReadKey(true);
|
||||
|
||||
if (key.Key == global::System.ConsoleKey.Escape)
|
||||
{
|
||||
demoRunning = false;
|
||||
}
|
||||
else if (button.HandleKey(key))
|
||||
{
|
||||
button.Render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowTabControlDemo()
|
||||
{
|
||||
global::System.Console.Clear();
|
||||
|
||||
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
|
||||
statusBar.Items.Add(new StatusBarItem("Use LEFT/RIGHT to switch tabs, ESC to return"));
|
||||
statusBar.Render();
|
||||
|
||||
var tabControl = new TabControl(new Rect(5, 5, 70, 15));
|
||||
|
||||
tabControl.Pages.Add(new TabPage(new Rect(5, 8, 70, 11), "Tab 1", () =>
|
||||
{
|
||||
TUIHelper.SetColors(global::System.ConsoleColor.Cyan, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(10, 10);
|
||||
global::System.Console.Write("Tab 1 Content");
|
||||
TUIHelper.ResetColors();
|
||||
}));
|
||||
|
||||
tabControl.Pages.Add(new TabPage(new Rect(5, 8, 70, 11), "Tab 2", () =>
|
||||
{
|
||||
TUIHelper.SetColors(global::System.ConsoleColor.Green, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(10, 10);
|
||||
global::System.Console.Write("Tab 2 Content");
|
||||
TUIHelper.ResetColors();
|
||||
}));
|
||||
|
||||
tabControl.Pages.Add(new TabPage(new Rect(5, 8, 70, 11), "Tab 3", () =>
|
||||
{
|
||||
TUIHelper.SetColors(global::System.ConsoleColor.Magenta, global::System.ConsoleColor.Black);
|
||||
global::System.Console.SetCursorPosition(10, 10);
|
||||
global::System.Console.Write("Tab 3 Content");
|
||||
TUIHelper.ResetColors();
|
||||
}));
|
||||
|
||||
tabControl.Render();
|
||||
|
||||
bool demoRunning = true;
|
||||
while (demoRunning)
|
||||
{
|
||||
var key = global::System.Console.ReadKey(true);
|
||||
|
||||
if (key.Key == global::System.ConsoleKey.Escape)
|
||||
{
|
||||
demoRunning = false;
|
||||
}
|
||||
else if (tabControl.HandleKey(key))
|
||||
{
|
||||
tabControl.Render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowMenuDemo()
|
||||
{
|
||||
global::System.Console.Clear();
|
||||
|
||||
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
|
||||
statusBar.Items.Add(new StatusBarItem("Use UP/DOWN to navigate, ENTER to select, ESC to return"));
|
||||
statusBar.Render();
|
||||
|
||||
var menu = new Menu(new Rect(15, 5, 50, 15));
|
||||
menu.Items.Add(new MenuItem("Option 1: Basic functionality", () =>
|
||||
{
|
||||
global::System.Console.SetCursorPosition(15, 21);
|
||||
global::System.Console.Write("Selected: Option 1");
|
||||
global::System.Threading.Thread.Sleep(1500);
|
||||
}));
|
||||
menu.Items.Add(new MenuItem("Option 2: Advanced features", () =>
|
||||
{
|
||||
global::System.Console.SetCursorPosition(15, 21);
|
||||
global::System.Console.Write("Selected: Option 2");
|
||||
global::System.Threading.Thread.Sleep(1500);
|
||||
}));
|
||||
menu.Items.Add(new MenuItem("Option 3: Settings", () =>
|
||||
{
|
||||
global::System.Console.SetCursorPosition(15, 21);
|
||||
global::System.Console.Write("Selected: Option 3");
|
||||
global::System.Threading.Thread.Sleep(1500);
|
||||
}));
|
||||
menu.Items.Add(new MenuItem("Option 4: Help", () =>
|
||||
{
|
||||
global::System.Console.SetCursorPosition(15, 21);
|
||||
global::System.Console.Write("Selected: Option 4");
|
||||
global::System.Threading.Thread.Sleep(1500);
|
||||
}));
|
||||
menu.Items.Add(new MenuItem("Option 5: About", () =>
|
||||
{
|
||||
global::System.Console.SetCursorPosition(15, 21);
|
||||
global::System.Console.Write("Selected: Option 5");
|
||||
global::System.Threading.Thread.Sleep(1500);
|
||||
}));
|
||||
menu.Items.Add(new MenuItem("Option 6: Exit", () =>
|
||||
{
|
||||
global::System.Console.SetCursorPosition(15, 21);
|
||||
global::System.Console.Write("Selected: Option 6");
|
||||
global::System.Threading.Thread.Sleep(1500);
|
||||
}));
|
||||
|
||||
menu.Render();
|
||||
|
||||
bool demoRunning = true;
|
||||
while (demoRunning)
|
||||
{
|
||||
var key = global::System.Console.ReadKey(true);
|
||||
|
||||
if (key.Key == global::System.ConsoleKey.Escape)
|
||||
{
|
||||
demoRunning = false;
|
||||
}
|
||||
else if (menu.HandleKey(key))
|
||||
{
|
||||
menu.Render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowListBoxDemo()
|
||||
{
|
||||
global::System.Console.Clear();
|
||||
|
||||
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
|
||||
statusBar.Items.Add(new StatusBarItem("Use UP/DOWN to navigate, SPACE to select, ESC to return"));
|
||||
statusBar.Render();
|
||||
|
||||
var listBox = new ListBox(new Rect(10, 5, 60, 15));
|
||||
listBox.Items.Add("Item 1: Basic functionality");
|
||||
listBox.Items.Add("Item 2: Advanced features");
|
||||
listBox.Items.Add("Item 3: Settings");
|
||||
listBox.Items.Add("Item 4: Help");
|
||||
listBox.Items.Add("Item 5: About");
|
||||
listBox.Items.Add("Item 6: Documentation");
|
||||
listBox.Items.Add("Item 7: Configuration");
|
||||
listBox.Items.Add("Item 8: System info");
|
||||
listBox.Items.Add("Item 9: Network settings");
|
||||
listBox.Items.Add("Item 10: User management");
|
||||
listBox.MultiSelect = true;
|
||||
|
||||
listBox.Render();
|
||||
|
||||
bool demoRunning = true;
|
||||
while (demoRunning)
|
||||
{
|
||||
var key = global::System.Console.ReadKey(true);
|
||||
|
||||
if (key.Key == global::System.ConsoleKey.Escape)
|
||||
{
|
||||
demoRunning = false;
|
||||
}
|
||||
else if (listBox.HandleKey(key))
|
||||
{
|
||||
listBox.Render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowCheckBoxDemo()
|
||||
{
|
||||
global::System.Console.Clear();
|
||||
|
||||
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
|
||||
statusBar.Items.Add(new StatusBarItem("Use UP/DOWN to navigate, SPACE to toggle, ESC to return"));
|
||||
statusBar.Render();
|
||||
|
||||
var checkBox1 = new CheckBox(new Point(10, 8), "Enable feature 1");
|
||||
checkBox1.IsChecked = true;
|
||||
checkBox1.IsFocused = true;
|
||||
var checkBox2 = new CheckBox(new Point(10, 10), "Enable feature 2");
|
||||
checkBox2.IsChecked = false;
|
||||
var checkBox3 = new CheckBox(new Point(10, 12), "Enable feature 3");
|
||||
checkBox3.IsChecked = false;
|
||||
var checkBox4 = new CheckBox(new Point(10, 14), "Enable feature 4");
|
||||
checkBox4.IsChecked = false;
|
||||
|
||||
checkBox1.Render();
|
||||
checkBox2.Render();
|
||||
checkBox3.Render();
|
||||
checkBox4.Render();
|
||||
|
||||
int focusedCheckBox = 0;
|
||||
|
||||
bool demoRunning = true;
|
||||
while (demoRunning)
|
||||
{
|
||||
var key = global::System.Console.ReadKey(true);
|
||||
|
||||
if (key.Key == global::System.ConsoleKey.Escape)
|
||||
{
|
||||
demoRunning = false;
|
||||
}
|
||||
else if (key.Key == global::System.ConsoleKey.UpArrow)
|
||||
{
|
||||
checkBox1.IsFocused = false;
|
||||
checkBox2.IsFocused = false;
|
||||
checkBox3.IsFocused = false;
|
||||
checkBox4.IsFocused = false;
|
||||
focusedCheckBox = (focusedCheckBox - 1 + 4) % 4;
|
||||
|
||||
if (focusedCheckBox == 0) checkBox1.IsFocused = true;
|
||||
if (focusedCheckBox == 1) checkBox2.IsFocused = true;
|
||||
if (focusedCheckBox == 2) checkBox3.IsFocused = true;
|
||||
if (focusedCheckBox == 3) checkBox4.IsFocused = true;
|
||||
}
|
||||
else if (key.Key == global::System.ConsoleKey.DownArrow)
|
||||
{
|
||||
checkBox1.IsFocused = false;
|
||||
checkBox2.IsFocused = false;
|
||||
checkBox3.IsFocused = false;
|
||||
checkBox4.IsFocused = false;
|
||||
focusedCheckBox = (focusedCheckBox + 1) % 4;
|
||||
|
||||
if (focusedCheckBox == 0) checkBox1.IsFocused = true;
|
||||
if (focusedCheckBox == 1) checkBox2.IsFocused = true;
|
||||
if (focusedCheckBox == 2) checkBox3.IsFocused = true;
|
||||
if (focusedCheckBox == 3) checkBox4.IsFocused = true;
|
||||
}
|
||||
else if (key.Key == global::System.ConsoleKey.Enter || key.Key == global::System.ConsoleKey.Spacebar)
|
||||
{
|
||||
if (focusedCheckBox == 0) checkBox1.IsChecked = !checkBox1.IsChecked;
|
||||
if (focusedCheckBox == 1) checkBox2.IsChecked = !checkBox2.IsChecked;
|
||||
if (focusedCheckBox == 2) checkBox3.IsChecked = !checkBox3.IsChecked;
|
||||
if (focusedCheckBox == 3) checkBox4.IsChecked = !checkBox4.IsChecked;
|
||||
}
|
||||
|
||||
checkBox1.Render();
|
||||
checkBox2.Render();
|
||||
checkBox3.Render();
|
||||
checkBox4.Render();
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowRadioButtonDemo()
|
||||
{
|
||||
global::System.Console.Clear();
|
||||
|
||||
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
|
||||
statusBar.Items.Add(new StatusBarItem("Use UP/DOWN to navigate, SPACE to select, ESC to return"));
|
||||
statusBar.Render();
|
||||
|
||||
var radioButton1 = new RadioButton(new Point(10, 8), "Option 1");
|
||||
radioButton1.IsChecked = true;
|
||||
radioButton1.IsFocused = true;
|
||||
radioButton1.GroupName = "group1";
|
||||
var radioButton2 = new RadioButton(new Point(10, 10), "Option 2");
|
||||
radioButton2.IsChecked = false;
|
||||
radioButton2.GroupName = "group1";
|
||||
var radioButton3 = new RadioButton(new Point(10, 12), "Option 3");
|
||||
radioButton3.IsChecked = false;
|
||||
radioButton3.GroupName = "group1";
|
||||
var radioButton4 = new RadioButton(new Point(10, 14), "Option 4");
|
||||
radioButton4.IsChecked = false;
|
||||
radioButton4.GroupName = "group1";
|
||||
|
||||
radioButton1.Render();
|
||||
radioButton2.Render();
|
||||
radioButton3.Render();
|
||||
radioButton4.Render();
|
||||
|
||||
int focusedRadioButton = 0;
|
||||
|
||||
bool demoRunning = true;
|
||||
while (demoRunning)
|
||||
{
|
||||
var key = global::System.Console.ReadKey(true);
|
||||
|
||||
if (key.Key == global::System.ConsoleKey.Escape)
|
||||
{
|
||||
demoRunning = false;
|
||||
}
|
||||
else if (key.Key == global::System.ConsoleKey.UpArrow)
|
||||
{
|
||||
radioButton1.IsFocused = false;
|
||||
radioButton2.IsFocused = false;
|
||||
radioButton3.IsFocused = false;
|
||||
radioButton4.IsFocused = false;
|
||||
focusedRadioButton = (focusedRadioButton - 1 + 4) % 4;
|
||||
|
||||
if (focusedRadioButton == 0) radioButton1.IsFocused = true;
|
||||
if (focusedRadioButton == 1) radioButton2.IsFocused = true;
|
||||
if (focusedRadioButton == 2) radioButton3.IsFocused = true;
|
||||
if (focusedRadioButton == 3) radioButton4.IsFocused = true;
|
||||
}
|
||||
else if (key.Key == global::System.ConsoleKey.DownArrow)
|
||||
{
|
||||
radioButton1.IsFocused = false;
|
||||
radioButton2.IsFocused = false;
|
||||
radioButton3.IsFocused = false;
|
||||
radioButton4.IsFocused = false;
|
||||
focusedRadioButton = (focusedRadioButton + 1) % 4;
|
||||
|
||||
if (focusedRadioButton == 0) radioButton1.IsFocused = true;
|
||||
if (focusedRadioButton == 1) radioButton2.IsFocused = true;
|
||||
if (focusedRadioButton == 2) radioButton3.IsFocused = true;
|
||||
if (focusedRadioButton == 3) radioButton4.IsFocused = true;
|
||||
}
|
||||
else if (key.Key == global::System.ConsoleKey.Enter || key.Key == global::System.ConsoleKey.Spacebar)
|
||||
{
|
||||
if (focusedRadioButton == 0) radioButton1.IsChecked = true;
|
||||
if (focusedRadioButton == 1) radioButton2.IsChecked = true;
|
||||
if (focusedRadioButton == 2) radioButton3.IsChecked = true;
|
||||
if (focusedRadioButton == 3) radioButton4.IsChecked = true;
|
||||
}
|
||||
|
||||
radioButton1.Render();
|
||||
radioButton2.Render();
|
||||
radioButton3.Render();
|
||||
radioButton4.Render();
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowTreeViewDemo()
|
||||
{
|
||||
global::System.Console.Clear();
|
||||
|
||||
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
|
||||
statusBar.Items.Add(new StatusBarItem("Use UP/DOWN to navigate, ENTER/SPACE to expand/collapse, ESC to return"));
|
||||
statusBar.Render();
|
||||
|
||||
var treeView = new TreeView(new Rect(5, 5, 70, 15));
|
||||
treeView.Root = new TreeViewNode { Text = "Root" };
|
||||
|
||||
var child1 = new TreeViewNode { Text = "Folder 1", Level = 1, Parent = treeView.Root };
|
||||
var child2 = new TreeViewNode { Text = "Folder 2", Level = 1, Parent = treeView.Root };
|
||||
var child3 = new TreeViewNode { Text = "File 1", Level = 2, Parent = child1 };
|
||||
var child4 = new TreeViewNode { Text = "File 2", Level = 2, Parent = child1 };
|
||||
var child5 = new TreeViewNode { Text = "File 3", Level = 2, Parent = child2 };
|
||||
|
||||
child1.Children.Add(child3);
|
||||
child1.Children.Add(child4);
|
||||
child2.Children.Add(child5);
|
||||
|
||||
treeView.Root.Children.Add(child1);
|
||||
treeView.Root.Children.Add(child2);
|
||||
|
||||
treeView.Render();
|
||||
|
||||
bool demoRunning = true;
|
||||
while (demoRunning)
|
||||
{
|
||||
var key = global::System.Console.ReadKey(true);
|
||||
|
||||
if (key.Key == global::System.ConsoleKey.Escape)
|
||||
{
|
||||
demoRunning = false;
|
||||
}
|
||||
else if (treeView.HandleKey(key))
|
||||
{
|
||||
treeView.Render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowScrollBarDemo()
|
||||
{
|
||||
global::System.Console.Clear();
|
||||
|
||||
var statusBar = new StatusBar(new Rect(0, 24, 80, 1));
|
||||
statusBar.Items.Add(new StatusBarItem("Use UP/DOWN or LEFT/RIGHT to adjust, ESC to return"));
|
||||
statusBar.Render();
|
||||
|
||||
var scrollBar1 = new ScrollBar(new Point(15, 10), 10);
|
||||
scrollBar1.MaxValue = 100;
|
||||
scrollBar1.Value = 50;
|
||||
scrollBar1.IsVertical = true;
|
||||
|
||||
var scrollBar2 = new ScrollBar(new Point(40, 10), 30);
|
||||
scrollBar2.MaxValue = 100;
|
||||
scrollBar2.Value = 30;
|
||||
scrollBar2.IsVertical = false;
|
||||
|
||||
var scrollBar3 = new ScrollBar(new Point(15, 15), 10);
|
||||
scrollBar3.MaxValue = 50;
|
||||
scrollBar3.Value = 25;
|
||||
scrollBar3.IsVertical = true;
|
||||
|
||||
var scrollBar4 = new ScrollBar(new Point(40, 15), 30);
|
||||
scrollBar4.MaxValue = 50;
|
||||
scrollBar4.Value = 15;
|
||||
scrollBar4.IsVertical = false;
|
||||
|
||||
var label1 = new Label(new Point(15, 8), "Vertical ScrollBar:");
|
||||
var label2 = new Label(new Point(40, 8), "Horizontal ScrollBar:");
|
||||
var label3 = new Label(new Point(15, 13), "Small Vertical:");
|
||||
var label4 = new Label(new Point(40, 13), "Small Horizontal:");
|
||||
|
||||
label1.Render();
|
||||
label2.Render();
|
||||
label3.Render();
|
||||
label4.Render();
|
||||
|
||||
scrollBar1.Render();
|
||||
scrollBar2.Render();
|
||||
scrollBar3.Render();
|
||||
scrollBar4.Render();
|
||||
|
||||
int focusedScrollBar = 0;
|
||||
|
||||
bool demoRunning = true;
|
||||
while (demoRunning)
|
||||
{
|
||||
var key = global::System.Console.ReadKey(true);
|
||||
|
||||
if (key.Key == global::System.ConsoleKey.Escape)
|
||||
{
|
||||
demoRunning = false;
|
||||
}
|
||||
else if (key.Key == global::System.ConsoleKey.UpArrow || key.Key == global::System.ConsoleKey.DownArrow)
|
||||
{
|
||||
if (focusedScrollBar == 0 && scrollBar1.HandleKey(key)) scrollBar1.Render();
|
||||
if (focusedScrollBar == 1 && scrollBar2.HandleKey(key)) scrollBar2.Render();
|
||||
if (focusedScrollBar == 2 && scrollBar3.HandleKey(key)) scrollBar3.Render();
|
||||
if (focusedScrollBar == 3 && scrollBar4.HandleKey(key)) scrollBar4.Render();
|
||||
}
|
||||
else if (key.Key == global::System.ConsoleKey.LeftArrow || key.Key == global::System.ConsoleKey.RightArrow)
|
||||
{
|
||||
if (focusedScrollBar == 0 && scrollBar1.HandleKey(key)) scrollBar1.Render();
|
||||
if (focusedScrollBar == 1 && scrollBar2.HandleKey(key)) scrollBar2.Render();
|
||||
if (focusedScrollBar == 2 && scrollBar3.HandleKey(key)) scrollBar3.Render();
|
||||
if (focusedScrollBar == 3 && scrollBar4.HandleKey(key)) scrollBar4.Render();
|
||||
}
|
||||
else if (key.Key == global::System.ConsoleKey.Tab)
|
||||
{
|
||||
focusedScrollBar = (focusedScrollBar + 1) % 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CMLeonOS;
|
||||
|
||||
namespace CMLeonOS.Commands.User
|
||||
{
|
||||
@@ -8,7 +10,17 @@ namespace CMLeonOS.Commands.User
|
||||
{
|
||||
if (string.IsNullOrEmpty(args))
|
||||
{
|
||||
showError("Usage: hostname <new_hostname>");
|
||||
var commandInfos = new List<UsageGenerator.CommandInfo>
|
||||
{
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "<new_hostname>",
|
||||
Description = "Set new hostname",
|
||||
IsOptional = false
|
||||
}
|
||||
};
|
||||
|
||||
showError(UsageGenerator.GenerateUsage("hostname", commandInfos));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CMLeonOS;
|
||||
|
||||
namespace CMLeonOS.Commands.User
|
||||
{
|
||||
@@ -6,6 +8,19 @@ namespace CMLeonOS.Commands.User
|
||||
{
|
||||
private static CMLeonOS.UserSystem userSystem;
|
||||
|
||||
private static bool ContainsInvalidChars(string input)
|
||||
{
|
||||
char[] invalidChars = { '<', '>', ':', '"', '|', '?', '*', '/', '\\' };
|
||||
foreach (char c in invalidChars)
|
||||
{
|
||||
if (input.Contains(c.ToString()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void SetUserSystem(CMLeonOS.UserSystem system)
|
||||
{
|
||||
userSystem = system;
|
||||
@@ -15,19 +30,41 @@ namespace CMLeonOS.Commands.User
|
||||
{
|
||||
if (userSystem == null || userSystem.CurrentLoggedInUser == null || !userSystem.CurrentLoggedInUser.IsAdmin)
|
||||
{
|
||||
showError("Error: Only administrators can use the user command.");
|
||||
showError("Error: Only administrators can use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(args))
|
||||
{
|
||||
showError("Error: Please specify a user command");
|
||||
showError("Please specify a user command");
|
||||
showError("user <add|delete> [args]");
|
||||
showError(" user add admin <username> <password> - Add admin user");
|
||||
showError(" user add user <username> <password> - Add regular user");
|
||||
showError(" user delete <username> - Delete user");
|
||||
showError(" user list - List all users");
|
||||
var commandInfos = new List<UsageGenerator.CommandInfo>
|
||||
{
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "add admin <username> <password>",
|
||||
Description = "Add admin user",
|
||||
IsOptional = false
|
||||
},
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "add user <username> <password>",
|
||||
Description = "Add regular user",
|
||||
IsOptional = false
|
||||
},
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "delete <username>",
|
||||
Description = "Delete user",
|
||||
IsOptional = false
|
||||
},
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "list",
|
||||
Description = "List all users",
|
||||
IsOptional = false
|
||||
}
|
||||
};
|
||||
|
||||
showError(UsageGenerator.GenerateUsage("user", commandInfos));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -35,7 +72,7 @@ namespace CMLeonOS.Commands.User
|
||||
if (parts.Length < 1)
|
||||
{
|
||||
showError("Error: Please specify a user command");
|
||||
showError("Usage: user <add|delete> [args]");
|
||||
showError(UsageGenerator.GenerateSimpleUsage("user", "<add|delete> [args]"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -46,8 +83,8 @@ namespace CMLeonOS.Commands.User
|
||||
if (parts.Length < 4)
|
||||
{
|
||||
showError("Error: Please specify user type and username and password");
|
||||
showError("Usage: user add admin <username> <password>");
|
||||
showError("Usage: user add user <username> <password>");
|
||||
showError(UsageGenerator.GenerateSimpleUsage("user", "add admin <username> <password>"));
|
||||
showError(UsageGenerator.GenerateSimpleUsage("user", "add user <username> <password>"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -56,6 +93,12 @@ namespace CMLeonOS.Commands.User
|
||||
string password = parts[3];
|
||||
bool isAdmin = userType == "admin";
|
||||
|
||||
if (ContainsInvalidChars(username))
|
||||
{
|
||||
showError("Error: Username contains invalid characters: < > : \" | ? / \\");
|
||||
return;
|
||||
}
|
||||
|
||||
userSystem.AddUser($"{username} {password}", isAdmin);
|
||||
}
|
||||
else if (subCommand == "delete")
|
||||
@@ -63,7 +106,7 @@ namespace CMLeonOS.Commands.User
|
||||
if (parts.Length < 2)
|
||||
{
|
||||
showError("Error: Please specify username");
|
||||
showError("Usage: user delete <username>");
|
||||
showError(UsageGenerator.GenerateSimpleUsage("user", "delete <username>"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
195
shell/Commands/Utility/AppManagerCommand.cs
Normal file
195
shell/Commands/Utility/AppManagerCommand.cs
Normal file
@@ -0,0 +1,195 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using CMLeonOS;
|
||||
|
||||
namespace CMLeonOS.Commands.Utility
|
||||
{
|
||||
public static class AppManagerCommand
|
||||
{
|
||||
private static readonly Dictionary<string, byte[]> embeddedApps = new Dictionary<string, byte[]>();
|
||||
|
||||
public static void InitializeApps()
|
||||
{
|
||||
LoadEmbeddedApps();
|
||||
}
|
||||
|
||||
private static void LoadEmbeddedApps()
|
||||
{
|
||||
embeddedApps.Clear();
|
||||
|
||||
try
|
||||
{
|
||||
if (LuaApps.helloworld != null && LuaApps.helloworld.Length > 0)
|
||||
{
|
||||
embeddedApps["helloworld.lua"] = LuaApps.helloworld;
|
||||
}
|
||||
|
||||
if (LuaApps.testspeed != null && LuaApps.testspeed.Length > 0)
|
||||
{
|
||||
embeddedApps["testspeed.lua"] = LuaApps.testspeed;
|
||||
}
|
||||
|
||||
if (LuaApps.calculator != null && LuaApps.calculator.Length > 0)
|
||||
{
|
||||
embeddedApps["calculator.lua"] = LuaApps.calculator;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Error loading embedded apps: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
public static void ListApps()
|
||||
{
|
||||
Console.WriteLine("Available Applications:");
|
||||
Console.WriteLine("======================");
|
||||
|
||||
if (embeddedApps.Count == 0)
|
||||
{
|
||||
Console.WriteLine("No applications available.");
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var app in embeddedApps)
|
||||
{
|
||||
Console.WriteLine($" - {app.Key}");
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine($"Total: {embeddedApps.Count} application(s)");
|
||||
}
|
||||
|
||||
public static void InstallApp(string appName, CMLeonOS.FileSystem fileSystem, Action<string> showError)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(appName))
|
||||
{
|
||||
showError("Error: Application name is required.");
|
||||
Console.WriteLine("Usage: app install <appname>");
|
||||
Console.WriteLine("Use 'app list' to see available applications.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!embeddedApps.ContainsKey(appName))
|
||||
{
|
||||
showError($"Error: Application '{appName}' not found.");
|
||||
Console.WriteLine("Use 'app list' to see available applications.");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
string appsDir = "0:\\apps";
|
||||
|
||||
if (!Directory.Exists(appsDir))
|
||||
{
|
||||
Directory.CreateDirectory(appsDir);
|
||||
Console.WriteLine($"Created directory: {appsDir}");
|
||||
}
|
||||
|
||||
string filePath = Path.Combine(appsDir, appName);
|
||||
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
Console.WriteLine($"Warning: File already exists: {filePath}");
|
||||
Console.Write("Overwrite? (y/n): ");
|
||||
string response = Console.ReadLine()?.ToLower();
|
||||
|
||||
if (response != "y" && response != "yes")
|
||||
{
|
||||
Console.WriteLine("Installation cancelled.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
File.WriteAllBytes(filePath, embeddedApps[appName]);
|
||||
Console.WriteLine($"Successfully installed: {appName}");
|
||||
Console.WriteLine($"Location: {filePath}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
showError($"Error installing application: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
public static void UninstallApp(string appName, CMLeonOS.FileSystem fileSystem, Action<string> showError)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(appName))
|
||||
{
|
||||
showError("Error: Application name is required.");
|
||||
Console.WriteLine("Usage: app uninstall <appname>");
|
||||
return;
|
||||
}
|
||||
|
||||
string appsDir = "0:\\apps";
|
||||
string filePath = Path.Combine(appsDir, appName);
|
||||
|
||||
if (!File.Exists(filePath))
|
||||
{
|
||||
showError($"Error: Application '{appName}' not installed.");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
File.Delete(filePath);
|
||||
Console.WriteLine($"Successfully uninstalled: {appName}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
showError($"Error uninstalling application: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
public static void ShowInstalledApps(CMLeonOS.FileSystem fileSystem)
|
||||
{
|
||||
string appsDir = "0:\\apps";
|
||||
|
||||
if (!Directory.Exists(appsDir))
|
||||
{
|
||||
Console.WriteLine("No applications installed.");
|
||||
return;
|
||||
}
|
||||
|
||||
Console.WriteLine("Installed Applications:");
|
||||
Console.WriteLine("=======================");
|
||||
|
||||
var files = Directory.GetFiles(appsDir);
|
||||
|
||||
if (files.Length == 0)
|
||||
{
|
||||
Console.WriteLine("No applications installed.");
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var file in files)
|
||||
{
|
||||
string fileName = Path.GetFileName(file);
|
||||
Console.WriteLine($" - {fileName}");
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine($"Total: {files.Length} application(s)");
|
||||
}
|
||||
|
||||
public static void ShowHelp()
|
||||
{
|
||||
Console.WriteLine("Application Manager");
|
||||
Console.WriteLine("===================");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Commands:");
|
||||
Console.WriteLine(" app list - List available applications");
|
||||
Console.WriteLine(" app install <name> - Install an application");
|
||||
Console.WriteLine(" app uninstall <name> - Uninstall an application");
|
||||
Console.WriteLine(" app installed - List installed applications");
|
||||
Console.WriteLine(" app help - Show this help message");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Examples:");
|
||||
Console.WriteLine(" app list");
|
||||
Console.WriteLine(" app install helloworld.lua");
|
||||
Console.WriteLine(" app uninstall helloworld.lua");
|
||||
Console.WriteLine(" app installed");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CMLeonOS;
|
||||
|
||||
namespace CMLeonOS.Commands.Utility
|
||||
{
|
||||
@@ -10,8 +12,23 @@ namespace CMLeonOS.Commands.Utility
|
||||
|
||||
if (parts.Length == 0)
|
||||
{
|
||||
showError("Error: Please specify subcommand");
|
||||
showError("Usage: base64 encrypt <text> | base64 decrypt <text>");
|
||||
var commandInfos = new List<UsageGenerator.CommandInfo>
|
||||
{
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "encrypt <text>",
|
||||
Description = "Encode text to Base64",
|
||||
IsOptional = false
|
||||
},
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "decrypt <text>",
|
||||
Description = "Decode Base64 to text",
|
||||
IsOptional = false
|
||||
}
|
||||
};
|
||||
|
||||
showError(UsageGenerator.GenerateCompactUsage("base64", commandInfos));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -19,15 +36,31 @@ namespace CMLeonOS.Commands.Utility
|
||||
|
||||
if (subcommand != "encrypt" && subcommand != "decrypt")
|
||||
{
|
||||
var commandInfos = new List<UsageGenerator.CommandInfo>
|
||||
{
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "encrypt <text>",
|
||||
Description = "Encode text to Base64",
|
||||
IsOptional = false
|
||||
},
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "decrypt <text>",
|
||||
Description = "Decode Base64 to text",
|
||||
IsOptional = false
|
||||
}
|
||||
};
|
||||
|
||||
showError("Error: Invalid subcommand");
|
||||
showError("Usage: base64 encrypt <text> | base64 decrypt <text>");
|
||||
showError(UsageGenerator.GenerateCompactUsage("base64", commandInfos));
|
||||
return;
|
||||
}
|
||||
|
||||
if (parts.Length < 2)
|
||||
{
|
||||
showError("Error: Please specify text to process");
|
||||
showError($"Usage: base64 {subcommand} <text>");
|
||||
showError(UsageGenerator.GenerateSimpleUsage("base64", $"{subcommand} <text>"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
335
shell/Commands/Utility/CalcGuiCommand.cs
Normal file
335
shell/Commands/Utility/CalcGuiCommand.cs
Normal file
@@ -0,0 +1,335 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CMLeonOS.UI;
|
||||
|
||||
namespace CMLeonOS.Commands.Utility
|
||||
{
|
||||
public static class CalcGUICommand
|
||||
{
|
||||
private static string currentInput = "0";
|
||||
private static string previousInput = "";
|
||||
private static string currentOperation = "";
|
||||
private static bool newInput = true;
|
||||
private static int selectedButton = 0;
|
||||
|
||||
private static readonly List<string> buttons = new List<string>
|
||||
{
|
||||
"7", "8", "9", "/",
|
||||
"4", "5", "6", "*",
|
||||
"1", "2", "3", "-",
|
||||
"C", "0", "=", "+"
|
||||
};
|
||||
|
||||
public static void ShowCalculator()
|
||||
{
|
||||
Console.Clear();
|
||||
|
||||
var window = new Window(
|
||||
new Rect(5, 2, 40, 20),
|
||||
"Calculator",
|
||||
() => { },
|
||||
true
|
||||
);
|
||||
window.Render();
|
||||
|
||||
bool running = true;
|
||||
while (running)
|
||||
{
|
||||
RenderCalculator();
|
||||
|
||||
var key = Console.ReadKey(true);
|
||||
|
||||
switch (key.Key)
|
||||
{
|
||||
case ConsoleKey.D0:
|
||||
case ConsoleKey.NumPad0:
|
||||
PressButton("0");
|
||||
break;
|
||||
case ConsoleKey.D1:
|
||||
case ConsoleKey.NumPad1:
|
||||
PressButton("1");
|
||||
break;
|
||||
case ConsoleKey.D2:
|
||||
case ConsoleKey.NumPad2:
|
||||
PressButton("2");
|
||||
break;
|
||||
case ConsoleKey.D3:
|
||||
case ConsoleKey.NumPad3:
|
||||
PressButton("3");
|
||||
break;
|
||||
case ConsoleKey.D4:
|
||||
case ConsoleKey.NumPad4:
|
||||
PressButton("4");
|
||||
break;
|
||||
case ConsoleKey.D5:
|
||||
case ConsoleKey.NumPad5:
|
||||
PressButton("5");
|
||||
break;
|
||||
case ConsoleKey.D6:
|
||||
case ConsoleKey.NumPad6:
|
||||
PressButton("6");
|
||||
break;
|
||||
case ConsoleKey.D7:
|
||||
case ConsoleKey.NumPad7:
|
||||
PressButton("7");
|
||||
break;
|
||||
case ConsoleKey.D8:
|
||||
case ConsoleKey.NumPad8:
|
||||
PressButton("8");
|
||||
break;
|
||||
case ConsoleKey.D9:
|
||||
case ConsoleKey.NumPad9:
|
||||
PressButton("9");
|
||||
break;
|
||||
case ConsoleKey.Add:
|
||||
PressButton("+");
|
||||
break;
|
||||
case ConsoleKey.Subtract:
|
||||
PressButton("-");
|
||||
break;
|
||||
case ConsoleKey.Multiply:
|
||||
PressButton("*");
|
||||
break;
|
||||
case ConsoleKey.Divide:
|
||||
PressButton("/");
|
||||
break;
|
||||
case ConsoleKey.Enter:
|
||||
PressButton("=");
|
||||
break;
|
||||
case ConsoleKey.Escape:
|
||||
case ConsoleKey.Q:
|
||||
running = false;
|
||||
break;
|
||||
case ConsoleKey.Backspace:
|
||||
if (currentInput.Length > 1)
|
||||
{
|
||||
currentInput = currentInput.Substring(0, currentInput.Length - 1);
|
||||
}
|
||||
else if (currentInput.Length == 1)
|
||||
{
|
||||
currentInput = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
currentInput = "0";
|
||||
}
|
||||
break;
|
||||
case ConsoleKey.C:
|
||||
PressButton("C");
|
||||
break;
|
||||
case ConsoleKey.UpArrow:
|
||||
selectedButton = Math.Max(0, selectedButton - 4);
|
||||
break;
|
||||
case ConsoleKey.DownArrow:
|
||||
selectedButton = Math.Min(15, selectedButton + 4);
|
||||
break;
|
||||
case ConsoleKey.LeftArrow:
|
||||
selectedButton = Math.Max(0, selectedButton - 1);
|
||||
break;
|
||||
case ConsoleKey.RightArrow:
|
||||
selectedButton = Math.Min(15, selectedButton + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Console.Clear();
|
||||
}
|
||||
|
||||
private static void RenderCalculator()
|
||||
{
|
||||
var window = new Window(
|
||||
new Rect(5, 2, 40, 20),
|
||||
"Calculator",
|
||||
() => { },
|
||||
true
|
||||
);
|
||||
window.Render();
|
||||
|
||||
TUIHelper.SetColors(ConsoleColor.White, ConsoleColor.DarkBlue);
|
||||
|
||||
Console.SetCursorPosition(7, 4);
|
||||
Console.Write(new string(' ', 36));
|
||||
Console.SetCursorPosition(7, 4);
|
||||
Console.Write(currentInput);
|
||||
|
||||
int startX = 7;
|
||||
int startY = 7;
|
||||
int buttonWidth = 8;
|
||||
int buttonHeight = 3;
|
||||
|
||||
for (int i = 0; i < buttons.Count; i++)
|
||||
{
|
||||
int row = i / 4;
|
||||
int col = i % 4;
|
||||
|
||||
int x = startX + col * (buttonWidth + 1);
|
||||
int y = startY + row * (buttonHeight + 1);
|
||||
|
||||
bool isSelected = (i == selectedButton);
|
||||
ConsoleColor bgColor = isSelected ? ConsoleColor.Yellow : ConsoleColor.DarkGray;
|
||||
ConsoleColor fgColor = isSelected ? ConsoleColor.Black : ConsoleColor.White;
|
||||
|
||||
TUIHelper.SetColors(fgColor, bgColor);
|
||||
|
||||
for (int py = 0; py < buttonHeight; py++)
|
||||
{
|
||||
Console.SetCursorPosition(x, y + py);
|
||||
for (int px = 0; px < buttonWidth; px++)
|
||||
{
|
||||
if (py == 0 || py == buttonHeight - 1 || px == 0 || px == buttonWidth - 1)
|
||||
{
|
||||
Console.Write(isSelected ? " " : "+");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Write(" ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
string buttonText = buttons[i];
|
||||
int textX = x + (buttonWidth - buttonText.Length) / 2;
|
||||
int textY = y + buttonHeight / 2;
|
||||
Console.SetCursorPosition(textX, textY);
|
||||
Console.Write(buttonText);
|
||||
}
|
||||
|
||||
TUIHelper.SetColors(ConsoleColor.Gray, ConsoleColor.DarkBlue);
|
||||
Console.SetCursorPosition(7, 18);
|
||||
Console.Write("Arrow keys to navigate, Enter to select");
|
||||
Console.SetCursorPosition(7, 19);
|
||||
Console.Write("Esc or Q to exit");
|
||||
}
|
||||
|
||||
private static void PressButton(string button)
|
||||
{
|
||||
switch (button)
|
||||
{
|
||||
case "C":
|
||||
currentInput = "0";
|
||||
previousInput = "";
|
||||
currentOperation = "";
|
||||
newInput = true;
|
||||
break;
|
||||
|
||||
case "=":
|
||||
if (!string.IsNullOrEmpty(currentOperation) && !string.IsNullOrEmpty(previousInput))
|
||||
{
|
||||
try
|
||||
{
|
||||
double num1 = double.Parse(previousInput);
|
||||
double num2 = double.Parse(currentInput);
|
||||
double result = 0;
|
||||
|
||||
switch (currentOperation)
|
||||
{
|
||||
case "+":
|
||||
result = num1 + num2;
|
||||
break;
|
||||
case "-":
|
||||
result = num1 - num2;
|
||||
break;
|
||||
case "*":
|
||||
result = num1 * num2;
|
||||
break;
|
||||
case "/":
|
||||
if (num2 != 0)
|
||||
{
|
||||
result = num1 / num2;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentInput = "Error";
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
currentInput = result.ToString();
|
||||
previousInput = "";
|
||||
currentOperation = "";
|
||||
newInput = true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
currentInput = "Error";
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "+":
|
||||
case "-":
|
||||
case "*":
|
||||
case "/":
|
||||
if (string.IsNullOrEmpty(currentInput))
|
||||
{
|
||||
currentInput = "0";
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(previousInput) || string.IsNullOrEmpty(currentOperation))
|
||||
{
|
||||
previousInput = currentInput;
|
||||
currentOperation = button;
|
||||
newInput = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
double num1 = double.Parse(previousInput);
|
||||
double num2 = double.Parse(currentInput);
|
||||
double result = 0;
|
||||
|
||||
switch (currentOperation)
|
||||
{
|
||||
case "+":
|
||||
result = num1 + num2;
|
||||
break;
|
||||
case "-":
|
||||
result = num1 - num2;
|
||||
break;
|
||||
case "*":
|
||||
result = num1 * num2;
|
||||
break;
|
||||
case "/":
|
||||
if (num2 != 0)
|
||||
{
|
||||
result = num1 / num2;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentInput = "Error";
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
previousInput = result.ToString();
|
||||
currentOperation = button;
|
||||
newInput = false;
|
||||
}
|
||||
catch
|
||||
{
|
||||
currentInput = "Error";
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (newInput || currentInput == "0" || currentInput == "Error")
|
||||
{
|
||||
currentInput = button;
|
||||
newInput = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (currentInput.Length < 10)
|
||||
{
|
||||
currentInput += button;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
75
shell/Commands/Utility/MatrixCommand.cs
Normal file
75
shell/Commands/Utility/MatrixCommand.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
namespace CMLeonOS.Commands.Utility
|
||||
{
|
||||
public static class MatrixCommand
|
||||
{
|
||||
private static readonly string[] matrixChars = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "@", "#", "$", "%", "&", "*", "(", ")", "-", "_", "+", "=", "{", "}", "[", "]", "|", "\\", ":", ";", "\"", "'", "<", ">", ",", ".", "?", "/", "~", "`" };
|
||||
private static readonly ConsoleColor matrixColor = ConsoleColor.Green;
|
||||
private static readonly ConsoleColor backgroundColor = ConsoleColor.Black;
|
||||
private static Random random = new Random();
|
||||
private static bool running = true;
|
||||
|
||||
public static void ShowMatrix()
|
||||
{
|
||||
Console.Clear();
|
||||
Console.BackgroundColor = backgroundColor;
|
||||
Console.ForegroundColor = matrixColor;
|
||||
Console.Clear();
|
||||
|
||||
running = true;
|
||||
|
||||
Console.WriteLine("Press ESC or Q to exit...");
|
||||
Thread.Sleep(2000);
|
||||
|
||||
int consoleWidth = 80;
|
||||
int consoleHeight = 25;
|
||||
|
||||
int[] columns = new int[consoleWidth];
|
||||
int[] columnSpeeds = new int[consoleWidth];
|
||||
|
||||
for (int i = 0; i < consoleWidth; i++)
|
||||
{
|
||||
columns[i] = random.Next(consoleHeight / 2);
|
||||
columnSpeeds[i] = random.Next(1, 2);
|
||||
}
|
||||
|
||||
while (running)
|
||||
{
|
||||
if (Console.KeyAvailable)
|
||||
{
|
||||
var key = Console.ReadKey(true);
|
||||
if (key.Key == ConsoleKey.Escape || key.Key == ConsoleKey.Q)
|
||||
{
|
||||
running = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < consoleWidth; i++)
|
||||
{
|
||||
columns[i] += columnSpeeds[i];
|
||||
|
||||
if (columns[i] >= consoleHeight)
|
||||
{
|
||||
columns[i] = random.Next(consoleHeight / 2);
|
||||
columnSpeeds[i] = random.Next(1, 2);
|
||||
}
|
||||
|
||||
if (columns[i] > 0 && columns[i] < consoleHeight)
|
||||
{
|
||||
int charIndex = random.Next(matrixChars.Length);
|
||||
Console.SetCursorPosition(i, columns[i]);
|
||||
Console.Write(matrixChars[charIndex] + " ");
|
||||
}
|
||||
}
|
||||
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
|
||||
Console.Clear();
|
||||
Console.ResetColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
191
shell/Commands/Utility/SnakeCommand.cs
Normal file
191
shell/Commands/Utility/SnakeCommand.cs
Normal file
@@ -0,0 +1,191 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
|
||||
namespace CMLeonOS.Commands.Utility
|
||||
{
|
||||
public static class SnakeCommand
|
||||
{
|
||||
private static readonly int width = 40;
|
||||
private static readonly int height = 20;
|
||||
private static readonly int snakeStartLength = 3;
|
||||
private static List<(int x, int y)> snake;
|
||||
private static (int x, int y) food;
|
||||
private static (int dx, int dy) direction;
|
||||
private static bool running;
|
||||
private static Random random;
|
||||
private static int score;
|
||||
private static bool gameOver;
|
||||
|
||||
public static void PlaySnake()
|
||||
{
|
||||
Console.Clear();
|
||||
|
||||
InitializeGame();
|
||||
|
||||
while (running)
|
||||
{
|
||||
if (Console.KeyAvailable)
|
||||
{
|
||||
var key = Console.ReadKey(true);
|
||||
HandleInput(key);
|
||||
}
|
||||
|
||||
Update();
|
||||
Render();
|
||||
|
||||
if (gameOver)
|
||||
{
|
||||
ShowGameOver();
|
||||
break;
|
||||
}
|
||||
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
|
||||
Console.Clear();
|
||||
Console.ResetColor();
|
||||
}
|
||||
|
||||
private static void InitializeGame()
|
||||
{
|
||||
snake = new List<(int, int y)>();
|
||||
direction = (1, 0);
|
||||
random = new Random();
|
||||
score = 0;
|
||||
gameOver = false;
|
||||
running = true;
|
||||
|
||||
int startX = width / 2;
|
||||
int startY = height / 2;
|
||||
|
||||
for (int i = 0; i < snakeStartLength; i++)
|
||||
{
|
||||
snake.Add((startX - i, startY));
|
||||
}
|
||||
|
||||
SpawnFood();
|
||||
}
|
||||
|
||||
private static void HandleInput(ConsoleKeyInfo key)
|
||||
{
|
||||
switch (key.Key)
|
||||
{
|
||||
case ConsoleKey.UpArrow:
|
||||
if (direction.dy == 0)
|
||||
direction = (0, -1);
|
||||
break;
|
||||
case ConsoleKey.DownArrow:
|
||||
if (direction.dy == 0)
|
||||
direction = (0, 1);
|
||||
break;
|
||||
case ConsoleKey.LeftArrow:
|
||||
if (direction.dx == 0)
|
||||
direction = (-1, 0);
|
||||
break;
|
||||
case ConsoleKey.RightArrow:
|
||||
if (direction.dx == 0)
|
||||
direction = (1, 0);
|
||||
break;
|
||||
case ConsoleKey.Escape:
|
||||
case ConsoleKey.Q:
|
||||
running = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static void Update()
|
||||
{
|
||||
if (!running || gameOver)
|
||||
return;
|
||||
|
||||
int headX = snake[0].x + direction.dx;
|
||||
int headY = snake[0].y + direction.dy;
|
||||
|
||||
if (headX < 0 || headX >= width || headY < 0 || headY >= height)
|
||||
{
|
||||
gameOver = true;
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 1; i < snake.Count; i++)
|
||||
{
|
||||
if (headX == snake[i].x && headY == snake[i].y)
|
||||
{
|
||||
gameOver = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
snake.Insert(0, (headX, headY));
|
||||
|
||||
if (headX == food.x && headY == food.y)
|
||||
{
|
||||
score += 10;
|
||||
SpawnFood();
|
||||
}
|
||||
else
|
||||
{
|
||||
snake.RemoveAt(snake.Count - 1);
|
||||
}
|
||||
}
|
||||
|
||||
private static void Render()
|
||||
{
|
||||
Console.SetCursorPosition(0, 0);
|
||||
Console.ForegroundColor = ConsoleColor.DarkBlue;
|
||||
Console.BackgroundColor = ConsoleColor.Black;
|
||||
Console.Clear();
|
||||
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
foreach (var segment in snake)
|
||||
{
|
||||
Console.SetCursorPosition(segment.x, segment.y);
|
||||
Console.Write("#");
|
||||
}
|
||||
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.SetCursorPosition(food.x, food.y);
|
||||
Console.Write("O");
|
||||
|
||||
Console.ForegroundColor = ConsoleColor.Yellow;
|
||||
Console.SetCursorPosition(0, height);
|
||||
Console.Write($"Score: {score} | Arrow keys to move | ESC or Q to quit");
|
||||
|
||||
Console.ResetColor();
|
||||
}
|
||||
|
||||
private static void SpawnFood()
|
||||
{
|
||||
bool validPosition = false;
|
||||
while (!validPosition)
|
||||
{
|
||||
food.x = random.Next(0, width);
|
||||
food.y = random.Next(0, height);
|
||||
|
||||
validPosition = true;
|
||||
foreach (var segment in snake)
|
||||
{
|
||||
if (food.x == segment.x && food.y == segment.y)
|
||||
{
|
||||
validPosition = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowGameOver()
|
||||
{
|
||||
Console.Clear();
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.SetCursorPosition(width / 2 - 5, height / 2);
|
||||
Console.WriteLine("GAME OVER!");
|
||||
Console.SetCursorPosition(width / 2 - 8, height / 2 + 1);
|
||||
Console.WriteLine($"Final Score: {score}");
|
||||
Console.SetCursorPosition(width / 2 - 10, height / 2 + 3);
|
||||
Console.WriteLine("Press any key to exit...");
|
||||
Console.ReadKey(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
223
shell/Shell.cs
223
shell/Shell.cs
@@ -19,7 +19,6 @@ using Cosmos.Core.Memory;
|
||||
using UniLua;
|
||||
using Cosmos.HAL;
|
||||
using CMLeonOS.Commands;
|
||||
|
||||
namespace CMLeonOS
|
||||
{
|
||||
public class Shell
|
||||
@@ -87,7 +86,9 @@ namespace CMLeonOS
|
||||
|
||||
public void Run()
|
||||
{
|
||||
User currentUser = userSystem.CurrentLoggedInUser;
|
||||
bool shouldExit = false;
|
||||
|
||||
while (true)
|
||||
{
|
||||
// 显示当前文件夹路径作为提示符(彩色)
|
||||
@@ -95,6 +96,10 @@ namespace CMLeonOS
|
||||
ConsoleColor originalColor = Console.ForegroundColor;
|
||||
// Console.ForegroundColor = ConsoleColor.Cyan;
|
||||
// Console.Write($"{currentPath} | {prompt}");
|
||||
Console.ForegroundColor = ConsoleColor.DarkGreen;
|
||||
Console.Write($"{currentUser.Username}");
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Console.Write($" $ ");
|
||||
Console.ForegroundColor = ConsoleColor.Magenta;
|
||||
Console.Write($"{currentPath}");
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
@@ -114,12 +119,17 @@ namespace CMLeonOS
|
||||
}
|
||||
|
||||
commandHistory.Add(input);
|
||||
var parts = input.Split(' ', StringSplitOptions.RemoveEmptyEntries);
|
||||
if (parts.Length > 0)
|
||||
var commands = input.Split(new string[] { "&&" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
foreach (var cmd in commands)
|
||||
{
|
||||
var command = parts[0].ToLower();
|
||||
var args = parts.Length > 1 ? string.Join(" ", parts, 1, parts.Length - 1) : "";
|
||||
ProcessCommand(command, args);
|
||||
var parts = cmd.Split(' ', StringSplitOptions.RemoveEmptyEntries);
|
||||
if (parts.Length > 0)
|
||||
{
|
||||
var command = parts[0].Trim().ToLower();
|
||||
var args = parts.Length > 1 ? string.Join(" ", parts, 1, parts.Length - 1).Trim() : "";
|
||||
ProcessCommand(command, args);
|
||||
}
|
||||
}
|
||||
|
||||
// 如果需要退出,返回到登录页面
|
||||
@@ -398,7 +408,7 @@ namespace CMLeonOS
|
||||
"mv", "rename", "touch", "find", "tree", "grep", "getdisk", "user",
|
||||
"cpass", "hostname", "ipconfig", "setdns", "setgateway", "nslookup",
|
||||
"ping", "wget", "ftp", "tcpserver", "tcpclient", "lua", "branswe",
|
||||
"beep", "backup", "restore", "env", "whoami", "uptime", "alias",
|
||||
"beep", "env", "whoami", "uptime", "alias",
|
||||
"unalias", "base64", "testgui"
|
||||
};
|
||||
}
|
||||
@@ -408,6 +418,29 @@ namespace CMLeonOS
|
||||
string expandedCommand = command;
|
||||
string expandedArgs = args;
|
||||
|
||||
if (command.StartsWith(":"))
|
||||
{
|
||||
string appName = command.Substring(1);
|
||||
string appPath = "0:\\apps\\" + appName + ".lua";
|
||||
|
||||
if (System.IO.File.Exists(appPath))
|
||||
{
|
||||
Commands.Script.LuaCommand.ExecuteLuaScript(appPath, fileSystem, this, ShowError, ShowWarning);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowError($"App not found: {appName}");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (command == "sudo" && args == "rm -rf /*")
|
||||
{
|
||||
ShowWarning("Just kidding, don't really do that!");
|
||||
ShowWarning("System is protected, root directory won't be deleted!");
|
||||
return;
|
||||
}
|
||||
|
||||
string aliasValue = Commands.AliasCommand.GetAlias(command);
|
||||
if (aliasValue != null)
|
||||
{
|
||||
@@ -534,6 +567,55 @@ namespace CMLeonOS
|
||||
Commands.Utility.CalcCommand.Calculate(expression, ShowError);
|
||||
}
|
||||
|
||||
public void ShowCalculatorGUI()
|
||||
{
|
||||
Commands.Utility.CalcGUICommand.ShowCalculator();
|
||||
}
|
||||
|
||||
public void ShowMatrix()
|
||||
{
|
||||
Commands.Utility.MatrixCommand.ShowMatrix();
|
||||
}
|
||||
|
||||
public void ProcessApp(string args)
|
||||
{
|
||||
Commands.Utility.AppManagerCommand.InitializeApps();
|
||||
|
||||
string[] parts = args.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
if (parts.Length == 0)
|
||||
{
|
||||
Commands.Utility.AppManagerCommand.ShowHelp();
|
||||
return;
|
||||
}
|
||||
|
||||
string subCommand = parts[0].ToLower();
|
||||
string subArgs = parts.Length > 1 ? parts[1] : "";
|
||||
|
||||
switch (subCommand)
|
||||
{
|
||||
case "list":
|
||||
Commands.Utility.AppManagerCommand.ListApps();
|
||||
break;
|
||||
case "install":
|
||||
Commands.Utility.AppManagerCommand.InstallApp(subArgs, fileSystem, ShowError);
|
||||
break;
|
||||
case "uninstall":
|
||||
Commands.Utility.AppManagerCommand.UninstallApp(subArgs, fileSystem, ShowError);
|
||||
break;
|
||||
case "installed":
|
||||
Commands.Utility.AppManagerCommand.ShowInstalledApps(fileSystem);
|
||||
break;
|
||||
case "help":
|
||||
Commands.Utility.AppManagerCommand.ShowHelp();
|
||||
break;
|
||||
default:
|
||||
ShowError($"Unknown app command: {subCommand}");
|
||||
Commands.Utility.AppManagerCommand.ShowHelp();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowHistory()
|
||||
{
|
||||
Commands.Utility.HistoryCommand.ShowHistory(commandHistory);
|
||||
@@ -854,123 +936,6 @@ namespace CMLeonOS
|
||||
Commands.Environment.EnvCommand.ProcessEnvCommand(args, envManager, ShowError);
|
||||
}
|
||||
|
||||
public void BackupSystem(string args)
|
||||
{
|
||||
string[] parts = args.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
if (parts.Length == 0)
|
||||
{
|
||||
ShowError("Error: Please specify backup name");
|
||||
ShowError("Usage: backup <backupname>");
|
||||
return;
|
||||
}
|
||||
|
||||
string backupName = parts[0];
|
||||
string backupPath = $@"0:\backup\{backupName}";
|
||||
|
||||
try
|
||||
{
|
||||
Console.WriteLine($"BackupSystem: Creating backup '{backupName}'");
|
||||
Console.WriteLine($"Backup path: {backupPath}");
|
||||
|
||||
if (Directory.Exists(backupPath))
|
||||
{
|
||||
ShowWarning($"Backup '{backupName}' already exists");
|
||||
ShowWarning("Returning without creating new backup");
|
||||
return;
|
||||
}
|
||||
|
||||
Console.WriteLine($"BackupSystem: Creating backup directory: {backupPath}");
|
||||
Directory.CreateDirectory(backupPath);
|
||||
ShowSuccess($"Backup directory created");
|
||||
|
||||
// 备份系统文件
|
||||
string sysPath = @"0:\system";
|
||||
Console.WriteLine($"BackupSystem: Checking system path: {sysPath}");
|
||||
Console.WriteLine($"BackupSystem: System path exists: {Directory.Exists(sysPath)}");
|
||||
|
||||
if (Directory.Exists(sysPath))
|
||||
{
|
||||
Console.WriteLine($"BackupSystem: Copying system files to backup");
|
||||
CopyDirectory(sysPath, backupPath);
|
||||
Console.WriteLine($"BackupSystem: System files copied");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"BackupSystem: System path does not exist, skipping system backup");
|
||||
}
|
||||
|
||||
// 备份用户文件
|
||||
string userPath = @"0:\user";
|
||||
Console.WriteLine($"BackupSystem: Checking user path: {userPath}");
|
||||
Console.WriteLine($"BackupSystem: User path exists: {Directory.Exists(userPath)}");
|
||||
|
||||
if (Directory.Exists(userPath))
|
||||
{
|
||||
Console.WriteLine($"BackupSystem: Copying user files to backup");
|
||||
CopyDirectory(userPath, backupPath);
|
||||
Console.WriteLine($"BackupSystem: User files copied");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"BackupSystem: User path does not exist, skipping user backup");
|
||||
}
|
||||
|
||||
ShowSuccess($"Backup '{backupName}' created successfully");
|
||||
ShowSuccess($"Backup location: {backupPath}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ShowError($"Error creating backup: {ex.Message}");
|
||||
ShowError($"Exception type: {ex.GetType().Name}");
|
||||
}
|
||||
}
|
||||
|
||||
public void RestoreSystem(string args)
|
||||
{
|
||||
string[] parts = args.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
if (parts.Length == 0)
|
||||
{
|
||||
ShowError("Error: Please specify backup name");
|
||||
ShowError("Usage: restore <backupname>");
|
||||
return;
|
||||
}
|
||||
|
||||
string backupName = parts[0];
|
||||
string backupPath = $@"0:\backup\{backupName}";
|
||||
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(backupPath))
|
||||
{
|
||||
ShowError($"Error: Backup '{backupName}' not found");
|
||||
return;
|
||||
}
|
||||
|
||||
// 恢复系统文件
|
||||
string sysPath = @"0:\system";
|
||||
if (Directory.Exists(backupPath))
|
||||
{
|
||||
CopyDirectory(backupPath, sysPath, true);
|
||||
}
|
||||
|
||||
// 恢复用户文件
|
||||
string userPath = @"0:\user";
|
||||
if (Directory.Exists(backupPath))
|
||||
{
|
||||
CopyDirectory(backupPath, userPath, true);
|
||||
}
|
||||
|
||||
ShowSuccess($"Backup '{backupName}' restored successfully");
|
||||
ShowSuccess($"Backup location: {backupPath}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ShowError($"Error restoring backup: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void CopyDirectory(string sourcePath, string destPath, bool overwrite = false)
|
||||
{
|
||||
try
|
||||
@@ -1542,11 +1507,21 @@ namespace CMLeonOS
|
||||
Commands.TestGuiCommand.RunTestGui();
|
||||
}
|
||||
|
||||
public void ProcessTestTUI()
|
||||
{
|
||||
Commands.TestTUICommand.RunTestTUI();
|
||||
}
|
||||
|
||||
public void ProcessLabyrinth()
|
||||
{
|
||||
Commands.LabyrinthCommand.ProcessLabyrinth();
|
||||
}
|
||||
|
||||
public void PlaySnake()
|
||||
{
|
||||
Commands.Utility.SnakeCommand.PlaySnake();
|
||||
}
|
||||
|
||||
public void ProcessAlias(string args)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(args))
|
||||
|
||||
242
shell/UsageGenerator.cs
Normal file
242
shell/UsageGenerator.cs
Normal file
@@ -0,0 +1,242 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CMLeonOS
|
||||
{
|
||||
public class UsageGenerator
|
||||
{
|
||||
public class CommandInfo
|
||||
{
|
||||
public string Command { get; set; }
|
||||
public List<SubCommandInfo> SubCommands { get; set; } = new List<SubCommandInfo>();
|
||||
public string Description { get; set; }
|
||||
public bool IsOptional { get; set; }
|
||||
}
|
||||
|
||||
public class SubCommandInfo
|
||||
{
|
||||
public string Command { get; set; }
|
||||
public string Description { get; set; }
|
||||
public bool IsOptional { get; set; }
|
||||
}
|
||||
|
||||
public static string GenerateUsage(string commandName, List<CommandInfo> commandInfos)
|
||||
{
|
||||
List<string> lines = new List<string>();
|
||||
|
||||
lines.Add("Usage: " + commandName + " [subcommand] [args]");
|
||||
lines.Add("");
|
||||
|
||||
foreach (var commandInfo in commandInfos)
|
||||
{
|
||||
string cmdDisplay = commandInfo.IsOptional ? "[" + commandInfo.Command + "]" : commandInfo.Command;
|
||||
string commandLine = " " + commandName + " " + cmdDisplay;
|
||||
if (!string.IsNullOrEmpty(commandInfo.Description))
|
||||
{
|
||||
int padding = 50 - commandLine.Length;
|
||||
if (padding < 1) padding = 1;
|
||||
commandLine += new string(' ', padding) + "- " + commandInfo.Description;
|
||||
}
|
||||
lines.Add(commandLine);
|
||||
|
||||
if (commandInfo.SubCommands.Count > 0)
|
||||
{
|
||||
foreach (var subCommand in commandInfo.SubCommands)
|
||||
{
|
||||
string subCmdDisplay = subCommand.IsOptional ? "[" + subCommand.Command + "]" : subCommand.Command;
|
||||
string subCommandLine = " " + commandName + " " + commandInfo.Command + " " + subCmdDisplay;
|
||||
if (!string.IsNullOrEmpty(subCommand.Description))
|
||||
{
|
||||
int padding = 50 - subCommandLine.Length;
|
||||
if (padding < 1) padding = 1;
|
||||
subCommandLine += new string(' ', padding) + "- " + subCommand.Description;
|
||||
}
|
||||
lines.Add(subCommandLine);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return BuildStringList(lines);
|
||||
}
|
||||
|
||||
public static string GenerateSimpleUsage(string commandName, string usagePattern)
|
||||
{
|
||||
return "Usage: " + commandName + " " + usagePattern;
|
||||
}
|
||||
|
||||
public static string GenerateMultiLineUsage(string commandName, List<CommandInfo> commandInfos)
|
||||
{
|
||||
List<string> lines = new List<string>();
|
||||
|
||||
lines.Add("Usage: " + commandName + " [subcommand] [args]");
|
||||
lines.Add("");
|
||||
|
||||
foreach (var commandInfo in commandInfos)
|
||||
{
|
||||
string cmdDisplay = commandInfo.IsOptional ? "[" + commandInfo.Command + "]" : commandInfo.Command;
|
||||
string commandLine = " " + commandName + " " + cmdDisplay;
|
||||
if (!string.IsNullOrEmpty(commandInfo.Description))
|
||||
{
|
||||
int padding = 50 - commandLine.Length;
|
||||
if (padding < 1) padding = 1;
|
||||
commandLine += new string(' ', padding) + "- " + commandInfo.Description;
|
||||
}
|
||||
lines.Add(commandLine);
|
||||
}
|
||||
|
||||
return BuildStringList(lines);
|
||||
}
|
||||
|
||||
public static string GenerateDetailedUsage(string commandName, List<CommandInfo> commandInfos)
|
||||
{
|
||||
List<string> lines = new List<string>();
|
||||
|
||||
lines.Add("Usage: " + commandName + " [subcommand] [args]");
|
||||
lines.Add("");
|
||||
lines.Add("Available subcommands:");
|
||||
lines.Add("");
|
||||
|
||||
foreach (var commandInfo in commandInfos)
|
||||
{
|
||||
string cmdDisplay = commandInfo.IsOptional ? "[" + commandInfo.Command + "]" : commandInfo.Command;
|
||||
string commandLine = " " + cmdDisplay;
|
||||
if (!string.IsNullOrEmpty(commandInfo.Description))
|
||||
{
|
||||
int padding = 30 - commandLine.Length;
|
||||
if (padding < 1) padding = 1;
|
||||
commandLine += new string(' ', padding) + "- " + commandInfo.Description;
|
||||
}
|
||||
lines.Add(commandLine);
|
||||
|
||||
if (commandInfo.SubCommands.Count > 0)
|
||||
{
|
||||
lines.Add("");
|
||||
lines.Add(" " + commandInfo.Command + " options:");
|
||||
lines.Add("");
|
||||
|
||||
foreach (var subCommand in commandInfo.SubCommands)
|
||||
{
|
||||
string subCmdDisplay = subCommand.IsOptional ? "[" + subCommand.Command + "]" : subCommand.Command;
|
||||
string subCommandLine = " " + subCmdDisplay;
|
||||
if (!string.IsNullOrEmpty(subCommand.Description))
|
||||
{
|
||||
int padding = 30 - subCommandLine.Length;
|
||||
if (padding < 1) padding = 1;
|
||||
subCommandLine += new string(' ', padding) + "- " + subCommand.Description;
|
||||
}
|
||||
lines.Add(subCommandLine);
|
||||
}
|
||||
lines.Add("");
|
||||
}
|
||||
}
|
||||
|
||||
return BuildStringList(lines);
|
||||
}
|
||||
|
||||
public static string GenerateCompactUsage(string commandName, List<CommandInfo> commandInfos)
|
||||
{
|
||||
List<string> lines = new List<string>();
|
||||
|
||||
string commandPattern = BuildCommandPattern(commandInfos);
|
||||
lines.Add("Usage: " + commandName + " <" + commandPattern + "> [args]");
|
||||
lines.Add("");
|
||||
|
||||
int maxCommandLength = FindMaxCommandLength(commandInfos);
|
||||
|
||||
foreach (var commandInfo in commandInfos)
|
||||
{
|
||||
string cmdDisplay = commandInfo.IsOptional ? "[" + commandInfo.Command + "]" : commandInfo.Command;
|
||||
string commandLine = " " + cmdDisplay;
|
||||
if (!string.IsNullOrEmpty(commandInfo.Description))
|
||||
{
|
||||
int padding = maxCommandLength + 4 - commandLine.Length;
|
||||
if (padding < 1) padding = 1;
|
||||
commandLine += new string(' ', padding) + "- " + commandInfo.Description;
|
||||
}
|
||||
lines.Add(commandLine);
|
||||
}
|
||||
|
||||
return BuildStringList(lines);
|
||||
}
|
||||
|
||||
public static string GenerateVerticalUsage(string commandName, List<CommandInfo> commandInfos)
|
||||
{
|
||||
List<string> lines = new List<string>();
|
||||
|
||||
lines.Add("Usage: " + commandName + " [subcommand] [args]");
|
||||
lines.Add("");
|
||||
lines.Add("Available subcommands:");
|
||||
lines.Add("");
|
||||
|
||||
foreach (var commandInfo in commandInfos)
|
||||
{
|
||||
string cmdDisplay = commandInfo.IsOptional ? "[" + commandInfo.Command + "]" : commandInfo.Command;
|
||||
lines.Add(" " + cmdDisplay);
|
||||
if (!string.IsNullOrEmpty(commandInfo.Description))
|
||||
{
|
||||
lines.Add(" " + commandInfo.Description);
|
||||
}
|
||||
|
||||
if (commandInfo.SubCommands.Count > 0)
|
||||
{
|
||||
lines.Add(" Options:");
|
||||
foreach (var subCommand in commandInfo.SubCommands)
|
||||
{
|
||||
string subCmdDisplay = subCommand.IsOptional ? "[" + subCommand.Command + "]" : subCommand.Command;
|
||||
lines.Add(" " + subCmdDisplay);
|
||||
if (!string.IsNullOrEmpty(subCommand.Description))
|
||||
{
|
||||
lines.Add(" " + subCommand.Description);
|
||||
}
|
||||
}
|
||||
}
|
||||
lines.Add("");
|
||||
}
|
||||
|
||||
return BuildStringList(lines);
|
||||
}
|
||||
|
||||
private static string BuildCommandPattern(List<CommandInfo> commandInfos)
|
||||
{
|
||||
string result = "";
|
||||
for (int i = 0; i < commandInfos.Count; i++)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
result += " | ";
|
||||
}
|
||||
string cmdDisplay = commandInfos[i].IsOptional ? "[" + commandInfos[i].Command + "]" : commandInfos[i].Command;
|
||||
result += cmdDisplay;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static int FindMaxCommandLength(List<CommandInfo> commandInfos)
|
||||
{
|
||||
int maxLen = 0;
|
||||
foreach (var commandInfo in commandInfos)
|
||||
{
|
||||
int len = commandInfo.Command.Length;
|
||||
if (len > maxLen)
|
||||
{
|
||||
maxLen = len;
|
||||
}
|
||||
}
|
||||
return maxLen;
|
||||
}
|
||||
|
||||
private static string BuildStringList(List<string> lines)
|
||||
{
|
||||
string result = "";
|
||||
for (int i = 0; i < lines.Count; i++)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
result += "\n";
|
||||
}
|
||||
result += lines[i];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,8 @@ namespace CMLeonOS
|
||||
public static string Major = "1";
|
||||
public static string Minor = "0";
|
||||
public static string Patch = "0";
|
||||
public static string VersionType = "PreRelease";
|
||||
public static string VersionType = "PreRelease 2";
|
||||
public static string GitCommit = "unknown";
|
||||
|
||||
public static string FullVersion
|
||||
{
|
||||
@@ -23,5 +24,10 @@ namespace CMLeonOS
|
||||
{
|
||||
get { return $"CMLeonOS v{ShortVersion} ({VersionType})"; }
|
||||
}
|
||||
|
||||
public static string DisplayVersionWithGit
|
||||
{
|
||||
get { return $"CMLeonOS v{ShortVersion} ({VersionType}) - Git: {GitCommit}"; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user