Skip to content

Commit d4c0eba

Browse files
committed
2.9.7 changes, now with CLI
1 parent 44eb4de commit d4c0eba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+6978
-568
lines changed
1.62 MB
Binary file not shown.

README.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Code from various projects has been used, including but not limited to:
1818
Dex2Jar by pxb1..?
1919
Krakatau by Storyyeller
2020
JD GUI/JD Core by The Java-Decompiler Team
21+
Enjarify by Storyyeller
2122

2223
Contributors:
2324
Konloch
@@ -58,6 +59,14 @@ Key Features:
5859
Recent Files & Recent Plugins.
5960
And more! Give it a try for yourself!
6061

62+
Command Line Input:
63+
-help Displays the help menu
64+
-list Displays the available decompilers
65+
-decompiler <decompiler> Selects the decompiler, procyon by default
66+
-i <input file> Selects the input file
67+
-o <output file> Selects the output file
68+
-nowait Doesn't wait for the user to read the CLI messages
69+
6170
Are you a Java Reverse Engineer? Do you want to learn?
6271
Join The Bytecode Club Today!
6372
https://the.bytecode.club
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.commons.cli;
19+
20+
/**
21+
* Thrown when more than one option in an option group
22+
* has been provided.
23+
*
24+
* @version $Id: AlreadySelectedException.java 1443102 2013-02-06 18:12:16Z tn $
25+
*/
26+
public class AlreadySelectedException extends ParseException
27+
{
28+
/**
29+
* This exception {@code serialVersionUID}.
30+
*/
31+
private static final long serialVersionUID = 3674381532418544760L;
32+
33+
/** The option group selected. */
34+
private OptionGroup group;
35+
36+
/** The option that triggered the exception. */
37+
private Option option;
38+
39+
/**
40+
* Construct a new <code>AlreadySelectedException</code>
41+
* with the specified detail message.
42+
*
43+
* @param message the detail message
44+
*/
45+
public AlreadySelectedException(String message)
46+
{
47+
super(message);
48+
}
49+
50+
/**
51+
* Construct a new <code>AlreadySelectedException</code>
52+
* for the specified option group.
53+
*
54+
* @param group the option group already selected
55+
* @param option the option that triggered the exception
56+
* @since 1.2
57+
*/
58+
public AlreadySelectedException(OptionGroup group, Option option)
59+
{
60+
this("The option '" + option.getKey() + "' was specified but an option from this group "
61+
+ "has already been selected: '" + group.getSelected() + "'");
62+
this.group = group;
63+
this.option = option;
64+
}
65+
66+
/**
67+
* Returns the option group where another option has been selected.
68+
*
69+
* @return the related option group
70+
* @since 1.2
71+
*/
72+
public OptionGroup getOptionGroup()
73+
{
74+
return group;
75+
}
76+
77+
/**
78+
* Returns the option that was added to the group and triggered the exception.
79+
*
80+
* @return the related option
81+
* @since 1.2
82+
*/
83+
public Option getOption()
84+
{
85+
return option;
86+
}
87+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.commons.cli;
19+
20+
import java.util.Collection;
21+
import java.util.Iterator;
22+
23+
/**
24+
* Exception thrown when an option can't be identified from a partial name.
25+
*
26+
* @version $Id: AmbiguousOptionException.java 1669814 2015-03-28 18:09:26Z britter $
27+
* @since 1.3
28+
*/
29+
public class AmbiguousOptionException extends UnrecognizedOptionException
30+
{
31+
/**
32+
* This exception {@code serialVersionUID}.
33+
*/
34+
private static final long serialVersionUID = 5829816121277947229L;
35+
36+
/** The list of options matching the partial name specified */
37+
private final Collection<String> matchingOptions;
38+
39+
/**
40+
* Constructs a new AmbiguousOptionException.
41+
*
42+
* @param option the partial option name
43+
* @param matchingOptions the options matching the name
44+
*/
45+
public AmbiguousOptionException(String option, Collection<String> matchingOptions)
46+
{
47+
super(createMessage(option, matchingOptions), option);
48+
this.matchingOptions = matchingOptions;
49+
}
50+
51+
/**
52+
* Returns the options matching the partial name.
53+
* @return a collection of options matching the name
54+
*/
55+
public Collection<String> getMatchingOptions()
56+
{
57+
return matchingOptions;
58+
}
59+
60+
/**
61+
* Build the exception message from the specified list of options.
62+
*
63+
* @param option
64+
* @param matchingOptions
65+
* @return
66+
*/
67+
private static String createMessage(String option, Collection<String> matchingOptions)
68+
{
69+
StringBuilder buf = new StringBuilder("Ambiguous option: '");
70+
buf.append(option);
71+
buf.append("' (could be: ");
72+
73+
Iterator<String> it = matchingOptions.iterator();
74+
while (it.hasNext())
75+
{
76+
buf.append("'");
77+
buf.append(it.next());
78+
buf.append("'");
79+
if (it.hasNext())
80+
{
81+
buf.append(", ");
82+
}
83+
}
84+
buf.append(")");
85+
86+
return buf.toString();
87+
}
88+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.commons.cli;
19+
20+
/**
21+
* The class BasicParser provides a very simple implementation of
22+
* the {@link Parser#flatten(Options,String[],boolean) flatten} method.
23+
*
24+
* @version $Id: BasicParser.java 1443102 2013-02-06 18:12:16Z tn $
25+
* @deprecated since 1.3, use the {@link DefaultParser} instead
26+
*/
27+
@Deprecated
28+
public class BasicParser extends Parser
29+
{
30+
/**
31+
* <p>A simple implementation of {@link Parser}'s abstract
32+
* {@link Parser#flatten(Options, String[], boolean) flatten} method.</p>
33+
*
34+
* <p><b>Note:</b> <code>options</code> and <code>stopAtNonOption</code>
35+
* are not used in this <code>flatten</code> method.</p>
36+
*
37+
* @param options The command line {@link Options}
38+
* @param arguments The command line arguments to be parsed
39+
* @param stopAtNonOption Specifies whether to stop flattening
40+
* when an non option is found.
41+
* @return The <code>arguments</code> String array.
42+
*/
43+
@Override
44+
protected String[] flatten(@SuppressWarnings("unused") Options options,
45+
String[] arguments,
46+
@SuppressWarnings("unused") boolean stopAtNonOption)
47+
{
48+
// just echo the arguments
49+
return arguments;
50+
}
51+
}

0 commit comments

Comments
 (0)