33 lines
717 B
C
33 lines
717 B
C
/*
|
|
* asl_capture_tool.c
|
|
* Thin CLI wrapper around libasl-capture
|
|
*
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include "asl_capture.h"
|
|
|
|
int main(int argc, char **argv) {
|
|
if (argc < 2) {
|
|
fprintf(stderr, "Usage: %s <command> [args...]\n", argv[0]);
|
|
return 1;
|
|
}
|
|
|
|
asl_capture_result_t result;
|
|
int ret = asl_capture_run(ASL_CAPTURE_PIPE, argv + 1, &result);
|
|
|
|
if (ret != 0) {
|
|
fprintf(stderr, "asl-capture: command failed with code %d\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
// Optionally print captured artifact info
|
|
printf("Artifact ID: %s\n", result.artifact_id);
|
|
printf("PER generated: %s\n", result.per_id);
|
|
|
|
return 0;
|
|
}
|
|
|