diff --git a/devel/216_50.md b/devel/216_50.md new file mode 100644 index 00000000..aaf7894d --- /dev/null +++ b/devel/216_50.md @@ -0,0 +1,31 @@ +# [216_50] 修改gf doc和source的提示文档 + +## 如何测试 +`bin/gf` +输出 +相关的输出修改为 +``` + source ORG/LIB Print the exact source of ORG/LIB from current *load-path* + Reads the real library file, not tests/ or generated docs + Example: gf source liii/path + doc ORG/LIB Show the library overview for ORG/LIB from tests/ + Usually reads tests/ORG/LIB-test.scm + Example: gf doc liii/path + doc ORG/LIB FUNC Show the function doc/test file for FUNC under a specific library + Best when you already know the library, or the name is ambiguous + Example: gf doc liii/path "path-read-text" + Quote FUNC for names like "bag-delete!", "path?", "alist->fxmapping", or "bag<=?" + This preserves symbols such as ! ? > < and keeps FUNC as one shell argument + doc FUNC Search visible libraries for exported FUNC, then show its doc/test file + If multiple libraries export it, candidates are listed + Example: gf doc "string-split" + Quote FUNC for names like "bag-delete!", "path?", "alist->fxmapping", or "bag<=?" + This keeps shell-sensitive symbols intact and makes it clear FUNC is one argument + doc --build-json Rebuild tests/function-library-index.json for global gf doc FUNC lookup + Needed by function-name search and fuzzy suggestions + Run this after changing exports, or before packaging +``` + + + +## 2026/04/03 修改gf doc和source的提示文档 diff --git a/src/goldfish.hpp b/src/goldfish.hpp index 34320f65..dd1bf862 100644 --- a/src/goldfish.hpp +++ b/src/goldfish.hpp @@ -3382,10 +3382,25 @@ display_help () { cout << " fix [options] PATH Format PATH (PATH can be a .scm file or directory)" << endl; cout << " Options:" << endl; cout << " --dry-run Print formatted result to stdout" << endl; - cout << " source ORG/LIB Display exact library source from *load-path*" << endl; - cout << " doc ORG/LIB Display exact library documentation from tests/" << endl; - cout << " doc FUNC Display exact function documentation from tests/" << endl; - cout << " doc --build-json Rebuild function-library-index.json under tests/" << endl; + cout << " source ORG/LIB Print the exact source of ORG/LIB from current *load-path*" << endl; + cout << " Reads the real library file, not tests/ or generated docs" << endl; + cout << " Example: gf source liii/path" << endl; + cout << " doc ORG/LIB Show the library overview for ORG/LIB from tests/" << endl; + cout << " Usually reads tests/ORG/LIB-test.scm" << endl; + cout << " Example: gf doc liii/path" << endl; + cout << " doc ORG/LIB FUNC Show the function doc/test file for FUNC under a specific library" << endl; + cout << " Best when you already know the library, or the name is ambiguous" << endl; + cout << " Example: gf doc liii/path \"path-read-text\"" << endl; + cout << " Quote FUNC for names like \"bag-delete!\", \"path?\", \"alist->fxmapping\", or \"bag<=?\"" << endl; + cout << " This preserves symbols such as ! ? > < and keeps FUNC as one shell argument" << endl; + cout << " doc FUNC Search visible libraries for exported FUNC, then show its doc/test file" << endl; + cout << " If multiple libraries export it, candidates are listed" << endl; + cout << " Example: gf doc \"string-split\"" << endl; + cout << " Quote FUNC for names like \"bag-delete!\", \"path?\", \"alist->fxmapping\", or \"bag<=?\"" << endl; + cout << " This keeps shell-sensitive symbols intact and makes it clear FUNC is one argument" << endl; + cout << " doc --build-json Rebuild tests/function-library-index.json for global gf doc FUNC lookup" << endl; + cout << " Needed by function-name search and fuzzy suggestions" << endl; + cout << " Run this after changing exports, or before packaging" << endl; cout << " test [PATTERN] Run tests (all *-test.scm files under tests/)" << endl; cout << " PATTERN can be:" << endl; cout << " (none) Run all tests" << endl;