save progress
This commit is contained in:
@@ -33,6 +33,9 @@ internal static class BinaryCommandGroup
|
||||
binary.Add(BuildLookupCommand(services, verboseOption, cancellationToken));
|
||||
binary.Add(BuildFingerprintCommand(services, verboseOption, cancellationToken));
|
||||
|
||||
// Sprint: SPRINT_20260104_001_CLI - Binary call graph digest extraction
|
||||
binary.Add(BuildCallGraphCommand(services, verboseOption, cancellationToken));
|
||||
|
||||
return binary;
|
||||
}
|
||||
|
||||
@@ -188,6 +191,70 @@ internal static class BinaryCommandGroup
|
||||
return command;
|
||||
}
|
||||
|
||||
// CALLGRAPH-01: stella binary callgraph
|
||||
private static Command BuildCallGraphCommand(
|
||||
IServiceProvider services,
|
||||
Option<bool> verboseOption,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var fileArg = new Argument<string>("file")
|
||||
{
|
||||
Description = "Path to binary file to analyze."
|
||||
};
|
||||
|
||||
var formatOption = new Option<string>("--format", ["-f"])
|
||||
{
|
||||
Description = "Output format: digest (default), json, summary."
|
||||
}.SetDefaultValue("digest").FromAmong("digest", "json", "summary");
|
||||
|
||||
var outputOption = new Option<string?>("--output", ["-o"])
|
||||
{
|
||||
Description = "Output file path (default: stdout)."
|
||||
};
|
||||
|
||||
var emitSbomOption = new Option<string?>("--emit-sbom")
|
||||
{
|
||||
Description = "Path to SBOM file to inject callgraph digest as property."
|
||||
};
|
||||
|
||||
var scanIdOption = new Option<string?>("--scan-id")
|
||||
{
|
||||
Description = "Scan ID for graph metadata (default: auto-generated)."
|
||||
};
|
||||
|
||||
var command = new Command("callgraph", "Extract call graph and compute deterministic digest.")
|
||||
{
|
||||
fileArg,
|
||||
formatOption,
|
||||
outputOption,
|
||||
emitSbomOption,
|
||||
scanIdOption,
|
||||
verboseOption
|
||||
};
|
||||
|
||||
command.SetAction(parseResult =>
|
||||
{
|
||||
var file = parseResult.GetValue(fileArg)!;
|
||||
var format = parseResult.GetValue(formatOption)!;
|
||||
var output = parseResult.GetValue(outputOption);
|
||||
var emitSbom = parseResult.GetValue(emitSbomOption);
|
||||
var scanId = parseResult.GetValue(scanIdOption);
|
||||
var verbose = parseResult.GetValue(verboseOption);
|
||||
|
||||
return BinaryCommandHandlers.HandleCallGraphAsync(
|
||||
services,
|
||||
file,
|
||||
format,
|
||||
output,
|
||||
emitSbom,
|
||||
scanId,
|
||||
verbose,
|
||||
cancellationToken);
|
||||
});
|
||||
|
||||
return command;
|
||||
}
|
||||
|
||||
private static Command BuildSubmitCommand(
|
||||
IServiceProvider services,
|
||||
Option<bool> verboseOption,
|
||||
|
||||
Reference in New Issue
Block a user