Top Description Inners Fields Constructors Methods
org.eclipse.jgit.pgm

public Class Main

extends Object
Class Inheritance
Static Imports
java.nio.charset.StandardCharsets.UTF_8

Command line entry point.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
Main.SubcommandLineParser

Parser for subcommands which doesn't stop parsing on help options and so proceeds all specified options

Field Summary

Modifier and TypeField and Description
private List<String>
private ExecutorService
private String
private boolean
private boolean
private TextBuiltin
private boolean
pack-priv PrintWriter

Constructor Summary

AccessConstructor and Description
public
Main()

Constructor for Main.

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
configureHttpProxy()

Configure the JRE's standard HTTP based on http_proxy.

pack-priv PrintWriter
private void
execute(String[] argv)

pack-priv void
exit(int
exit status code, nonzero value indicates an error
status
,
Exception
can be null
t
)

pack-priv void
private static void
private static boolean
public static void
main(String[]
arguments.
argv
)

Execute the command line.

protected Repository

Returns:

the repository to operate on.
openGitDir
(String
the --git-dir option given on the command line. May be null if it was not supplied.
aGitdir
)

Evaluate the --git-dir option and open the repository.

protected void
run(String[]
arguments.
argv
)

Parse the command line and execute the requested action.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

argumentsback to summary
private List<String> arguments
Annotations
@Argument
index:1
metaVar:metaVar_arg
gcExecutorback to summary
private ExecutorService gcExecutor
gitdirback to summary
private String gitdir
Annotations
@Option
name:--git-dir
metaVar:metaVar_gitDir
usage:usage_setTheGitRepositoryToOperateOn
helpback to summary
private boolean help
Annotations
@Option
name:--help
usage:usage_displayThisHelpText
aliases:-h
showStackTraceback to summary
private boolean showStackTrace
Annotations
@Option
name:--show-stack-trace
usage:usage_displayThejavaStackTraceOnExceptions
subcommandback to summary
private TextBuiltin subcommand
Annotations
@Argument
index:0
metaVar:metaVar_command
required:true
handler:SubcommandHandler
versionback to summary
private boolean version
Annotations
@Option
name:--version
usage:usage_displayVersion
writerback to summary
pack-priv PrintWriter writer

Constructor Detail

Mainback to summary
public Main()

Constructor for Main.

Method Detail

configureHttpProxyback to summary
pack-priv static void configureHttpProxy() throws MalformedURLException

Configure the JRE's standard HTTP based on 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.

Exceptions
MalformedURLException:
the value in http_proxy or https_proxy is unsupportable.
createErrorWriterback to summary
pack-priv PrintWriter createErrorWriter()
executeback to summary
private void execute(String[] argv) throws Exception
exitback to summary
pack-priv void exit(int status, Exception t) throws Exception
Parameters
status:int

exit status code, nonzero value indicates an error

t:Exception

can be null

Exceptions
Exception:
if an IO error occurred
initback to summary
pack-priv void init(TextBuiltin cmd) throws IOException
installback to summary
private static void install(String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException
installConsoleback to summary
private static boolean installConsole()
mainback to summary
public static void main(String[] argv) throws Exception

Execute the command line.

Parameters
argv:String[]

arguments.

Exceptions
Exception:
if an error occurred
openGitDirback to summary
protected Repository openGitDir(String aGitdir) throws IOException

Evaluate the --git-dir option and open the repository.

Parameters
aGitdir:String

the --git-dir option given on the command line. May be null if it was not supplied.

Returns:Repository

the repository to operate on.

Exceptions
IOException:
the repository cannot be opened.
runback to summary
protected void run(String[] argv) throws 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:String[]

arguments.

Exceptions
Exception:
if an error occurred
org.eclipse.jgit.pgm back to summary

pack-priv Class Main.SubcommandLineParser

extends CmdLineParser
Class Inheritance

Parser for subcommands which doesn't stop parsing on help options and so proceeds all specified options

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected boolean
containsHelp(String...
non null
args
)

Overrides org.eclipse.jgit.pgm.opt.CmdLineParser.containsHelp.

Check if array contains help option

Inherited from org.eclipse.jgit.pgm.opt.CmdLineParser:
createOptionHandlergetRepositorygetRevWalkgetRevWalkGentlyparseArgumentprintSingleLineUsage

Constructor Detail

SubcommandLineParserback to summary
public SubcommandLineParser(Object bean)

Method Detail

containsHelpback to summary
protected boolean containsHelp(String... args)

Overrides org.eclipse.jgit.pgm.opt.CmdLineParser.containsHelp.

Doc from org.eclipse.jgit.pgm.opt.CmdLineParser.containsHelp.

Check if array contains help option

Parameters
args:String[]

non null

Returns:boolean

true if the given array contains help option

Annotations
@Override