[backport#15497] Add ParseRange function to parse args of the form int/[int,int]
Summary:
https://github.com/bitcoin/bitcoin/pull/15497/commits/7aa6a8aefbb2013ef3dc87ecbdf5d947d4b413af
Partial backport of Core PR15497
Test Plan:
ninja
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D6610