Cross-platform command line argument iterator.

Fields

inner: InnerType,

Functions

fn deinit(self: *ArgIterator) void

Call this to free the iterator’s internal buffer if the iterator was created wi…

Call this to free the iterator’s internal buffer if the iterator was created with initWithAllocator function.

fn init() ArgIterator

Initialize the args iterator. Consider using initWithAllocator() instead for cr…

Initialize the args iterator. Consider using initWithAllocator() instead for cross-platform compatibility.

fn initWithAllocator(allocator: Allocator) InitError!ArgIterator

You must deinitialize iterator’s internal buffers by calling deinit when done.

fn next(self: *ArgIterator) ?[:0]const u8

Get the next argument. Returns ‘null’ if we are at the end. Returned slice is p…

Get the next argument. Returns ‘null’ if we are at the end. Returned slice is pointing to the iterator’s internal buffer.

fn skip(self: *ArgIterator) bool

Parse past 1 argument without capturing it. Returns true if skipped an arg, `…

Parse past 1 argument without capturing it. Returns true if skipped an arg, false if we are at the end.

Values

InitError
type