diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2017-08-07 13:54:57 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2017-08-29 08:02:53 +0000 |
commit | 69a797434c2e90cda9ac0a4271edd7c79270b2fa (patch) | |
tree | 9d46ddf067a36bb6ff67227a15891ae376dead27 /doc/man/man.qbs | |
parent | 16fd248b6169c89bfb9e7525b5c8bd061418f0b6 (diff) |
Add a minimal man page
It contains the list of commands and a link to our online documentation.
Auto-generated via GNU's help2man from the application's help output.
[ChangeLog] Added a man page
Change-Id: Ie7101b0941f466642d7ec89a12c4e490d6d0e16f
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'doc/man/man.qbs')
-rw-r--r-- | doc/man/man.qbs | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/doc/man/man.qbs b/doc/man/man.qbs new file mode 100644 index 000000000..99db2b3f8 --- /dev/null +++ b/doc/man/man.qbs @@ -0,0 +1,66 @@ +import qbs +import qbs.File +import qbs.FileInfo +import qbs.Probes +import qbs.Utilities + +Product { + name: "qbs man page" + type: ["manpage"] + + Depends { name: "qbs_app"; condition: updateManPage } + Depends { name: "qbsbuildconfig" } + + property bool updateManPage: false + property string help2ManFilePath: help2ManProbe.filePath + + Group { + name: "man page" + files: ["qbs.1"] + qbs.install: qbsbuildconfig.installManPage + qbs.installDir: "share/man/man1" + } + + Group { + name: "additional sections" + files: ["see-also.h2m"] + fileTags: ["man.section"] + } + + Rule { + condition: updateManPage + multiplex: true + explicitlyDependsOn: ["application"] + inputs: ["man.section"] + Artifact { + filePath: "qbs.1" + fileTags: ["manpage"] + } + prepare: { + var help2ManExe = product.help2ManFilePath; + if (!help2ManExe) + throw "Cannot update man page: help2man not available"; + if (Utilities.versionCompare(product.qbs.version, "1.9") < 0) + throw "Cannot update man page: qbs >= 1.9 required"; + var args = [explicitlyDependsOn.application[0].filePath, "-o", output.filePath, + "--no-info", "--name=the Qbs build tool"]; + var sections = inputs ? inputs["man.section"] : []; + for (var i = 0; i < sections.length; ++i) + args.push("--include=" + sections[i].filePath); + var help2ManCmd = new Command(help2ManExe, args); + help2ManCmd.description = "creating man page"; + var copyCmd = new JavaScriptCommand(); + copyCmd.silent = true; + copyCmd.sourceCode = function() { + File.copy(output.filePath, + FileInfo.joinPaths(product.sourceDirectory, output.fileName)); + } + return [help2ManCmd, copyCmd]; + } + } + + Probes.BinaryProbe { + id: help2ManProbe + names: ["help2man"] + } +} |