Open xiaoxichen opened 7 months ago
we are expecting
/dev/sdb:NVME
can be parsed as /dev/sdb
as path , NVME
as type.
also expecting
dev/sdc
can be parsed as/dev/sdc
as path, AUTO_DETECT
as type.
However the later one doesnt work prior to this change , as we attempt to read post EOF for the type.
Now SM has to pass AUTO_DETECT
explicitly, c.f https://github.corp.ebay.com/SDS/storage_mgr/pull/106/files#diff-77713e57d4672c7f5d23883b612967d7984474a2cc0222ac802717228501b50fR161
With this PR merged, SM do not need pass-in the AUTO_DETECT
in https://github.com/jarro2783/cxxopts/blob/v3.2.1/include/cxxopts.hpp#L1011-L1018
it checks the (!in), if we read after reaching EOF, the !in will be true which results a incorrect_argument_type exception thrown.
we should be very careful to avoid read after reaching eof.