From 664e7ad995a86663e12fc0785ffd3cdc939b9311 Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Wed, 19 Aug 2009 15:03:28 +0000 Subject: Change programmer options separator from = to : Current programmer parameter syntax is -p programmer=parameter Unfortunately, many parameters are of the form variable=val, so we get commandlines like this. flashrom -p it87spi=port=0x820 and this looks horrible. Using : instead of = would make such parameters look better: flashrom -p it87spi:port=0x820 As a side benefit, this patch mentions the programmer name in the error message if it is unknown. Corresponding to flashrom svn r693. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Stefan Reinauer --- flashrom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'flashrom.c') diff --git a/flashrom.c b/flashrom.c index b1f9471..b531699 100644 --- a/flashrom.c +++ b/flashrom.c @@ -708,7 +708,7 @@ int main(int argc, char *argv[]) namelen = strlen(name); if (strncmp(optarg, name, namelen) == 0) { switch (optarg[namelen]) { - case '=': + case ':': programmer_param = strdup(optarg + namelen + 1); break; case '\0': @@ -725,7 +725,7 @@ int main(int argc, char *argv[]) } } if (programmer == PROGRAMMER_INVALID) { - printf("Error: Unknown programmer.\n"); + printf("Error: Unknown programmer %s.\n", optarg); exit(1); } break; -- cgit v1.1