diff --git a/src/fe-analysedriveresponse.cc b/src/fe-analysedriveresponse.cc index 6b1f2c19..52dd14ea 100644 --- a/src/fe-analysedriveresponse.cc +++ b/src/fe-analysedriveresponse.cc @@ -22,9 +22,7 @@ static StringFlag destFlux({"--dest", "-d"}, globalConfig().setFluxSink(value); }); -static IntFlag destTrack({"--cylinder", "-c"}, "track to write to", 0); - -static IntFlag destHead({"--head", "-h"}, "head to write to", 0); +static StringFlag destTracks({"--tracks", "-t"}, "tracks to write to", "c0h0"); static DoubleFlag minInterval( {"--min-interval-us"}, "Minimum pulse interval", 2.0); @@ -251,11 +249,14 @@ int mainAnalyseDriveResponse(int argc, const char* argv[]) if (globalConfig()->flux_sink().type() != FLUXTYPE_DRIVE) error("this only makes sense with a real disk drive"); + auto tracks = parseCylinderHeadsString(destTracks); + if (tracks.size() != 1) + error("you must specify exactly one track"); usbSetDrive(globalConfig()->drive().drive(), globalConfig()->drive().high_density(), globalConfig()->drive().index_mode()); - usbSeek(destTrack); + usbSeek(tracks[0].cylinder); std::cout << "Measuring rotational speed...\n"; nanoseconds_t period = usbGetRotationalPeriod(0); @@ -291,12 +292,12 @@ int mainAnalyseDriveResponse(int argc, const char* argv[]) outFluxmap.appendPulse(); } - usbWrite(destHead, outFluxmap.rawBytes(), 0); + usbWrite(tracks[0].head, outFluxmap.rawBytes(), 0); /* Read the test pattern in again. */ Fluxmap inFluxmap; - inFluxmap.appendBytes(usbRead(destHead, true, period, 0)); + inFluxmap.appendBytes(usbRead(tracks[0].head, true, period, 0)); /* Compute histogram. */ diff --git a/src/fe-inspect.cc b/src/fe-inspect.cc index d66cddc4..9bb78123 100644 --- a/src/fe-inspect.cc +++ b/src/fe-inspect.cc @@ -21,9 +21,7 @@ static StringFlag sourceFlux({"--source", "-s"}, globalConfig().setFluxSource(value); }); -static IntFlag trackFlag({"--cylinder", "-c"}, "Track to read.", 0); - -static IntFlag headFlag({"--head", "-h"}, "Head to read.", 0); +static StringFlag destTracks({"--tracks", "-t"}, "tracks to write to", "c0h0"); static SettableFlag dumpFluxFlag( {"--dump-flux", "-F"}, "Dump raw magnetic disk flux."); @@ -135,7 +133,10 @@ int mainInspect(int argc, const char* argv[]) flags.parseFlagsWithConfigFiles(argc, argv, {}); auto fluxSource = FluxSource::create(globalConfig()); - const auto fluxmap = fluxSource->readFlux(trackFlag, headFlag)->next(); + auto tracks = parseCylinderHeadsString(destTracks); + if (tracks.size() != 1) + error("you must specify exactly one track"); + const auto fluxmap = fluxSource->readFlux(tracks[0])->next(); std::cout << fmt::format("0x{:x} bytes of data in {:.3f}ms\n", fluxmap->bytes(), diff --git a/src/fe-seek.cc b/src/fe-seek.cc index 8f933716..038f6169 100644 --- a/src/fe-seek.cc +++ b/src/fe-seek.cc @@ -16,7 +16,7 @@ static StringFlag sourceFlux({"-s", "--source"}, globalConfig().setFluxSource(value); }); -static IntFlag track({"--cylinder", "-c"}, "track to seek to", 0); +static IntFlag track({"--cylinder", "-t"}, "track to seek to", 0); extern const std::map readables;