package org.wildfly.extras.patch.internal;

import java.io.File;

import org.kohsuke.args4j.Option;

final class SelfExecutingOptions {
    @Option(name = "--help", help = true)
    boolean help;

    @Option(name = "--server", usage = "Path to the target server directory. Defaults to $JBOSS_HOME or $CWD.")
    File serverHome;

    @Option(name = "--query-repository", usage = "Query the repository for available patches")
    boolean queryRepository;

    @Option(name = "--query-server", usage = "Query the server for installed patches")
    boolean queryServer;

    @Option(name = "--query-server-paths", usage = "Query managed server paths")
    String queryServerPaths;

    @Option(name = "--audit-log", usage = "Print the audit log")
    boolean auditLog;

    @Option(name = "--install", forbids = { "--update", "--uninstall" },  usage = "Install the given patch id to the server")
    String installId;

    @Option(name = "--update", forbids = { "--install", "--uninstall" },  usage = "Update the server for the given patch name")
    String updateName;

    @Option(name = "--uninstall", forbids = { "--install", "--update" },  usage = "Uninstall the given patch id from the server")
    String uninstallId;

    @Option(name = "--force", usage = "Force an --install or --update operation")
    boolean force;
}

@@ -212,32 +212,49 @@
 me = %22--server%22,
+ metaVar = %22DIR%22,
  usage = %22Path t
@@ -621,16 +621,36 @@
 -paths%22,
+ metaVar = %22PREFIX%22,
  usage =
@@ -821,32 +821,49 @@
 e = %22--install%22,
+ metaVar = %22PKG%22,
  forbids = %7B %22--
@@ -870,16 +870,28 @@
 update%22,
+%0A           
  %22--unin
@@ -891,33 +891,32 @@
 %22--uninstall%22 %7D,
- 
  usage = %22Instal
@@ -941,32 +941,63 @@
 id to the server
+. Example of PKG: somepkg-1.0.0
 %22)%0A    String in
@@ -1036,16 +1036,33 @@
 update%22,
+ metaVar = %22PKG%22,
  forbids
@@ -1074,24 +1074,36 @@
 %22--install%22,
+%0A           
  %22--uninstal
@@ -1103,25 +1103,24 @@
 ninstall%22 %7D,
- 
  usage = %22Up
@@ -1159,16 +1159,42 @@
 tch name
+. Examples of PKG: somepkg
 %22)%0A    S
@@ -1245,16 +1245,33 @@
 nstall%22,
+ metaVar = %22PKG%22,
  forbids
@@ -1287,16 +1287,28 @@
 nstall%22,
+%0A           
  %22--upda
@@ -1313,17 +1313,16 @@
 date%22 %7D,
- 
  usage =
@@ -1367,16 +1367,47 @@
 e server
+. Example of PKG: somepkg-1.0.0
 %22)%0A    S

Improve help information in SelfExecutingOptions