aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md9
-rw-r--r--src/moonp.cpp4
2 files changed, 10 insertions, 3 deletions
diff --git a/README.md b/README.md
index 66ce7f0..4f3cdf8 100644
--- a/README.md
+++ b/README.md
@@ -67,7 +67,7 @@ Usage: moonp [options|files|directories] ...
67 -e str Execute a file or raw codes 67 -e str Execute a file or raw codes
68 -t path Specify where to place compiled files 68 -t path Specify where to place compiled files
69 -o file Write output to file 69 -o file Write output to file
70 -s Use space in generated codes instead of tabs 70 -s Use spaces in generated codes instead of tabs
71 -m Generate minified codes 71 -m Generate minified codes
72 -p Write output to standard out 72 -p Write output to standard out
73 -b Dump compile time (doesn't write output) 73 -b Dump compile time (doesn't write output)
@@ -79,6 +79,13 @@ Usage: moonp [options|files|directories] ...
79 Execute without options to enter REPL, type symbol '$' 79 Execute without options to enter REPL, type symbol '$'
80 in a single line to start/stop multi-line mode 80 in a single line to start/stop multi-line mode
81``` 81```
82  Use cases:
83  Recursively compile every moon file under current path: `moonp .`
84  Compile and save results to a target path: `moonp -t /target/path/ .`
85  Compile and reserve debug info: `moonp -l .`
86  Compile and generate minified codes: `moonp -m .`
87  Execute raw codes: `moonp -e 'print 123'`
88  Execute a moon file: `moonp -e main.moon`
82 89
83 90
84 91
diff --git a/src/moonp.cpp b/src/moonp.cpp
index 57c3d6d..e056aad 100644
--- a/src/moonp.cpp
+++ b/src/moonp.cpp
@@ -94,7 +94,7 @@ int main(int narg, const char** args) {
94" -e str Execute a file or raw codes\n" 94" -e str Execute a file or raw codes\n"
95" -t path Specify where to place compiled files\n" 95" -t path Specify where to place compiled files\n"
96" -o file Write output to file\n" 96" -o file Write output to file\n"
97" -s Use space in generated codes instead of tabs\n" 97" -s Use spaces in generated codes instead of tabs\n"
98" -m Generate minified codes\n" 98" -m Generate minified codes\n"
99" -p Write output to standard out\n" 99" -p Write output to standard out\n"
100" -b Dump compile time (doesn't write output)\n" 100" -b Dump compile time (doesn't write output)\n"
@@ -501,7 +501,7 @@ int main(int narg, const char** args) {
501 std::ofstream output(file, std::ios::trunc | std::ios::out); 501 std::ofstream output(file, std::ios::trunc | std::ios::out);
502 output.write(minifiedCodes, size); 502 output.write(minifiedCodes, size);
503 output.close(); 503 output.close();
504 std::cout << "Built Minified "sv << file << '\n'; 504 std::cout << "Minified built "sv << file << '\n';
505 } 505 }
506 } else { 506 } else {
507 ret = 2; 507 ret = 2;