Skip to content

Commit

Permalink
Make surject stop if unused command line arguments are kicking around
Browse files Browse the repository at this point in the history
  • Loading branch information
adamnovak committed Jul 11, 2024
1 parent ed2737d commit 3602e58
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/subcommand/surject_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,14 @@ int main_surject(int argc, char** argv) {
}
}

string file_name = get_input_file_name(optind, argc, argv);

if (have_input_file(optind, argc, argv)) {
// We only take one input file.
cerr << "error[vg surject] Extra argument provided: " << get_input_file_name(optind, argc, argv, false) << endl;
exit(1);
}

// Create a preprocessor to apply read group and sample name overrides in place
auto set_metadata = [&](Alignment& update) {
if (!sample_name.empty()) {
Expand All @@ -261,8 +269,6 @@ int main_surject(int argc, char** argv) {
}
};

string file_name = get_input_file_name(optind, argc, argv);

PathPositionHandleGraph* xgidx = nullptr;
unique_ptr<PathHandleGraph> path_handle_graph;
// If we add an overlay for path position queries, use one optimized for
Expand Down

1 comment on commit 3602e58

@adamnovak
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vg CI tests complete for branch reject-extra-surject-args. View the full report here.

16 tests passed, 0 tests failed and 0 tests skipped in 18292 seconds

Please sign in to comment.