autogenerate and install a UNIX man page
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -62,6 +62,7 @@ OpenRA.Launcher.Mac/OpenRA.xcodeproj/*.mode1v3
|
|||||||
DOCUMENTATION.md
|
DOCUMENTATION.md
|
||||||
Lua-API.md
|
Lua-API.md
|
||||||
*.html
|
*.html
|
||||||
|
openra.6
|
||||||
|
|
||||||
# StyleCop
|
# StyleCop
|
||||||
*.Cache
|
*.Cache
|
||||||
|
|||||||
9
Makefile
9
Makefile
@@ -58,6 +58,7 @@ endif
|
|||||||
prefix ?= /usr/local
|
prefix ?= /usr/local
|
||||||
datarootdir ?= $(prefix)/share
|
datarootdir ?= $(prefix)/share
|
||||||
datadir ?= $(datarootdir)
|
datadir ?= $(datarootdir)
|
||||||
|
mandir ?= $(datarootdir)/man/
|
||||||
bindir ?= $(prefix)/bin
|
bindir ?= $(prefix)/bin
|
||||||
libdir ?= $(prefix)/lib
|
libdir ?= $(prefix)/lib
|
||||||
gameinstalldir ?= $(libdir)/openra
|
gameinstalldir ?= $(libdir)/openra
|
||||||
@@ -320,6 +321,9 @@ docs: utility mods version
|
|||||||
@mono --debug OpenRA.Utility.exe all --docs > DOCUMENTATION.md
|
@mono --debug OpenRA.Utility.exe all --docs > DOCUMENTATION.md
|
||||||
@mono --debug OpenRA.Utility.exe ra --lua-docs > Lua-API.md
|
@mono --debug OpenRA.Utility.exe ra --lua-docs > Lua-API.md
|
||||||
|
|
||||||
|
man-page: utility mods
|
||||||
|
@mono --debug OpenRA.Utility.exe all --man-page > openra.6
|
||||||
|
|
||||||
install: install-core
|
install: install-core
|
||||||
|
|
||||||
install-all: install-core install-tools
|
install-all: install-core install-tools
|
||||||
@@ -389,6 +393,10 @@ install-linux-appdata:
|
|||||||
@$(INSTALL_DIR) "$(DESTDIR)$(datadir)/appdata/"
|
@$(INSTALL_DIR) "$(DESTDIR)$(datadir)/appdata/"
|
||||||
@$(INSTALL_DATA) packaging/linux/openra.appdata.xml "$(DESTDIR)$(datadir)/appdata/"
|
@$(INSTALL_DATA) packaging/linux/openra.appdata.xml "$(DESTDIR)$(datadir)/appdata/"
|
||||||
|
|
||||||
|
install-man-page: man-page
|
||||||
|
@$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man6/"
|
||||||
|
@$(INSTALL_DATA) openra.6 "$(DESTDIR)$(mandir)/man6/"
|
||||||
|
|
||||||
install-linux-scripts:
|
install-linux-scripts:
|
||||||
@echo "#!/bin/sh" > openra
|
@echo "#!/bin/sh" > openra
|
||||||
@echo 'cd "$(gameinstalldir)"' >> openra
|
@echo 'cd "$(gameinstalldir)"' >> openra
|
||||||
@@ -419,6 +427,7 @@ uninstall:
|
|||||||
@-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/128x128/apps/openra.png"
|
@-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/128x128/apps/openra.png"
|
||||||
@-$(RM_F) "$(DESTDIR)$(datadir)/mime/packages/openra.xml"
|
@-$(RM_F) "$(DESTDIR)$(datadir)/mime/packages/openra.xml"
|
||||||
@-$(RM_F) "$(DESTDIR)$(datadir)/appdata/openra.appdata.xml"
|
@-$(RM_F) "$(DESTDIR)$(datadir)/appdata/openra.appdata.xml"
|
||||||
|
@-$(RM_F) "$(DESTDIR)$(mandir)/man6/openra.6"
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo to compile, run:
|
@echo to compile, run:
|
||||||
|
|||||||
@@ -23,23 +23,55 @@ namespace OpenRA
|
|||||||
|
|
||||||
public class ServerSettings
|
public class ServerSettings
|
||||||
{
|
{
|
||||||
|
[Desc("Sets the server name.")]
|
||||||
public string Name = "OpenRA Game";
|
public string Name = "OpenRA Game";
|
||||||
|
|
||||||
|
[Desc("Sets the internal port.")]
|
||||||
public int ListenPort = 1234;
|
public int ListenPort = 1234;
|
||||||
|
|
||||||
|
[Desc("Sets the port advertised to the master server.")]
|
||||||
public int ExternalPort = 1234;
|
public int ExternalPort = 1234;
|
||||||
|
|
||||||
|
[Desc("Reports the game to the master server list.")]
|
||||||
public bool AdvertiseOnline = true;
|
public bool AdvertiseOnline = true;
|
||||||
|
|
||||||
|
[Desc("Locks the game with a password.")]
|
||||||
public string Password = "";
|
public string Password = "";
|
||||||
|
|
||||||
public string MasterServer = "http://master.openra.net/";
|
public string MasterServer = "http://master.openra.net/";
|
||||||
public bool DiscoverNatDevices = false; // Allow users to disable NAT discovery if problems occur
|
|
||||||
public bool AllowPortForward = true; // let the user disable it even if compatible devices are found
|
[Desc("Allow users to enable NAT discovery for external IP detection and automatic port forwarding.")]
|
||||||
|
public bool DiscoverNatDevices = false;
|
||||||
|
|
||||||
|
[Desc("Set this to false to disable UPnP even if compatible devices are found.")]
|
||||||
|
public bool AllowPortForward = true;
|
||||||
|
|
||||||
public bool NatDeviceAvailable = false; // internal check if discovery succeeded
|
public bool NatDeviceAvailable = false; // internal check if discovery succeeded
|
||||||
public int NatDiscoveryTimeout = 1000; // ms to search for UPnP enabled NATs
|
|
||||||
public bool VerboseNatDiscovery = false; // print very detailed logs for debugging
|
[Desc("Time in miliseconds to search for UPnP enabled NAT devices.")]
|
||||||
|
public int NatDiscoveryTimeout = 1000;
|
||||||
|
|
||||||
|
[Desc("Print very detailed logs for debugging issues with routers.")]
|
||||||
|
public bool VerboseNatDiscovery = false;
|
||||||
|
|
||||||
|
[Desc("Starts the game with a default map. Input as hash that can be obtained by the utility.")]
|
||||||
public string Map = null;
|
public string Map = null;
|
||||||
|
|
||||||
|
[Desc("Takes a comma separated list of IP addresses that are not allowed to join.")]
|
||||||
public string[] Ban = { };
|
public string[] Ban = { };
|
||||||
|
|
||||||
|
[Desc("Value in miliseconds when to terminate the game. Needs to be at least 10000 (10 s) to enable the timer.")]
|
||||||
public int TimeOut = 0;
|
public int TimeOut = 0;
|
||||||
|
|
||||||
|
[Desc("Run in headless mode with an empty renderer and without sound output.")]
|
||||||
public bool Dedicated = false;
|
public bool Dedicated = false;
|
||||||
|
|
||||||
|
[Desc("Automatically restart when a game ends. Disable this when something else already takes care about it.")]
|
||||||
public bool DedicatedLoop = true;
|
public bool DedicatedLoop = true;
|
||||||
|
|
||||||
|
[Desc("Disallow AI bots.")]
|
||||||
public bool LockBots = false;
|
public bool LockBots = false;
|
||||||
|
|
||||||
public string TimestampFormat = "HH:mm";
|
public string TimestampFormat = "HH:mm";
|
||||||
|
|
||||||
public ServerSettings() { }
|
public ServerSettings() { }
|
||||||
@@ -122,6 +154,7 @@ namespace OpenRA
|
|||||||
|
|
||||||
public class GameSettings
|
public class GameSettings
|
||||||
{
|
{
|
||||||
|
[Desc("Load a specific mod on startup. Shipped ones include: ra, cnc and d2k")]
|
||||||
public string Mod = "modchooser";
|
public string Mod = "modchooser";
|
||||||
public string PreviousMod = "ra";
|
public string PreviousMod = "ra";
|
||||||
|
|
||||||
|
|||||||
@@ -529,6 +529,7 @@
|
|||||||
<Compile Include="UtilityCommands\CheckCodeStyle.cs" />
|
<Compile Include="UtilityCommands\CheckCodeStyle.cs" />
|
||||||
<Compile Include="UtilityCommands\ConvertPngToShpCommand.cs" />
|
<Compile Include="UtilityCommands\ConvertPngToShpCommand.cs" />
|
||||||
<Compile Include="UtilityCommands\ConvertSpriteToPngCommand.cs" />
|
<Compile Include="UtilityCommands\ConvertSpriteToPngCommand.cs" />
|
||||||
|
<Compile Include="UtilityCommands\CreateManPage.cs" />
|
||||||
<Compile Include="UtilityCommands\ExportCharacterSeparatedRules.cs" />
|
<Compile Include="UtilityCommands\ExportCharacterSeparatedRules.cs" />
|
||||||
<Compile Include="UtilityCommands\Extensions.cs" />
|
<Compile Include="UtilityCommands\Extensions.cs" />
|
||||||
<Compile Include="UtilityCommands\ExtractFilesCommand.cs" />
|
<Compile Include="UtilityCommands\ExtractFilesCommand.cs" />
|
||||||
|
|||||||
68
OpenRA.Mods.Common/UtilityCommands/CreateManPage.cs
Normal file
68
OpenRA.Mods.Common/UtilityCommands/CreateManPage.cs
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
#region Copyright & License Information
|
||||||
|
/*
|
||||||
|
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
|
||||||
|
* This file is part of OpenRA, which is free software. It is made
|
||||||
|
* available to you under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation. For more information,
|
||||||
|
* see COPYING.
|
||||||
|
*/
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace OpenRA.Mods.Common.UtilityCommands
|
||||||
|
{
|
||||||
|
class CreateManPage : IUtilityCommand
|
||||||
|
{
|
||||||
|
public string Name { get { return "--man-page"; } }
|
||||||
|
|
||||||
|
[Desc("Create a man page in troff format.")]
|
||||||
|
public void Run(ModData modData, string[] args)
|
||||||
|
{
|
||||||
|
Console.WriteLine(".TH OPENRA 6");
|
||||||
|
Console.WriteLine(".SH NAME");
|
||||||
|
Console.WriteLine("openra \\- An Open Source modernization of the early 2D Command & Conquer games.");
|
||||||
|
Console.WriteLine(".SH SYNOPSIS");
|
||||||
|
Console.WriteLine(".B openra");
|
||||||
|
Console.WriteLine("[\\fB\\Game.Mod=\\fR\\fImodchooser\\fR]");
|
||||||
|
Console.WriteLine(".SH DESCRIPTION");
|
||||||
|
Console.WriteLine(".B openra");
|
||||||
|
Console.WriteLine("starts the game.");
|
||||||
|
Console.WriteLine(".SH OPTIONS");
|
||||||
|
|
||||||
|
var sections = Game.Settings.Sections;
|
||||||
|
sections.Add("Launch", new OpenRA.Mods.Common.LoadScreens.BlankLoadScreen.LaunchArgs());
|
||||||
|
foreach (var section in sections.OrderBy(s => s.Key))
|
||||||
|
{
|
||||||
|
var fields = section.Value.GetType().GetFields();
|
||||||
|
foreach (var field in fields)
|
||||||
|
{
|
||||||
|
if (!field.HasAttribute<DescAttribute>())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Console.WriteLine(".TP");
|
||||||
|
|
||||||
|
Console.Write(".BR {0}.{1}=".F(section.Key, field.Name));
|
||||||
|
var value = field.GetValue(section.Value);
|
||||||
|
if (value != null && !value.ToString().StartsWith("System."))
|
||||||
|
Console.WriteLine("\\fI{0}\\fR".F(value));
|
||||||
|
else
|
||||||
|
Console.WriteLine();
|
||||||
|
|
||||||
|
var lines = field.GetCustomAttributes<DescAttribute>(false).SelectMany(d => d.Lines);
|
||||||
|
foreach (var line in lines)
|
||||||
|
Console.WriteLine(line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine(".SH FILES");
|
||||||
|
Console.WriteLine("Settings are stored in the ~/.openra user folder.");
|
||||||
|
Console.WriteLine(".SH BUGS");
|
||||||
|
Console.WriteLine("Known issues are tracked at http://bugs.openra.net");
|
||||||
|
Console.WriteLine(".SH COPYRIGHT");
|
||||||
|
Console.WriteLine("Copyright 2007-2015 The OpenRA Developers (see AUTHORS)");
|
||||||
|
Console.WriteLine("This manual is part of OpenRA, which is free software. It is GNU GPL v3 licensed. See COPYING for details.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,6 +24,7 @@ make install-all prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR"
|
|||||||
make install-linux-shortcuts prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR"
|
make install-linux-shortcuts prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR"
|
||||||
make install-linux-mime prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR"
|
make install-linux-mime prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR"
|
||||||
make install-linux-appdata prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR"
|
make install-linux-appdata prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR"
|
||||||
|
make install-man-page prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR"
|
||||||
|
|
||||||
# Documentation
|
# Documentation
|
||||||
mkdir -p $PWD/packaging/linux/$ROOTDIR/usr/share/doc/openra/
|
mkdir -p $PWD/packaging/linux/$ROOTDIR/usr/share/doc/openra/
|
||||||
|
|||||||
Reference in New Issue
Block a user