📄 mkapidoc.sh
字号:
#!/bin/bash################################################################################## mkapidoc.sh -- generate apidoc.fnc from scanning the Perl source################################################################################### $Revision: 10 $# $Author: mhx $# $Date: 2007/08/12 11:50:36 +0200 $################################################################################### Version 3.x, Copyright (C) 2004-2007, Marcus Holland-Moritz.# Version 2.x, Copyright (C) 2001, Paul Marquess.# Version 1.x, Copyright (C) 1999, Kenneth Albanowski.## This program is free software; you can redistribute it and/or# modify it under the same terms as Perl itself.#################################################################################function isperlroot{ [ -f "$1/embed.fnc" ] && [ -f "$1/perl.h" ]}function usage{ echo "USAGE: $0 [perlroot] [output-file] [embed.fnc]" exit 0}if [ -z "$1" ]; then if isperlroot "../../.."; then PERLROOT=../../.. else PERLROOT=. fielse PERLROOT=$1fiif [ -z "$2" ]; then if [ -f "parts/apidoc.fnc" ]; then OUTPUT="parts/apidoc.fnc" else usage fielse OUTPUT=$2fiif [ -z "$3" ]; then if [ -f "parts/embed.fnc" ]; then EMBED="parts/embed.fnc" else usage fielse EMBED=$3fiif isperlroot $PERLROOT; then cat >$OUTPUT <<EOF:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: !!!!! Do NOT edit this file directly! -- Edit PPPort_pm.PL instead. !!!!!:: This file was automatically generated from the API documentation scattered: all over the Perl source code. To learn more about how all this works,: please read the F<HACKERS> file that came with this distribution.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: This file lists all API functions/macros that are documented in the Perl: source code, but are not contained in F<embed.fnc>.:EOF grep -hr '^=for apidoc' $PERLROOT | sed -e 's/=for apidoc //' | grep '|' | sort | uniq \ | perl -e'$f=pop;open(F,$f)||die"$f:$!";while(<F>){(split/\|/)[2]=~/(\w+)/;$h{$1}++} while(<>){s/[ \t]+$//;(split/\|/)[2]=~/(\w+)/;$h{$1}||print}' $EMBED >>$OUTPUTelse usagefi
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -