Error messages about invalid characters in paths/field names/tags should show the string escaped.
Imagine the user copy-pastes some text that happens to contain the "zero width space" unicode character (\xE2\x80\x8B in utf-8 hex notation), and uses that text in the path in coffer create.
This character is completely invisible, but coffer will (correctly) reject it.
At the moment, because we don't escape it, this is what the user will see:
Invalid entry path: 'hellothere'.
Path segments can only contain the following characters: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_'
Usage: coffer create ENTRYPATH [-e|--edit] [-f|--force] [--tag TAG]
[--field NAME=CONTENT] [--privatefield NAME=CONTENT]
Create a new entry at the specified path
This will just leave the user scratching their head - we're telling them the path has invalid characters, but all the characters shown on the screen are valid!
To avoid this, we should display invalid paths/field names/tags with all characters escaped.
Acceptance criteria
Invalid paths/field names/tags are displayed with all characters escaped.
Clarification and motivation
Error messages about invalid characters in paths/field names/tags should show the string escaped.
Imagine the user copy-pastes some text that happens to contain the "zero width space" unicode character (
\xE2\x80\x8B
in utf-8 hex notation), and uses that text in the path incoffer create
.This character is completely invisible, but
coffer
will (correctly) reject it.At the moment, because we don't escape it, this is what the user will see:
This will just leave the user scratching their head - we're telling them the path has invalid characters, but all the characters shown on the screen are valid!
To avoid this, we should display invalid paths/field names/tags with all characters escaped.
Acceptance criteria