Skip to content

Commit 43147da

Browse files
committed
docs(config): add example
1 parent 3991996 commit 43147da

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
/target
1313

1414
.env
15-
config.ron
15+
*.ron
16+
!example.ron
1617
test/*
1718
.vscode

example.ron

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Configuration(
2+
practice: (
3+
lab_categories: [
4+
(
5+
id: "classical",
6+
name: [
7+
(
8+
language: "en-US",
9+
text: "Classical"
10+
),
11+
(
12+
language: "zh-CN",
13+
text: "古典密码学"
14+
)
15+
],
16+
labs: [
17+
(
18+
id: "affine",
19+
resources: [
20+
(
21+
language: "zh-CN",
22+
name: "仿射加密",
23+
resource: "practice/classical/affine/zh.md"
24+
)
25+
],
26+
endpoints: [
27+
(
28+
host: "localhost",
29+
port: 10020
30+
),
31+
(
32+
host: "192.168.16.128",
33+
port: 10020
34+
),
35+
]
36+
)
37+
]
38+
)
39+
]
40+
)
41+
)

src/opts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub struct Opt {
1313
pub log_level: u32,
1414

1515
/// configuration file's, check example for more details
16-
#[structopt(default_value = "config.toml", env = "CONFIG", parse(from_os_str))]
16+
#[structopt(default_value = "config.ron", env = "CONFIG", parse(from_os_str))]
1717
pub config: PathBuf,
1818

1919
/// static file path to be serve

0 commit comments

Comments
 (0)