Skip to content

Commit 2d5ae5e

Browse files
committed
Apply fn-name-rule to hot help.
1 parent 367e31e commit 2d5ae5e

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

hot.red

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Red []
22

3-
CURRENT_CMD: to-block system/script/args
3+
CURRENT-CMD: to-block system/script/args
44
HOTLIB-PATH: to-red-file rejoin [get-env either system/platform == 'Windows ["USERPROFILE"]["HOME"] %/.hot/]
55

66
foreach file read HOTLIB-PATH [
@@ -22,18 +22,23 @@ cmd: context [
2222
]
2323

2424
help: does [
25-
foreach [f _] to-block do cmd [
26-
print to-string rejoin ["cmd/" f]
25+
fn-name-rule: charset [#"a" - #"z" #"-"]
26+
foreach [fn _] to-block do cmd [
27+
if parse to-string fn [some fn-name-rule] [
28+
print to-string rejoin ["cmd/" fn]
29+
]
2730
]
2831
foreach file read HOTLIB-PATH [
29-
c: replace to-string file ".red" ""
30-
foreach [f _] to-block do to-word c [
31-
print to-string rejoin [c "/" f]
32+
ctx: replace to-string file ".red" ""
33+
foreach [fn _] to-block do to-word ctx [
34+
if parse to-string fn [some fn-name-rule] [
35+
print to-string rejoin [ctx "/" fn]
36+
]
3237
]
3338
]
3439
]
3540

3641
;
3742
; Main
3843
;
39-
do CURRENT_CMD
44+
do CURRENT-CMD

0 commit comments

Comments
 (0)