Update a few places which used -c for other purposes.

This commit is contained in:
David Given
2025-08-20 21:30:06 +02:00
parent ec16931f3a
commit e2a6fbcf3c
3 changed files with 13 additions and 11 deletions

View File

@@ -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. */

View File

@@ -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(),

View File

@@ -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<std::string, std::string> readables;