From 788ed1f68524ccc75aa00d82b8b64e0c3964bd17 Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Wed, 3 Sep 2025 17:56:26 +0800 Subject: [PATCH] =?UTF-8?q?docs(=E5=B8=AE=E5=8A=A9=E6=96=87=E6=A1=A3):=20?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=B9=B6=E6=96=B0=E5=A2=9E=E5=B8=AE=E5=8A=A9?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复create_package.hlp中的格式问题 - 在pkg_download_en.hlp中添加空行提高可读性 - 新增network.hlp网络工具文档 - 新增config.hlp系统配置管理文档 --- data/computercraft/lua/rom/help/config.hlp | 84 +++++++++++++++++++ .../lua/rom/help/create_package.hlp | 20 ++--- data/computercraft/lua/rom/help/network.hlp | 66 +++++++++++++++ .../lua/rom/help/pkg_download_en.hlp | 10 +++ 4 files changed, 170 insertions(+), 10 deletions(-) create mode 100644 data/computercraft/lua/rom/help/config.hlp create mode 100644 data/computercraft/lua/rom/help/network.hlp diff --git a/data/computercraft/lua/rom/help/config.hlp b/data/computercraft/lua/rom/help/config.hlp new file mode 100644 index 0000000..5e7766f --- /dev/null +++ b/data/computercraft/lua/rom/help/config.hlp @@ -0,0 +1,84 @@ +=== System Configuration Manager === + +The `config` command provides a system configuration manager for LeonOS, allowing you to view, modify, and manage system settings. + +== Basic Usage == + +>>color yellow +config [options] [setting] [value] +>>color white + +== Available Commands == + +- **list**: List all available settings +- **get **: Get the value of a specific setting +- **set **: Set the value of a specific setting +- **default **: Reset a setting to its default value +- **save**: Save current settings to file +- **find **: Find settings by name or description +- **help**: Show this help message + +== Command Options == + +- **--details**, **-d**: Show detailed information when listing settings +- **--case-insensitive**, **-i**: Search case-insensitively + +== Usage Examples == + +1. List all settings: +>>color yellow +config list +>>color white + +2. List all settings with details: +>>color yellow +config list --details +>>color white + +3. Get the value of a specific setting: +>>color yellow +config get list.show_hidden +>>color white + +4. Set the value of a specific setting: +>>color yellow +config set list.show_hidden true +>>color white + +5. Reset a setting to its default value: +>>color yellow +config default list.show_hidden +>>color white + +6. Find settings containing a pattern: +>>color yellow +config find 'hidden' +>>color white + +7. Find settings with case-insensitive search: +>>color yellow +config find 'color' -i +>>color white + +8. Save current settings: +>>color yellow +config save +>>color white + +9. Show help information: +>>color yellow +config help +>>color white + +== Notes == + +- Changes to settings are not persisted until you run `config save` +- Some settings may require a system restart to take effect +- Use `config list --details` to see the type and description of each setting +- The `find` command searches both setting names and descriptions + +== Troubleshooting == + +- If you get an error that a setting is not found, check that you're using the correct setting name +- If changes don't seem to take effect, make sure you've run `config save` and restarted any affected programs +- For case-sensitive searches, omit the `-i` option \ No newline at end of file diff --git a/data/computercraft/lua/rom/help/create_package.hlp b/data/computercraft/lua/rom/help/create_package.hlp index 7fd7c9b..c3bbacb 100644 --- a/data/computercraft/lua/rom/help/create_package.hlp +++ b/data/computercraft/lua/rom/help/create_package.hlp @@ -124,12 +124,12 @@ For more information on publishing, see the documentation for your chosen reposi Let's create a simple package called "greeting": 1. Create the package: - >>color yellow +>>color yellow pkg init greeting - >>color white +>>color white 2. Edit package.json: - >>color yellow +>>color yellow { "name": "greeting", "version": "1.0.0", @@ -141,10 +141,10 @@ Let's create a simple package called "greeting": "sayHello": "sayHello" } } - >>color white +>>color white 3. Edit greeting.lua: - >>color yellow +>>color yellow -- greeting.lua local greeting = {} @@ -154,21 +154,21 @@ Let's create a simple package called "greeting": end return greeting - >>color white +>>color white 4. Test the package: - >>color yellow +>>color yellow -- test_greeting.lua local greeting = require("greeting") print(greeting.sayHello("User")) - >>color white +>>color white Run with: lua test_greeting.lua 5. Install the package: - >>color yellow +>>color yellow pkg install --local /packages/greeting/1.0.0/ - >>color white +>>color white Now your package is ready to use in other programs! diff --git a/data/computercraft/lua/rom/help/network.hlp b/data/computercraft/lua/rom/help/network.hlp new file mode 100644 index 0000000..84dea95 --- /dev/null +++ b/data/computercraft/lua/rom/help/network.hlp @@ -0,0 +1,66 @@ +=== Network Utility Tool === + +The `network` command provides network-related utilities for CC Tweaked, including status checking, port scanning, and device discovery. + +== Basic Usage == + +>>color yellow +network [options] +>>color white + +== Available Commands == + +- **status**: Check network status +- **scan [port_range]**: Scan ports on a device +- **discover**: Discover remote devices +- **help**: Show this help message + +== Command Options == + +- For `scan` command: + - ``: IP address of the device to scan + - `[port_range]`: Optional port range (format: start-end, default: 1-1024) + +== Usage Examples == + +1. Check network status: +>>color yellow +network status +>>color white + +2. Scan ports on a device (default 1-1024): +>>color yellow +network scan 192.168.1.1 +>>color white + +3. Scan specific port range: +>>color yellow +network scan 192.168.1.1 80-100 +>>color white + +4. Discover remote devices: +>>color yellow +network discover +>>color white + +5. Show help information: +>>color yellow +network help +>>color white + +== Key Bindings == + +- **Ctrl+T**: Cancel port scan or device discovery + +== Notes == + +- Port scanning requires HTTP to be enabled in CC Tweaked configuration +- Device discovery requires a modem to be attached to the computer +- Scanning large port ranges may take some time +- Press Ctrl+T to cancel any ongoing operation + +== Troubleshooting == + +- If port scanning fails, check if HTTP is enabled in your CC Tweaked configuration +- If device discovery doesn't find any devices, ensure your modem is properly connected and powered +- For port scanning, make sure the target device is reachable over the network \ No newline at end of file diff --git a/data/computercraft/lua/rom/help/pkg_download_en.hlp b/data/computercraft/lua/rom/help/pkg_download_en.hlp index c88b27d..725439c 100644 --- a/data/computercraft/lua/rom/help/pkg_download_en.hlp +++ b/data/computercraft/lua/rom/help/pkg_download_en.hlp @@ -20,21 +20,25 @@ The `pkg install` command supports the following options: == Usage Examples == 1. Install a package: + >>color yellow pkg install example-package >>color white 2. Force install a package: + >>color yellow pkg install --force example-package >>color white 3. Install a package with detailed information: + >>color yellow pkg install -v example-package >>color white 4. View help for `pkg install` command: + >>color yellow pkg install --help >>color white @@ -42,11 +46,13 @@ pkg install --help == Search for Packages == Before installing a package, you can search for available packages: + >>color yellow pkg search >>color white Example: + >>color yellow pkg search editor >>color white @@ -54,11 +60,13 @@ pkg search editor == View Package Information == Before installing a package, you can view detailed information about it: + >>color yellow pkg info >>color white Example: + >>color yellow pkg info example-package >>color white @@ -66,11 +74,13 @@ pkg info example-package == Update Packages == You can update installed packages using the following command: + >>color yellow pkg update >>color white If you don't specify a package name, all installed packages will be updated: + >>color yellow pkg update >>color white