Package org.eclipse.jgit.pgm
Class Main
- java.lang.Object
-
- org.eclipse.jgit.pgm.Main
-
public class Main extends java.lang.Object
Command line entry point.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
Main.SubcommandLineParser
Parser for subcommands which doesn't stop parsing on help options and so proceeds all specified options
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.String>
arguments
private java.util.concurrent.ExecutorService
gcExecutor
private java.lang.String
gitdir
private boolean
help
private boolean
showStackTrace
private TextBuiltin
subcommand
private boolean
version
(package private) java.io.PrintWriter
writer
-
Constructor Summary
Constructors Constructor Description Main()
Constructor for Main.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static void
configureHttpProxy()
Configure the JRE's standard HTTP based onhttp_proxy
.(package private) java.io.PrintWriter
createErrorWriter()
private void
execute(java.lang.String[] argv)
(package private) void
exit(int status, java.lang.Exception t)
(package private) void
init(TextBuiltin cmd)
private static void
install(java.lang.String name)
private static boolean
installConsole()
static void
main(java.lang.String[] argv)
Execute the command line.protected Repository
openGitDir(java.lang.String aGitdir)
Evaluate the--git-dir
option and open the repository.protected void
run(java.lang.String[] argv)
Parse the command line and execute the requested action.
-
-
-
Field Detail
-
help
private boolean help
-
version
private boolean version
-
showStackTrace
private boolean showStackTrace
-
gitdir
private java.lang.String gitdir
-
subcommand
private TextBuiltin subcommand
-
arguments
private java.util.List<java.lang.String> arguments
-
writer
java.io.PrintWriter writer
-
gcExecutor
private java.util.concurrent.ExecutorService gcExecutor
-
-
Method Detail
-
main
public static void main(java.lang.String[] argv) throws java.lang.Exception
Execute the command line.- Parameters:
argv
- arguments.- Throws:
java.lang.Exception
-
run
protected void run(java.lang.String[] argv) throws java.lang.Exception
Parse the command line and execute the requested action. Subclasses should allocate themselves and then invoke this method:class ExtMain { public static void main(String[] argv) { new ExtMain().run(argv); } }
- Parameters:
argv
- arguments.- Throws:
java.lang.Exception
-
createErrorWriter
java.io.PrintWriter createErrorWriter()
-
execute
private void execute(java.lang.String[] argv) throws java.lang.Exception
- Throws:
java.lang.Exception
-
init
void init(TextBuiltin cmd) throws java.io.IOException
- Throws:
java.io.IOException
-
exit
void exit(int status, java.lang.Exception t) throws java.lang.Exception
- Parameters:
status
-t
- can benull
- Throws:
java.lang.Exception
-
openGitDir
protected Repository openGitDir(java.lang.String aGitdir) throws java.io.IOException
Evaluate the--git-dir
option and open the repository.- Parameters:
aGitdir
- the--git-dir
option given on the command line. May be null if it was not supplied.- Returns:
- the repository to operate on.
- Throws:
java.io.IOException
- the repository cannot be opened.
-
installConsole
private static boolean installConsole()
-
install
private static void install(java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException, java.lang.ClassNotFoundException
- Throws:
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException
java.lang.ClassNotFoundException
-
configureHttpProxy
static void configureHttpProxy() throws java.net.MalformedURLException
Configure the JRE's standard HTTP based onhttp_proxy
.The popular libcurl library honors the
http_proxy
,https_proxy
environment variables as a means of specifying an HTTP/S proxy for requests made behind a firewall. This is not natively recognized by the JRE, so this method can be used by command line utilities to configure the JRE before the first request is sent. The information found in the environment variables is copied to the associated system properties. This is not done when the system properties are already set. The default way of telling java programs about proxies (the system properties) takes precedence over environment variables.- Throws:
java.net.MalformedURLException
- the value inhttp_proxy
orhttps_proxy
is unsupportable.
-
-