diff --git a/opustags.1 b/opustags.1 index 366a563..8bb64f3 100644 --- a/opustags.1 +++ b/opustags.1 @@ -97,7 +97,7 @@ Delete all the previously existing tags. Sets the tags from scratch. All the original tags are deleted and new ones are read from standard input. Each line must specify a \fIFIELD=VALUE\fP pair and be separated with line feeds. -Blank lines are ignored. +Blank lines and lines starting with \fI#\fP are ignored. .SH EXAMPLES .PP List all the tags in file foo.opus: diff --git a/src/cli.cc b/src/cli.cc index 9141892..909629f 100644 --- a/src/cli.cc +++ b/src/cli.cc @@ -202,6 +202,8 @@ ot::status ot::read_comments(FILE* input, std::list& comments) --nread; if (nread == 0) continue; + if (line[0] == '#') // comment + continue; if (memchr(line, '=', nread) == nullptr) { ot::status rc = {ot::st::error, "Malformed tag: " + std::string(line, nread)}; free(line); diff --git a/t/opustags.t b/t/opustags.t index c21a094..b6334b8 100755 --- a/t/opustags.t +++ b/t/opustags.t @@ -179,6 +179,7 @@ ARTIST=七面鳥 A=A X=Y +#IGNORE=COMMENTS END_IN OK=yes again ARTIST=七面鳥