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

core: make CLI posix compliant #1994

Merged
merged 1 commit into from
Jan 17, 2025
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
36 changes: 26 additions & 10 deletions src/fuzz_introspector/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,39 @@ def get_cmdline_parser() -> argparse.ArgumentParser:
default="c-cpp",
help="Language of project")

full_parser = subparsers.add_parser('full', help='End to end run')
full_parser.add_argument('--target_dir')
full_parser.add_argument('--language')
full_parser.add_argument('--out-dir', default='')
full_parser.add_argument('--name', default='no-name')
full_parser.add_argument('--coverage_url', default='')
full_parser = subparsers.add_parser(
'full', help='Analyse folder and generate HTML report and analyses.')
full_parser.add_argument('--target-dir',
type=str,
help='Directory holding source to analyse.',
required=True)
full_parser.add_argument('--language',
type=str,
help='Programming of the source code to analyse.',
choices=constants.LANGUAGES)
full_parser.add_argument('--out-dir',
default='',
type=str,
help='Folder to store analysis results.')
full_parser.add_argument('--name',
default='no-name',
type=str,
help='Name of the report.')
full_parser.add_argument('--coverage-url',
default='',
type=str,
help='Base coverage URL.')

# Report generation command
report_parser = subparsers.add_parser(
"report",
help="generate fuzz-introspector HTML report",
)
report_parser.add_argument("--target_dir",
report_parser.add_argument("--target-dir",
type=str,
help="Directory where the data files are",
required=True)
report_parser.add_argument("--coverage_url",
report_parser.add_argument("--coverage-url",
type=str,
help="URL with coverage information",
default="/covreport/linux")
Expand All @@ -76,7 +92,7 @@ def get_cmdline_parser() -> argparse.ArgumentParser:
action='store_true',
default=False,
help="Enables all analyses")
report_parser.add_argument("--correlation_file",
report_parser.add_argument("--correlation-file",
type=str,
default="",
help="File with correlation data")
Expand All @@ -99,7 +115,7 @@ def get_cmdline_parser() -> argparse.ArgumentParser:
"correlate",
help="correlate executable files to fuzzer introspector logs")
correlate_parser.add_argument(
"--binaries_dir",
"--binaries-dir",
type=str,
required=True,
help="Directory with binaries to scan for Fuzz introspector tags")
Expand Down
2 changes: 2 additions & 0 deletions src/fuzz_introspector/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

SAVED_SOURCE_FOLDER = 'source-code'

LANGUAGES = ['c', 'c++', 'jvm', 'go', 'rust']

# Holds data about all functions in javascript, to ease loading of static
# website.
ALL_FUNCTION_JS = "all_functions.js"
Expand Down
Loading