Skip to content

Commit

Permalink
trurl: silence --replace-append when appending
Browse files Browse the repository at this point in the history
Previously trurl would about a "note" when it did not replace a query
name and instead appends it, but since that is just part of its
documented behavior that output seems superfluous and rather annoying.

Update two tests accordingly.
  • Loading branch information
bagder committed Sep 13, 2024
1 parent 6cdc5ff commit 94b8fde
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -2495,7 +2495,7 @@
},
"expected": {
"stdout": "http://test.org/?that=thing&key=foo\n",
"stderr": "trurl note: key 'key' not in url, appending to query\n",
"stderr": "",
"returncode": 0
}
},
Expand All @@ -2509,7 +2509,7 @@
},
"expected": {
"stdout": "http://test.org/?that=thing&key=foo\n",
"stderr": "trurl note: key 'key' not in url, appending to query\n",
"stderr": "",
"returncode": 0
}
},
Expand Down
3 changes: 0 additions & 3 deletions trurl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1661,9 +1661,6 @@ static bool replace(struct option *o)
}

if(!replaced && o->force_replace) {
trurl_warnf(o, "key '%.*s' not in url, appending to query",
(int) (key.len),
key.str);
addqpair(key.str, strlen(key.str), o->jsonout);
query_is_modified = true;
}
Expand Down

0 comments on commit 94b8fde

Please sign in to comment.