-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9706619
commit dca42f9
Showing
16 changed files
with
2,376 additions
and
2,369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry excluding="**/.svn/*" kind="src" path="src"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry exported="true" kind="lib" path="lib/JLzma.jar"/> | ||
<classpathentry exported="true" kind="lib" path="lib/minlog-1.2.jar"/> | ||
<classpathentry kind="lib" path="lib/commons-net-ftp-2.0.jar"/> | ||
<classpathentry kind="lib" path="lib/yamlbeans-1.05.jar"/> | ||
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/wildcard"/> | ||
<classpathentry kind="lib" path="lib/wildcard-1.03.jar"/> | ||
<classpathentry kind="lib" path="lib/jsch-0.1.49.jar"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry excluding="**/.svn/*" kind="src" path="src"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry exported="true" kind="lib" path="lib/JLzma.jar"/> | ||
<classpathentry exported="true" kind="lib" path="lib/minlog-1.2.jar"/> | ||
<classpathentry kind="lib" path="lib/commons-net-ftp-2.0.jar"/> | ||
<classpathentry kind="lib" path="lib/yamlbeans-1.05.jar"/> | ||
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/wildcard"/> | ||
<classpathentry kind="lib" path="lib/wildcard-1.03.jar"/> | ||
<classpathentry kind="lib" path="lib/jsch-0.1.49.jar"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Temporary Files | ||
*~ | ||
.*.swp | ||
.DS_STORE | ||
|
||
bin/ | ||
target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>scar</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>scar</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
java -jar "%~dp0scar.jar" | ||
java -jar "%~dp0scar.jar" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
main: com.esotericsoftware.scar.Build | ||
version: 1.09 | ||
--- | ||
Build.build(project); | ||
Build.oneJAR(project); | ||
main: com.esotericsoftware.scar.Build | ||
version: 1.09 | ||
--- | ||
Build.build(project); | ||
Build.oneJAR(project); |
180 changes: 90 additions & 90 deletions
180
.../com/esotericsoftware/scar/Arguments.java → src/com/esotericsoftware/scar/Arguments.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,90 @@ | ||
|
||
package com.esotericsoftware.scar; | ||
|
||
import java.util.LinkedHashMap; | ||
|
||
/** | ||
* Stores command line arguments as name/value pairs. Arguments containing an equals sign are considered a name/value pair. All | ||
* other arguments are stored as a name/value pair with a null value. | ||
*/ | ||
public class Arguments { | ||
private final LinkedHashMap<String, String> parameters = new LinkedHashMap(); | ||
|
||
public Arguments () { | ||
} | ||
|
||
public Arguments (String[] args) { | ||
this(args, 0); | ||
} | ||
|
||
public Arguments (String[] args, int startIndex) { | ||
for (int i = startIndex; i < args.length; i++) { | ||
String[] nameValuePair = args[i].split("=", 2); | ||
if (nameValuePair.length == 2) | ||
parameters.put(nameValuePair[0], nameValuePair[1]); | ||
else | ||
parameters.put(args[i], null); | ||
} | ||
} | ||
|
||
/** | ||
* Returns true if the argument was specified. | ||
*/ | ||
public boolean has (String name) { | ||
if (name == null) throw new IllegalArgumentException("name cannot be null."); | ||
return parameters.containsKey(name); | ||
} | ||
|
||
/** | ||
* Returns the value of the argument with the specified name, or null if the argument was specified without a value or was not | ||
* specified. | ||
*/ | ||
public String get (String name) { | ||
if (name == null) throw new IllegalArgumentException("name cannot be null."); | ||
return parameters.get(name); | ||
} | ||
|
||
/** | ||
* Returns the value of the argument with the specified name, or the specified default value if the argument was specified | ||
* without a value or was not specified. | ||
*/ | ||
public String get (String name, String defaultValue) { | ||
String value = parameters.get(name); | ||
if (value == null) return defaultValue; | ||
return value; | ||
} | ||
|
||
public void set (String name) { | ||
set(name, null); | ||
} | ||
|
||
public void set (String name, String value) { | ||
if (name == null) throw new IllegalArgumentException("name cannot be null."); | ||
parameters.put(name, value); | ||
} | ||
|
||
public int count () { | ||
return parameters.size(); | ||
} | ||
|
||
public String remove (String name) { | ||
if (name == null) throw new IllegalArgumentException("name cannot be null."); | ||
return parameters.remove(name); | ||
} | ||
|
||
public String toString () { | ||
StringBuffer buffer = new StringBuffer(100); | ||
for (String param : parameters.keySet()) { | ||
if (buffer.length() > 1) buffer.append(' '); | ||
String value = get(param); | ||
if (value == null) | ||
buffer.append(param); | ||
else { | ||
buffer.append(param); | ||
buffer.append('='); | ||
buffer.append(value); | ||
} | ||
} | ||
return buffer.toString(); | ||
} | ||
} | ||
|
||
package com.esotericsoftware.scar; | ||
|
||
import java.util.LinkedHashMap; | ||
|
||
/** | ||
* Stores command line arguments as name/value pairs. Arguments containing an equals sign are considered a name/value pair. All | ||
* other arguments are stored as a name/value pair with a null value. | ||
*/ | ||
public class Arguments { | ||
private final LinkedHashMap<String, String> parameters = new LinkedHashMap(); | ||
|
||
public Arguments () { | ||
} | ||
|
||
public Arguments (String[] args) { | ||
this(args, 0); | ||
} | ||
|
||
public Arguments (String[] args, int startIndex) { | ||
for (int i = startIndex; i < args.length; i++) { | ||
String[] nameValuePair = args[i].split("=", 2); | ||
if (nameValuePair.length == 2) | ||
parameters.put(nameValuePair[0], nameValuePair[1]); | ||
else | ||
parameters.put(args[i], null); | ||
} | ||
} | ||
|
||
/** | ||
* Returns true if the argument was specified. | ||
*/ | ||
public boolean has (String name) { | ||
if (name == null) throw new IllegalArgumentException("name cannot be null."); | ||
return parameters.containsKey(name); | ||
} | ||
|
||
/** | ||
* Returns the value of the argument with the specified name, or null if the argument was specified without a value or was not | ||
* specified. | ||
*/ | ||
public String get (String name) { | ||
if (name == null) throw new IllegalArgumentException("name cannot be null."); | ||
return parameters.get(name); | ||
} | ||
|
||
/** | ||
* Returns the value of the argument with the specified name, or the specified default value if the argument was specified | ||
* without a value or was not specified. | ||
*/ | ||
public String get (String name, String defaultValue) { | ||
String value = parameters.get(name); | ||
if (value == null) return defaultValue; | ||
return value; | ||
} | ||
|
||
public void set (String name) { | ||
set(name, null); | ||
} | ||
|
||
public void set (String name, String value) { | ||
if (name == null) throw new IllegalArgumentException("name cannot be null."); | ||
parameters.put(name, value); | ||
} | ||
|
||
public int count () { | ||
return parameters.size(); | ||
} | ||
|
||
public String remove (String name) { | ||
if (name == null) throw new IllegalArgumentException("name cannot be null."); | ||
return parameters.remove(name); | ||
} | ||
|
||
public String toString () { | ||
StringBuffer buffer = new StringBuffer(100); | ||
for (String param : parameters.keySet()) { | ||
if (buffer.length() > 1) buffer.append(' '); | ||
String value = get(param); | ||
if (value == null) | ||
buffer.append(param); | ||
else { | ||
buffer.append(param); | ||
buffer.append('='); | ||
buffer.append(value); | ||
} | ||
} | ||
return buffer.toString(); | ||
} | ||
} |
Oops, something went wrong.