scripts/managen: the new name and home for the manpage generator
It was previously docs/cmdline-opts/gen.pl Closes #13089
This commit is contained in:
Родитель
39173f66e5
Коммит
1ccf1cd993
|
@ -29,8 +29,8 @@ transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.
|
||||||
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
|
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
|
||||||
|
|
||||||
add_custom_command(OUTPUT "${MANPAGE}"
|
add_custom_command(OUTPUT "${MANPAGE}"
|
||||||
COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && "${PERL_EXECUTABLE}" "./gen.pl" mainpage ${DPAGES} > "${MANPAGE}"
|
COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && "${PERL_EXECUTABLE}" ${PROJECT_SOURCE_DIR}/scripts/managen mainpage ${DPAGES} > "${MANPAGE}"
|
||||||
COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && "${PERL_EXECUTABLE}" "./gen.pl" ascii ${DPAGES} > "${ASCIIPAGE}"
|
COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && "${PERL_EXECUTABLE}" ${PROJECT_SOURCE_DIR}/scripts/managen ascii ${DPAGES} > "${ASCIIPAGE}"
|
||||||
VERBATIM
|
VERBATIM
|
||||||
)
|
)
|
||||||
add_custom_target(generate-curl.1 ALL DEPENDS "${MANPAGE}")
|
add_custom_target(generate-curl.1 ALL DEPENDS "${MANPAGE}")
|
||||||
|
|
|
@ -103,11 +103,16 @@ getting spellchecked by CI jobs): `%DATE`, `%VERSION` and `%GLOBALS`.
|
||||||
|
|
||||||
## Generate
|
## Generate
|
||||||
|
|
||||||
`./gen.pl mainpage`
|
`managen mainpage [list of markdown option file names]`
|
||||||
|
|
||||||
This command outputs a single huge nroff file, meant to become `curl.1`. The
|
This command outputs a single huge nroff file, meant to become `curl.1`. The
|
||||||
full curl man page.
|
full curl man page.
|
||||||
|
|
||||||
`./gen.pl listhelp`
|
`managen ascii [list of markdown option file names]`
|
||||||
|
|
||||||
|
This command outputs a single text file, meant to become `curl.txt`. The full
|
||||||
|
curl man page in text format, used to build `tool_hugehelp.c`.
|
||||||
|
|
||||||
|
`managen listhelp`
|
||||||
|
|
||||||
Generates a full `curl --help` output for all known command line options.
|
Generates a full `curl --help` output for all known command line options.
|
||||||
|
|
|
@ -31,13 +31,15 @@ man_MANS = $(MANPAGE)
|
||||||
|
|
||||||
include Makefile.inc
|
include Makefile.inc
|
||||||
|
|
||||||
EXTRA_DIST = $(DPAGES) MANPAGE.md gen.pl $(SUPPORT) CMakeLists.txt mainpage.idx
|
EXTRA_DIST = $(DPAGES) MANPAGE.md $(SUPPORT) CMakeLists.txt mainpage.idx
|
||||||
|
|
||||||
GEN = $(GN_$(V))
|
GEN = $(GN_$(V))
|
||||||
GN_0 = @echo " GENERATE" $@;
|
GN_0 = @echo " GENERATE" $@;
|
||||||
GN_1 =
|
GN_1 =
|
||||||
GN_ = $(GN_0)
|
GN_ = $(GN_0)
|
||||||
|
|
||||||
|
MANAGEN=$(abs_top_srcdir)/scripts/managen
|
||||||
|
|
||||||
if BUILD_DOCS
|
if BUILD_DOCS
|
||||||
CLEANFILES = $(MANPAGE) $(ASCIIPAGE)
|
CLEANFILES = $(MANPAGE) $(ASCIIPAGE)
|
||||||
|
|
||||||
|
@ -45,11 +47,14 @@ all: $(MANPAGE) $(ASCIIPAGE)
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(MANPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc gen.pl
|
$(MANPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc $(MANAGEN)
|
||||||
$(GEN)(rm -f $(MANPAGE) && (cd $(srcdir) && @PERL@ ./gen.pl mainpage $(DPAGES)) > manpage.tmp.$$$$ && mv manpage.tmp.$$$$ $(MANPAGE))
|
$(GEN)(rm -f $(MANPAGE) && (cd $(srcdir) && @PERL@ $(MANAGEN) mainpage $(DPAGES)) > manpage.tmp.$$$$ && mv manpage.tmp.$$$$ $(MANPAGE))
|
||||||
|
|
||||||
$(ASCIIPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc gen.pl
|
$(ASCIIPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc $(MANAGEN)
|
||||||
$(GEN)(rm -f $(ASCIIPAGE) && (cd $(srcdir) && @PERL@ ./gen.pl ascii $(DPAGES)) > asciipage.tmp.$$$$ && mv asciipage.tmp.$$$$ $(ASCIIPAGE))
|
$(GEN)(rm -f $(ASCIIPAGE) && (cd $(srcdir) && @PERL@ $(MANAGEN) ascii $(DPAGES)) > asciipage.tmp.$$$$ && mv asciipage.tmp.$$$$ $(ASCIIPAGE))
|
||||||
|
|
||||||
listhelp:
|
listhelp:
|
||||||
./gen.pl listhelp $(DPAGES) > $(top_builddir)/src/tool_listhelp.c
|
$(MANAGEN) listhelp $(DPAGES) > $(top_builddir)/src/tool_listhelp.c
|
||||||
|
|
||||||
|
listcats:
|
||||||
|
@$(MANAGEN) listcats $(DPAGES)
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
###########################################################################
|
###########################################################################
|
||||||
|
|
||||||
EXTRA_DIST = coverage.sh completion.pl firefox-db2pem.sh checksrc.pl \
|
EXTRA_DIST = coverage.sh completion.pl firefox-db2pem.sh checksrc.pl \
|
||||||
mk-ca-bundle.pl schemetable.c cd2nroff nroff2cd cdall cd2cd
|
mk-ca-bundle.pl schemetable.c cd2nroff nroff2cd cdall cd2cd managen
|
||||||
|
|
||||||
ZSH_FUNCTIONS_DIR = @ZSH_FUNCTIONS_DIR@
|
ZSH_FUNCTIONS_DIR = @ZSH_FUNCTIONS_DIR@
|
||||||
FISH_FUNCTIONS_DIR = @FISH_FUNCTIONS_DIR@
|
FISH_FUNCTIONS_DIR = @FISH_FUNCTIONS_DIR@
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
This script generates the manpage.
|
This script generates the manpage.
|
||||||
|
|
||||||
Example: gen.pl <command> [files] > curl.1
|
Example: managen <command> [files] > curl.1
|
||||||
|
|
||||||
Dev notes:
|
Dev notes:
|
||||||
|
|
||||||
|
@ -1031,7 +1031,7 @@ sub mainpage {
|
||||||
.\\" *
|
.\\" *
|
||||||
.\\" **************************************************************************
|
.\\" **************************************************************************
|
||||||
.\\"
|
.\\"
|
||||||
.\\" DO NOT EDIT. Generated by the curl project gen.pl man page generator.
|
.\\" DO NOT EDIT. Generated by the curl project managen man page generator.
|
||||||
.\\"
|
.\\"
|
||||||
.TH curl 1 "$date" "curl $version" "curl Manual"
|
.TH curl 1 "$date" "curl $version" "curl Manual"
|
||||||
HEADER
|
HEADER
|
||||||
|
@ -1108,7 +1108,7 @@ sub getargs {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
print "Usage: gen.pl <mainpage/ascii/listhelp/single FILE/protos/listcats> [files]\n";
|
print "Usage: managen <mainpage/ascii/listhelp/single FILE/protos/listcats> [files]\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
|
@ -40,8 +40,7 @@ struct helptxt {
|
||||||
/*
|
/*
|
||||||
* The bitmask output is generated with the following command
|
* The bitmask output is generated with the following command
|
||||||
------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
cd $srcroot/docs/cmdline-opts
|
make -C docs/cmdline-opts listcats
|
||||||
./gen.pl listcats *.d
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CURLHELP_HIDDEN 1u << 0u
|
#define CURLHELP_HIDDEN 1u << 0u
|
||||||
|
|
|
@ -19,7 +19,7 @@ src/tool_listhelp.c is in sync with docs/cmdline-opts
|
||||||
</name>
|
</name>
|
||||||
|
|
||||||
<command type="perl">
|
<command type="perl">
|
||||||
%SRCDIR/../docs/cmdline-opts/gen.pl listhelp %SRCDIR/../docs/cmdline-opts/*.md
|
%SRCDIR/../scripts/managen listhelp %SRCDIR/../docs/cmdline-opts/*.md
|
||||||
</command>
|
</command>
|
||||||
</client>
|
</client>
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче