diff --git a/cpp/piscsi/piscsi_core.cpp b/cpp/piscsi/piscsi_core.cpp index ff6ecc18..c5391ce0 100644 --- a/cpp/piscsi/piscsi_core.cpp +++ b/cpp/piscsi/piscsi_core.cpp @@ -157,7 +157,6 @@ void Piscsi::TerminationHandler(int) Piscsi::optargs_type Piscsi::ParseArguments(const vector& args, int& port) const { optargs_type optargs; - int block_size = 0; string name; opterr = 1; @@ -168,6 +167,7 @@ Piscsi::optargs_type Piscsi::ParseArguments(const vector& args, int& por // the 'bus' object is created and configured case 'i': case 'I': + case 'b': case 'd': case 'D': case 'R': @@ -182,13 +182,6 @@ Piscsi::optargs_type Piscsi::ParseArguments(const vector& args, int& por continue; } - case 'b': { - if (!GetAsUnsignedInt(optarg, block_size)) { - throw parser_exception("Invalid block size " + string(optarg)); - } - continue; - } - case 'L': current_log_level = optarg; continue; @@ -220,7 +213,7 @@ Piscsi::optargs_type Piscsi::ParseArguments(const vector& args, int& por } if (optopt) { - throw parser_exception("Praser error"); + throw parser_exception("Parser error"); } } @@ -253,6 +246,12 @@ void Piscsi::CreateInitialDevices(const optargs_type& optargs) const id_and_lun = value; continue; + case 'b': + if (!GetAsUnsignedInt(value, block_size)) { + throw parser_exception("Invalid block size " + value); + } + continue; + case 'z': locale = value.c_str(); continue;