|
28 | 28 | * <li>ls</li> |
29 | 29 | * <li>Ant</li> |
30 | 30 | * <li>Groovy</li> |
| 31 | + * <li>man</li> |
31 | 32 | * </ul> |
32 | 33 | * </p> |
33 | 34 | * |
@@ -169,4 +170,52 @@ public void testGroovy() throws Exception { |
169 | 170 | assertEquals("println 'hello'", line.getOptionValue('e')); |
170 | 171 | } |
171 | 172 |
|
| 173 | + /** |
| 174 | + * @author Slawek Zachcial |
| 175 | + */ |
| 176 | + public void testMan() |
| 177 | + { |
| 178 | + String cmdLine = |
| 179 | + "man [-c|-f|-k|-w|-tZT device] [-adlhu7V] [-Mpath] [-Ppager] [-Slist] " + |
| 180 | + "[-msystem] [-pstring] [-Llocale] [-eextension] [section] page ..."; |
| 181 | + Options options = new Options(). |
| 182 | + addOption("a", "all", false, "find all matching manual pages."). |
| 183 | + addOption("d", "debug", false, "emit debugging messages."). |
| 184 | + addOption("e", "extension", false, "limit search to extension type 'extension'."). |
| 185 | + addOption("f", "whatis", false, "equivalent to whatis."). |
| 186 | + addOption("k", "apropos", false, "equivalent to apropos."). |
| 187 | + addOption("w", "location", false, "print physical location of man page(s)."). |
| 188 | + addOption("l", "local-file", false, "interpret 'page' argument(s) as local filename(s)"). |
| 189 | + addOption("u", "update", false, "force a cache consistency check."). |
| 190 | + //FIXME - should generate -r,--prompt string |
| 191 | + addOption("r", "prompt", true, "provide 'less' pager with prompt."). |
| 192 | + addOption("c", "catman", false, "used by catman to reformat out of date cat pages."). |
| 193 | + addOption("7", "ascii", false, "display ASCII translation or certain latin1 chars."). |
| 194 | + addOption("t", "troff", false, "use troff format pages."). |
| 195 | + //FIXME - should generate -T,--troff-device device |
| 196 | + addOption("T", "troff-device", true, "use groff with selected device."). |
| 197 | + addOption("Z", "ditroff", false, "use groff with selected device."). |
| 198 | + addOption("D", "default", false, "reset all options to their default values."). |
| 199 | + //FIXME - should generate -M,--manpath path |
| 200 | + addOption("M", "manpath", true, "set search path for manual pages to 'path'."). |
| 201 | + //FIXME - should generate -P,--pager pager |
| 202 | + addOption("P", "pager", true, "use program 'pager' to display output."). |
| 203 | + //FIXME - should generate -S,--sections list |
| 204 | + addOption("S", "sections", true, "use colon separated section list."). |
| 205 | + //FIXME - should generate -m,--systems system |
| 206 | + addOption("m", "systems", true, "search for man pages from other unix system(s)."). |
| 207 | + //FIXME - should generate -L,--locale locale |
| 208 | + addOption("L", "locale", true, "defaine the locale for this particular man search."). |
| 209 | + //FIXME - should generate -p,--preprocessor string |
| 210 | + addOption("p", "preprocessor", true, "string indicates which preprocessor to run.\n" + |
| 211 | + " e - [n]eqn p - pic t - tbl\n" + |
| 212 | + " g - grap r - refer v - vgrind"). |
| 213 | + addOption("V", "version", false, "show version."). |
| 214 | + addOption("h", "help", false, "show this usage message."); |
| 215 | + |
| 216 | + HelpFormatter hf = new HelpFormatter(); |
| 217 | + //hf.printHelp(cmdLine, opts); |
| 218 | + hf.printHelp(60, cmdLine, null, options, null); |
| 219 | + } |
| 220 | + |
172 | 221 | } |
0 commit comments