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:
Daniel Stenberg 2024-03-08 11:22:12 +01:00
Родитель 39173f66e5
Коммит 1ccf1cd993
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 5CC908FDB71E12C2
7 изменённых файлов: 26 добавлений и 17 удалений

Просмотреть файл

@ -29,8 +29,8 @@ transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
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}" "./gen.pl" ascii ${DPAGES} > "${ASCIIPAGE}"
COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && "${PERL_EXECUTABLE}" ${PROJECT_SOURCE_DIR}/scripts/managen mainpage ${DPAGES} > "${MANPAGE}"
COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && "${PERL_EXECUTABLE}" ${PROJECT_SOURCE_DIR}/scripts/managen ascii ${DPAGES} > "${ASCIIPAGE}"
VERBATIM
)
add_custom_target(generate-curl.1 ALL DEPENDS "${MANPAGE}")

Просмотреть файл

@ -103,11 +103,16 @@ getting spellchecked by CI jobs): `%DATE`, `%VERSION` and `%GLOBALS`.
## 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
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.

Просмотреть файл

@ -31,13 +31,15 @@ man_MANS = $(MANPAGE)
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))
GN_0 = @echo " GENERATE" $@;
GN_1 =
GN_ = $(GN_0)
MANAGEN=$(abs_top_srcdir)/scripts/managen
if BUILD_DOCS
CLEANFILES = $(MANPAGE) $(ASCIIPAGE)
@ -45,11 +47,14 @@ all: $(MANPAGE) $(ASCIIPAGE)
endif
$(MANPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc gen.pl
$(GEN)(rm -f $(MANPAGE) && (cd $(srcdir) && @PERL@ ./gen.pl mainpage $(DPAGES)) > manpage.tmp.$$$$ && mv manpage.tmp.$$$$ $(MANPAGE))
$(MANPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc $(MANAGEN)
$(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
$(GEN)(rm -f $(ASCIIPAGE) && (cd $(srcdir) && @PERL@ ./gen.pl ascii $(DPAGES)) > asciipage.tmp.$$$$ && mv asciipage.tmp.$$$$ $(ASCIIPAGE))
$(ASCIIPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc $(MANAGEN)
$(GEN)(rm -f $(ASCIIPAGE) && (cd $(srcdir) && @PERL@ $(MANAGEN) ascii $(DPAGES)) > asciipage.tmp.$$$$ && mv asciipage.tmp.$$$$ $(ASCIIPAGE))
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 \
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@
FISH_FUNCTIONS_DIR = @FISH_FUNCTIONS_DIR@

Просмотреть файл

@ -27,7 +27,7 @@
This script generates the manpage.
Example: gen.pl <command> [files] > curl.1
Example: managen <command> [files] > curl.1
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"
HEADER
@ -1108,7 +1108,7 @@ sub getargs {
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
------------------------------------------------------------
cd $srcroot/docs/cmdline-opts
./gen.pl listcats *.d
make -C docs/cmdline-opts listcats
*/
#define CURLHELP_HIDDEN 1u << 0u

Просмотреть файл

@ -19,7 +19,7 @@ src/tool_listhelp.c is in sync with docs/cmdline-opts
</name>
<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>
</client>