Skip to content

Commit

Permalink
8219475: javap man page needs to be updated
Browse files Browse the repository at this point in the history
Reviewed-by: mchung
  • Loading branch information
jonathan-gibbons committed Feb 4, 2020
1 parent b75d375 commit 9d7777e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
18 changes: 16 additions & 2 deletions src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -326,6 +326,20 @@ void process(JavapTask task, String opt, String arg) throws BadArgs {
void process(JavapTask task, String opt, String arg) throws BadArgs {
task.options.moduleName = arg;
}
},

// this option is processed by the launcher, and cannot be used when invoked via
// an API like ToolProvider. It exists here to be documented in the command-line help.
new Option(false, "-J") {
@Override
boolean matches(String opt) {
return opt.startsWith("-J");
}

@Override
void process(JavapTask task, String opt, String arg) throws BadArgs {
throw task.new BadArgs("err.only.for.launcher");
}
}

};
Expand Down Expand Up @@ -936,7 +950,7 @@ private void showHelp() {
printLines(getMessage("main.usage", progname));
for (Option o: recognizedOptions) {
String name = o.aliases[0].replaceAll("^-+", "").replaceAll("-+", "_"); // there must always be at least one name
if (name.startsWith("X") || name.equals("fullversion") || name.equals("h") || name.equals("verify"))
if (name.startsWith("X") || name.equals("fullversion"))
continue;
printLines(getMessage("main.opt." + name));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -45,6 +45,7 @@ err.bad.innerclasses.attribute=bad InnerClasses attribute for {0}
err.nomem=Insufficient memory. To increase memory use -J-Xmx option.
err.cant.find.module=Cannot find module {0}
err.cant.find.module.ex=Problem finding module {0}: {1}
err.only.for.launcher=This option can only be used when invoking javap from the command-line launcher.

main.usage.summary=\
Usage: {0} <options> <classes>\n\
Expand All @@ -55,17 +56,13 @@ warn.unexpected.class=File {0} does not contain class {1}

note.prefix=Note:

main.usage.summary=\
Usage: {0} <options> <classes>\n\
use --help for a list of possible options

main.usage=\
Usage: {0} <options> <classes>\n\
where possible options include:


main.opt.help=\
\ -? -h --help -help Print this help message
\ --help -help -h -? Print this help message

main.opt.version=\
\ -version Version information
Expand Down Expand Up @@ -129,6 +126,9 @@ main.opt.sysinfo=\
main.opt.module=\
\ --module <module>, -m <module> Specify module containing classes to be disassembled

main.opt.J=\
\ -J<vm-option> Specify a VM option

main.usage.foot=\n\
GNU-style options may use '=' instead of whitespace to separate the name of an option\n\
from its value.\n\
Expand Down

0 comments on commit 9d7777e

Please sign in to comment.