Package org.eclipse.jgit.pgm
Class Main
- java.lang.Object
-
- org.eclipse.jgit.pgm.Main
-
- Direct Known Subclasses:
CLIGitCommand
public class Main extends java.lang.ObjectCommand line entry point.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classMain.SubcommandLineParserParser 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>argumentsprivate java.util.concurrent.ExecutorServicegcExecutorprivate java.lang.Stringgitdirprivate booleanhelpprivate booleanshowStackTraceprivate TextBuiltinsubcommandprivate booleanversion(package private) java.io.PrintWriterwriter
-
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 voidconfigureHttpProxy()Configure the JRE's standard HTTP based onhttp_proxy.(package private) java.io.PrintWritercreateErrorWriter()private voidexecute(java.lang.String[] argv)(package private) voidexit(int status, java.lang.Exception t)(package private) voidinit(TextBuiltin cmd)private static voidinstall(java.lang.String name)private static booleaninstallConsole()static voidmain(java.lang.String[] argv)Execute the command line.protected RepositoryopenGitDir(java.lang.String aGitdir)Evaluate the--git-diroption and open the repository.protected voidrun(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.ExceptionExecute the command line.- Parameters:
argv- arguments.- Throws:
java.lang.Exception
-
run
protected void run(java.lang.String[] argv) throws java.lang.ExceptionParse 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-diroption and open the repository.- Parameters:
aGitdir- the--git-diroption 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.IllegalAccessExceptionjava.lang.reflect.InvocationTargetExceptionjava.lang.NoSuchMethodExceptionjava.lang.ClassNotFoundException
-
configureHttpProxy
static void configureHttpProxy() throws java.net.MalformedURLExceptionConfigure the JRE's standard HTTP based onhttp_proxy.The popular libcurl library honors the
http_proxy,https_proxyenvironment 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_proxyorhttps_proxyis unsupportable.
-
-