Skip to content

Commit dc67b5a

Browse files
Vladimir Kotalahornace
authored andcommitted
get rid of man page
fixes #553
1 parent 96f1156 commit dc67b5a

File tree

5 files changed

+1
-158
lines changed

5 files changed

+1
-158
lines changed

distribution/pom.xml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -68,30 +68,6 @@
6868
</execution>
6969
</executions>
7070
</plugin>
71-
<plugin>
72-
<groupId>org.codehaus.mojo</groupId>
73-
<artifactId>exec-maven-plugin</artifactId>
74-
<version>1.6.0</version>
75-
<executions>
76-
<execution>
77-
<id>man-page</id>
78-
<phase>package</phase>
79-
<goals>
80-
<goal>exec</goal>
81-
</goals>
82-
</execution>
83-
</executions>
84-
<configuration>
85-
<executable>java</executable>
86-
<outputFile>${project.build.directory}/dist/opengrok.1</outputFile>
87-
<arguments>
88-
<argument>-classpath</argument>
89-
<argument>${project.build.directory}/dist/opengrok-${project.version}.jar</argument>
90-
<argument>org.opengrok.indexer.index.Indexer</argument>
91-
<argument>--man</argument>
92-
</arguments>
93-
</configuration>
94-
</plugin>
9571
<plugin>
9672
<artifactId>maven-assembly-plugin</artifactId>
9773
<version>3.1.0</version>

opengrok-indexer/src/main/java/org/opengrok/indexer/configuration/SuggesterConfig.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,7 @@ public SuggesterConfig() {
155155
setShowProjects(SHOW_PROJECTS_DEFAULT);
156156
setShowTime(SHOW_TIME_DEFAULT);
157157
setTimeThreshold(TIME_THRESHOLD_DEFAULT);
158-
// do not use setter because indexer invocation with --man will fail
159-
rebuildCronConfig = REBUILD_CRON_CONFIG_DEFAULT;
158+
setRebuildCronConfig(REBUILD_CRON_CONFIG_DEFAULT);
160159
setBuildTerminationTime(BUILD_TERMINATION_TIME_DEFAULT);
161160
setRebuildThreadPoolSizeInNcpuPercent(REBUILD_THREAD_POOL_PERCENT_NCPUS_DEFAULT);
162161
}

opengrok-indexer/src/main/java/org/opengrok/indexer/index/Indexer.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -593,16 +593,6 @@ public static String[] parseOptions(String[] argv) throws ParseException {
593593
"Please increase JVM heap accordingly too.").execute(memSize ->
594594
cfg.setRamBufferSize((Double) memSize));
595595

596-
parser.on("--man", "Generate OpenGrok XML manual page.").execute(v -> {
597-
try {
598-
System.out.print(parser.getManPage());
599-
} catch (IOException e) {
600-
System.err.println(e.getMessage());
601-
status = 1;
602-
}
603-
System.exit(status);
604-
});
605-
606596
parser.on("--mandoc", "=/path/to/mandoc", "Path to mandoc(1) binary.")
607597
.execute(mandocPath -> cfg.setMandoc((String) mandocPath));
608598

opengrok-indexer/src/main/java/org/opengrok/indexer/util/OptionParser.java

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,14 @@
2727
import java.io.StringWriter;
2828
import java.io.BufferedReader;
2929
import java.io.IOException;
30-
import java.io.InputStreamReader;
3130
import java.io.PrintStream;
32-
import java.nio.charset.StandardCharsets;
33-
import java.text.DateFormat;
3431
import java.text.ParseException;
3532
import java.util.List;
3633
import java.util.Map;
3734
import java.util.function.Consumer;
3835
import java.util.function.Function;
3936
import java.util.ArrayList;
4037
import java.util.Arrays;
41-
import java.util.Date;
4238
import java.util.HashMap;
4339
import java.util.regex.Matcher;
4440
import java.util.regex.Pattern;
@@ -786,59 +782,7 @@ private void spool(BufferedReader reader, PrintWriter out, String tag) throws IO
786782
out.println(line);
787783
}
788784
}
789-
790-
/**
791-
* Generate XML manual page
792-
* This requires the template file <code>opengrok.xml</code> as input.
793-
* @return String containing generated XML manual page
794-
* @throws IOException I/O exception
795-
*/
796-
public String getManPage() throws IOException {
797-
StringWriter wrt = new StringWriter();
798-
PrintWriter out = new PrintWriter(wrt);
799-
try (BufferedReader reader = new BufferedReader(new InputStreamReader(
800-
getClass().getResourceAsStream("/manpage/opengrok.xml"), StandardCharsets.US_ASCII))) {
801-
spool(reader, out, "___INSERT_DATE___");
802-
out.print("<refmiscinfo class=\"date\">");
803-
out.print(DateFormat.getDateInstance(DateFormat.MEDIUM).format(new Date()));
804-
out.println("</refmiscinfo>");
805785

806-
spool(reader, out, "___INSERT_USAGE___");
807-
for (Option o: optionList) {
808-
String sep = "";
809-
out.println("<optional><option>");
810-
for (String option : o.names) {
811-
out.print(sep + option);
812-
sep = ", ";
813-
}
814-
if (o.argument != null) {
815-
out.print(" <replaceable>");
816-
out.print(o.argument);
817-
out.print("</replaceable>");
818-
}
819-
out.println("</option></optional>");
820-
}
821-
822-
spool(reader, out, "___INSERT_OPTIONS___");
823-
for (Option o: optionList) {
824-
String sep = "";
825-
out.print("<varlistentry><term><option>");
826-
for (String option : o.names) {
827-
out.print(sep + option);
828-
sep = ", ";
829-
}
830-
out.print("</option></term><listitem><para>");
831-
out.print(o.description);
832-
out.println("</para></listitem></varlistentry>");
833-
}
834-
835-
spool(reader, out, "___END_OF_FILE___");
836-
out.flush();
837-
}
838-
839-
return wrt.toString();
840-
}
841-
842786
protected List<Option> getOptionList() {
843787
return optionList;
844788
}

opengrok-indexer/src/main/resources/manpage/opengrok.xml

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)