Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli default values #1434

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions cli/src/main/java/de/jplag/cli/CliOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class CliOptions implements Runnable {
public File[] oldDirectories = new File[0];

@Option(names = {"--language",
"-l"}, arity = "1", converter = LanguageConverter.class, completionCandidates = LanguageCandidates.class, description = "Select the language to parse the submissions (default: java). The language names are the same as the subcommands.%n")
"-l"}, arity = "1", converter = LanguageConverter.class, completionCandidates = LanguageCandidates.class, description = "Select the language to parse the submissions (default: ${DEFAULT-VALUE}). The language names are the same as the subcommands.%n")
public Language language = defaultLanguage;

@Option(names = {"-bc", "--bc",
Expand All @@ -46,11 +46,11 @@ public class CliOptions implements Runnable {

@Option(names = {"-n",
"--shown-comparisons"}, description = "The maximum number of comparisons that will be shown in the generated report, if set "
+ "to -1 all comparisons will be shown (default: 100)%n")
+ "to -1 all comparisons will be shown (default: ${DEFAULT-VALUE})%n")
public int shownComparisons = JPlagOptions.DEFAULT_SHOWN_COMPARISONS;

@Option(names = {"-r",
"--result-directory"}, description = "Name of the directory in which the comparison results will be stored (default: result)%n")
"--result-directory"}, description = "Name of the directory in which the comparison results will be stored (default: ${DEFAULT-VALUE})%n")
public String resultFolder = "results";

@ArgGroup(heading = "Advanced%n", exclusive = false)
Expand All @@ -71,7 +71,7 @@ public void run() {
}

public static class Advanced {
@Option(names = {"-d", "--debug"}, description = "Debug parser. Non-parsable files will be stored (default: false)%n")
@Option(names = {"-d", "--debug"}, description = "Debug parser. Non-parsable files will be stored (default: ${DEFAULT-VALUE})%n")
public boolean debug;

@Option(names = {"-s", "--subdirectory"}, description = "Look in directories <root-dir>/*/<dir> for programs%n")
Expand All @@ -86,12 +86,12 @@ public static class Advanced {

@Option(names = {"-m",
"--similarity-threshold"}, description = "Comparison similarity threshold [0.0-1.0]: All comparisons above this threshold will "
+ "be saved (default: 0.0)%n")
+ "be saved (default: ${DEFAULT-VALUE})%n")
public double similarityThreshold = JPlagOptions.DEFAULT_SIMILARITY_THRESHOLD;
}

public static class Clustering {
@Option(names = {"--cluster-skip"}, description = "Skips the clustering (default: false)%n")
@Option(names = {"--cluster-skip"}, description = "Skips the clustering (default: ${DEFAULT-VALUE})%n")
public boolean disable;

@ArgGroup
Expand All @@ -102,12 +102,12 @@ public static class ClusteringEnabled {
"--cluster-algorithm"}, description = "Which clustering algorithm to use. Agglomerative merges similar submissions bottom up. "
+ "Spectral clustering is combined with Bayesian Optimization to execute the k-Means "
+ "clustering algorithm multiple times, hopefully finding a \"good\" clustering "
+ "automatically. (default: spectral)%n")
+ "automatically. (default: ${DEFAULT-VALUE})%n")
public ClusteringAlgorithm algorithm = new ClusteringOptions().algorithm();

@Option(names = {
"--cluster-metric"}, description = "The metric used for clustering. AVG is intersection over union, MAX can expose some "
+ "attempts of obfuscation. (default: MAX)%n")
+ "attempts of obfuscation. (default: ${DEFAULT-VALUE})%n")
public SimilarityMetric metric = new ClusteringOptions().similarityMetric();
}
}
Expand Down
5 changes: 5 additions & 0 deletions languages/java/src/main/java/de/jplag/java/JavaLanguage.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,9 @@ public List<Token> parse(Set<File> files) throws ParsingException {
public boolean tokensHaveSemantics() {
return true;
}

@Override
public String toString() {
return this.getIdentifier();
}
}
Loading