Skip to content

Commit b71a157

Browse files
committed
flux-ping: use optparse_get_size_int() for --pad option
Problem: The flux-ping(1) --pad=N option doesn't take an optional suffix to scale the result, so specification of large pad sizes is unnecssarily inconvenient. Use optparse_get_size_int() to access the --pad option argument so it supports suffixes [kKMG].
1 parent 36dc5fc commit b71a157

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/cmd/flux-ping.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,7 @@ int main (int argc, char *argv[])
316316
if (!(target = strdup (argv[optindex])))
317317
log_msg_exit ("out of memory");
318318

319-
pad_bytes = optparse_get_int (opts, "pad", 0);
320-
if (pad_bytes < 0)
321-
log_msg_exit ("pad must be >= 0");
319+
pad_bytes = optparse_get_size_int (opts, "pad", "0");
322320

323321
ctx.nodeid = FLUX_NODEID_ANY;
324322
if (optparse_hasopt (opts, "rank")) {

0 commit comments

Comments
 (0)