-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathextract_shell_modules.sh
More file actions
executable file
·57 lines (52 loc) · 2.18 KB
/
extract_shell_modules.sh
File metadata and controls
executable file
·57 lines (52 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
# Shell Modularization Helper Script
# This script helps extract the remaining pieces from shell.c
SRC_DIR="c_files/src"
INC_DIR="c_files/includes"
SHELL_SRC="$SRC_DIR/shell"
SHELL_INC="$INC_DIR/shell"
echo "=== Shell Modularization Helper ==="
echo ""
echo "Status:"
echo " ✅ shell_core.c - DONE (path helpers, tokenizer, resolver)"
echo " ✅ shell_cmds.c - DONE (17 built-in commands)"
echo " ✅ shell_stdlib.c - DONE (gui.ros, math.ros, io.ros)"
echo " ✅ shell_new.c - DONE (state, init, REPL, builtin table)"
echo " 📝 shell_apps.c - TODO (extract RXT_ROS, TERM_ROS, PAINT_ROS, cmd_setup)"
echo " 📝 shell_sample.c - TODO (extract sample_*, cmd_sample, cmd_microui)"
echo ""
# Check what exists
echo "Checking existing files..."
[ -f "$SHELL_SRC/shell_core.c" ] && echo " ✓ shell_core.c exists"
[ -f "$SHELL_SRC/shell_cmds.c" ] && echo " ✓ shell_cmds.c exists"
[ -f "$SHELL_SRC/shell_stdlib.c" ] && echo " ✓ shell_stdlib.c exists"
[ -f "$SRC_DIR/shell_new.c" ] && echo " ✓ shell_new.c exists (ready to replace shell.c)"
echo ""
echo "To complete modularization:"
echo ""
echo "1. Extract shell_apps.c:"
echo " - Copy RXT_ROS, TERM_ROS, PAINT_ROS constants from shell.c"
echo " - Copy cmd_setup() function"
echo " - Add: #include \"shell/shell_apps.h\""
echo ""
echo "2. Extract shell_sample.c:"
echo " - Copy all sample_* constants (hello, strings, math, fib, loops, funcs, gui, mu, test)"
echo " - Copy struct sample_entry and sample_table[]"
echo " - Copy cmd_sample() and cmd_microui() functions"
echo " - Add: #include \"shell/shell_sample.h\""
echo ""
echo "3. Replace shell.c:"
echo " mv $SRC_DIR/shell.c $SRC_DIR/shell.c.backup"
echo " mv $SRC_DIR/shell_new.c $SRC_DIR/shell.c"
echo ""
echo "4. Update CMakeLists.txt to include:"
echo " c_files/src/shell/shell.c"
echo " c_files/src/shell/shell_core.c"
echo " c_files/src/shell/shell_cmds.c"
echo " c_files/src/shell/shell_stdlib.c"
echo " c_files/src/shell/shell_apps.c"
echo " c_files/src/shell/shell_sample.c"
echo ""
echo "5. Update shell.h (see SHELL_MODULARIZATION.md for template)"
echo ""
echo "See SHELL_MODULARIZATION.md for detailed structure and line counts."