mirror of
https://github.com/CCLeonOS/LeonOS.git
synced 2026-03-03 06:47:00 +00:00
docs(帮助文档): 更新并新增帮助文档内容
- 修复create_package.hlp中的格式问题 - 在pkg_download_en.hlp中添加空行提高可读性 - 新增network.hlp网络工具文档 - 新增config.hlp系统配置管理文档
This commit is contained in:
84
data/computercraft/lua/rom/help/config.hlp
Normal file
84
data/computercraft/lua/rom/help/config.hlp
Normal file
@@ -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 <command> [options] [setting] [value]
|
||||
>>color white
|
||||
|
||||
== Available Commands ==
|
||||
|
||||
- **list**: List all available settings
|
||||
- **get <setting>**: Get the value of a specific setting
|
||||
- **set <setting> <value>**: Set the value of a specific setting
|
||||
- **default <setting>**: Reset a setting to its default value
|
||||
- **save**: Save current settings to file
|
||||
- **find <pattern>**: 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
|
||||
@@ -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!
|
||||
|
||||
|
||||
66
data/computercraft/lua/rom/help/network.hlp
Normal file
66
data/computercraft/lua/rom/help/network.hlp
Normal file
@@ -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 <command> [options]
|
||||
>>color white
|
||||
|
||||
== Available Commands ==
|
||||
|
||||
- **status**: Check network status
|
||||
- **scan <ip> [port_range]**: Scan ports on a device
|
||||
- **discover**: Discover remote devices
|
||||
- **help**: Show this help message
|
||||
|
||||
== Command Options ==
|
||||
|
||||
- For `scan` command:
|
||||
- `<ip>`: 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
|
||||
@@ -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 <search_keyword>
|
||||
>>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 <package_name>
|
||||
>>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 <package_name>
|
||||
>>color white
|
||||
|
||||
If you don't specify a package name, all installed packages will be updated:
|
||||
|
||||
>>color yellow
|
||||
pkg update
|
||||
>>color white
|
||||
|
||||
Reference in New Issue
Block a user