public class Main
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
Main.SubcommandLineParser
Parser for subcommands which doesn't stop parsing on help options and so
proceeds all specified options
|
Modifier and Type | Field and 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 and Description |
---|
Main()
Constructor for Main.
|
Modifier and Type | Method and Description |
---|---|
(package private) static void |
configureHttpProxy()
Configure the JRE's standard HTTP based on
http_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.
|
private boolean help
private boolean version
private boolean showStackTrace
private java.lang.String gitdir
private TextBuiltin subcommand
private java.util.List<java.lang.String> arguments
java.io.PrintWriter writer
private java.util.concurrent.ExecutorService gcExecutor
public static void main(java.lang.String[] argv) throws java.lang.Exception
argv
- arguments.java.lang.Exception
protected void run(java.lang.String[] argv) throws java.lang.Exception
class ExtMain { public static void main(String[] argv) { new ExtMain().run(argv); } }
argv
- arguments.java.lang.Exception
java.io.PrintWriter createErrorWriter()
private void execute(java.lang.String[] argv) throws java.lang.Exception
java.lang.Exception
void init(TextBuiltin cmd) throws java.io.IOException
java.io.IOException
void exit(int status, java.lang.Exception t) throws java.lang.Exception
status
- t
- can be null
java.lang.Exception
protected Repository openGitDir(java.lang.String aGitdir) throws java.io.IOException
--git-dir
option and open the repository.aGitdir
- the --git-dir
option given on the command line. May be
null if it was not supplied.java.io.IOException
- the repository cannot be opened.private static boolean installConsole()
private static void install(java.lang.String name) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException, java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException
java.lang.ClassNotFoundException
static void configureHttpProxy() throws java.net.MalformedURLException
http_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.
java.net.MalformedURLException
- the value in http_proxy
or
https_proxy
is unsupportable.