{"id":91859,"date":"2024-03-28T06:52:11","date_gmt":"2024-03-27T22:52:11","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=91859"},"modified":"2024-03-28T06:52:11","modified_gmt":"2024-03-27T22:52:11","slug":"code-searching-pss","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/code-searching-pss.html","title":{"rendered":"\u4f7f\u7528 pss \u641c\u7d22\u4f60\u7684\u4ee3\u7801"},"content":{"rendered":"

\u641c\u7d22\u4ee3\u7801\u5e93\u662f\u5f00\u53d1\u8005\u6bcf\u5929\u90fd\u8981\u505a\u7684\u4e8b\u60c5\u3002\u4ece\u4fee\u6539 bug \u5230\u5b66\u4e60\u65b0\u4ee3\u7801\uff0c\u6216\u8005\u67e5\u770b\u5982\u4f55\u8c03\u7528\u67d0\u4e2a API\uff0c\u80fd\u5feb\u901f\u5728\u4ee3\u7801\u5e93\u4e2d\u5bfc\u822a\u7684\u80fd\u529b\u90fd\u662f\u4e00\u5927\u52a9\u529b\u3002\u5e78\u8fd0\u7684\u662f\uff0c\u6211\u4eec\u6709\u4e13\u95e8\u7684\u5de5\u5177\u6765\u641c\u7d22\u4ee3\u7801\u3002pss<\/a>[1]<\/span> \u5c31\u662f\u5176\u4e2d\u4e00\u4e2a\u5de5\u5177\uff0c\u8ba9\u6211\u4eec\u6765\u770b\u770b\u5982\u4f55\u5b89\u88c5\u548c\u4f7f\u7528\u5b83\u5427\u3002<\/p>\n

\u4ec0\u4e48\u662f pss\uff1f<\/strong><\/div>\n

pss<\/span> \u662f\u4e00\u4e2a\u5e2e\u4f60\u5728\u6e90\u4ee3\u7801\u6587\u4ef6\u4e2d\u8fdb\u884c\u641c\u7d22\u7684\u547d\u4ee4\u884c\u5de5\u5177\u3002pss<\/span> \u9012\u5f52\u5730\u5728\u76ee\u5f55\u6811\u4e2d\u8fdb\u884c\u641c\u7d22\uff0c\u5b83\u80fd\u81ea\u52a8\u6839\u636e\u6587\u4ef6\u540d\u548c\u540e\u7f00\u5224\u65ad\u54ea\u4e9b\u6587\u4ef6\u9700\u8981\u641c\u7d22\uff0c\u54ea\u4e9b\u6587\u4ef6\u4e0d\u9700\u641c\u7d22\uff0c\u5e76\u4e14\u4f1a\u81ea\u52a8\u8df3\u8fc7\u90a3\u4e9b\u4f60\u4e0d\u4f1a\u60f3\u641c\u7d22\u7684\u76ee\u5f55\uff08\u6bd4\u5982 .svn<\/span> \u548c .git<\/span>\uff09\uff0c\u8fd8\u80fd\u7528\u8272\u5f69\u6e32\u67d3\u8f93\u51fa\u4ee5\u65b9\u4fbf\u4eba\u4eec\u9605\u8bfb\uff0c\u4ee5\u53ca\u5176\u4ed6\u5f88\u591a\u529f\u80fd\u3002<\/p>\n

\u5b89\u88c5 pss<\/strong><\/div>\n

\u4f7f\u7528\u4e0b\u9762\u547d\u4ee4\u5728 Fedora \u4e0a\u5b89\u88c5 pss<\/span>\uff1a<\/p>\n

 $ dnf install pss\r\n<\/pre>\n

\u5b89\u88c5\u597d\u540e\u5c31\u80fd\u5728\u7ec8\u7aef\u8c03\u7528 pss<\/span> \u4e86\uff1a<\/p>\n

 $ pss\r\n<\/pre>\n

\u4e0d\u5e26\u53c2\u6570\u8c03\u7528 pss<\/span> \u6216\u8005\u5e26\u4e0a -h<\/span> \u6807\u5fd7\u4f1a\u8f93\u51fa\u8be6\u7ec6\u7684\u4f7f\u7528\u8bf4\u660e\u3002<\/p>\n

\u4f7f\u7528\u6848\u4f8b<\/strong><\/div>\n

\u73b0\u5728\u4f60\u5b89\u88c5\u597d pss<\/span> \u4e86\uff0c\u4e0b\u9762\u6765\u770b\u4e00\u4e9b\u4f8b\u5b50\u5427\u3002<\/p>\n

 $ pss foo\r\n<\/pre>\n

\u8be5\u547d\u4ee4\u53ea\u662f\u7b80\u5355\u7684\u641c\u7d22 foo<\/span>\u3002\u4f60\u4e5f\u53ef\u4ee5\u9650\u5236 pss<\/span> \u8ba9\u5b83\u53ea\u5728 python \u6587\u4ef6\u4e2d\u641c\u7d22 foo<\/span>\uff1a<\/p>\n

 $ pss foo --py\r\n<\/pre>\n

\u8fd8\u80fd\u5728\u975e python \u6587\u4ef6\u4e2d\u641c\u7d22 bar<\/span>\uff1a<\/p>\n

 $ pss bar --nopy\r\n<\/pre>\n

\u800c\u4e14\uff0cpss<\/span> \u652f\u6301\u5927\u591a\u6570\u5e38\u89c1\u7684\u6e90\u4ee3\u7801\u6587\u4ef6\u7c7b\u578b\uff0c\u8981\u83b7\u53d6\u5b8c\u6574\u7684\u652f\u6301\u5217\u8868\uff0c\u6267\u884c\uff1a<\/p>\n

$ pss --help-types\r\n<\/pre>\n

\u4f60\u8fd8\u80fd\u6307\u5b9a\u5ffd\u7565\u67d0\u4e9b\u76ee\u5f55\u4e0d\u8fdb\u884c\u641c\u7d22\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cpss<\/span> \u4f1a\u5ffd\u7565\u7c7b\u4f3c.git<\/span>\uff0c__pycache__<\/span>\uff0c.metadata<\/span> \u7b49\u76ee\u5f55\u3002<\/p>\n

$ pss foo --py --ignore-dir=dist\r\n<\/pre>\n

\u6b64\u5916\uff0cpss<\/span> \u8fd8\u80fd\u663e\u793a\u641c\u7d22\u7ed3\u679c\u7684\u4e0a\u4e0b\u6587\u3002<\/p>\n

$ pss -A 5 foo\r\n<\/pre>\n

\u4f1a\u663e\u793a\u5339\u914d\u7ed3\u679c\u7684\u540e\u9762 5 \u884c\u5185\u5bb9\u3002<\/p>\n

$ pss -B 5 foo\r\n<\/pre>\n

\u4f1a\u663e\u793a\u5339\u914d\u7ed3\u679c\u7684\u524d\u9762 5 \u884c\u5185\u5bb9\u3002<\/p>\n

$ pss -C 5 foo\r\n<\/pre>\n

\u4f1a\u663e\u793a\u5339\u914d\u7ed3\u679c\u7684\u524d\u540e\u5404 5 \u884c\u5185\u5bb9\u3002<\/p>\n

\u5982\u679c\u4f60\u60f3\u77e5\u9053\u5982\u4f55\u4f7f\u7528 pss<\/span> \u8fdb\u884c\u6b63\u5219\u8868\u8fbe\u5f0f\u641c\u7d22\u4ee5\u53ca\u5b83\u7684\u5176\u4ed6\u9009\u9879\u7684\u8bdd\uff0c\u53ef\u4ee5\u5728\u8fd9\u91cc<\/a>[2]<\/span>\u770b\u5230\u66f4\u591a\u7684\u4f8b\u5b50\u3002<\/p>\n


\n

via: https:\/\/fedoramagazine.org\/improve-code-searching-skills-pss\/<\/a><\/p>\n

\u4f5c\u8005\uff1aCl\u00e9ment Verna<\/a>[3]<\/span> \u8bd1\u8005\uff1alujun9972<\/a>[4]<\/span> \u6821\u5bf9\uff1awxy<\/a>[5]<\/span><\/p>\n

\u672c\u6587\u7531 LCTT<\/a>[6]<\/span> \u539f\u521b\u7f16\u8bd1\uff0cLinux\u4e2d\u56fd<\/a>[7]<\/span> \u8363\u8a89\u63a8\u51fa<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/linux.cn\/article-9187-1.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/code-searching-pss.html<\/a>\u7f16\u8f91\uff1a\u9004\u589e\u5b9d\uff0c\u5ba1\u6838\u5458\uff1a\u5218\u9044<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u641c\u7d22\u4ee3\u7801\u5e93\u662f\u5f00\u53d1\u8005\u6bcf\u5929\u90fd\u8981\u505a\u7684\u4e8b\u60c5\u3002\u4ece\u4fee\u6539 bug \u5230\u5b66\u4e60\u65b0\u4ee3\u7801\uff0c\u6216\u8005\u67e5\u770b\u5982\u4f55\u8c03\u7528\u67d0\u4e2a API\uff0c\u80fd\u5feb\u901f\u5728\u4ee3\u7801\u5e93 […]<\/p>\n","protected":false},"author":309,"featured_media":91861,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-91859","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/91859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/309"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=91859"}],"version-history":[{"count":5,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/91859\/revisions"}],"predecessor-version":[{"id":290566,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/91859\/revisions\/290566"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/91861"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=91859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=91859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=91859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}