Skip to content

Commit b488dc0

Browse files
committed
Add example argument
1 parent 191d5b7 commit b488dc0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

builtins/operators/read_custom_log.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,14 @@ class read_custom_log_plugin final
272272
// Using `named_optional`, we add our argument. You can also use the
273273
// `positional` and/or `named`. See `argument_parser2.hpp`. If you dont need
274274
// any arguments, you can skip this part.
275-
auto time_offset = tenzir::duration{0s};
276-
parser.named_optional("time_offset", time_offset);
275+
auto time_offset = std::optional<tenzir::duration>{0s};
276+
parser.named("time_offset", time_offset);
277277
// We let the argument_parser parse our arguments. The TRY macro ensures
278278
// that a parsing failure will stop the setup.
279279
TRY(parser.parse(inv, ctx));
280280
// Create the operator instance, passing in any arguments that the operator
281281
// requires.
282-
return std::make_unique<read_custom_log_operator>(time_offset);
282+
return std::make_unique<read_custom_log_operator>(*time_offset);
283283
}
284284
};
285285

0 commit comments

Comments
 (0)