-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from BK-SCOSS/CLI
Add Command Line Interface for scoss
- Loading branch information
Showing
12 changed files
with
518 additions
and
202 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,44 @@ | ||
import scoss | ||
|
||
import click | ||
|
||
@click.command() | ||
@click.option( | ||
'--input-dir', '-i', required=True, | ||
help='Input directory.' | ||
) | ||
@click.option( | ||
'--output-dir', '-o', | ||
help='Output directory.' | ||
) | ||
@click.option( | ||
'--threshold-combination', '-tc', | ||
type=click.Choice(['AND','OR'], case_sensitive=False), | ||
help='AND: All metrics are greater than threshold.\nOR: At least 1 metric is greater than threshold.' | ||
) | ||
@click.option( | ||
'--moss', '-mo', type=click.FloatRange(0,1), | ||
help='Use moss metric and set up moss threshold.' | ||
) | ||
@click.option( | ||
'--count-operator', '-co', type=click.FloatRange(0,1), | ||
help='Use count operator metric and set up count operator threshold.' | ||
) | ||
@click.option( | ||
'--set-operator', '-so', type=click.FloatRange(0,1), | ||
help='Use set operator metric and set up set operator threshold.' | ||
) | ||
@click.option( | ||
'--hash-operator', '-ho', type=click.FloatRange(0,1), | ||
help='Use hash operator metric and set up hash operator threshold.' | ||
) | ||
def scoss_command(input_dir, output_dir, threshold_combination,\ | ||
moss, count_operator, set_operator, hash_operator): | ||
if not output_dir: | ||
output_dir = './' | ||
|
||
scoss.get_all_plagiarism(input_dir, output_dir, threshold_combination, | ||
moss, count_operator, set_operator, hash_operator) | ||
|
||
if __name__ == '__main__': | ||
scoss_command() |
Oops, something went wrong.