Skip to content

Change default inline marker from #→ to #=> #13

Closed
@aureliojargas

Description

At first it seemed a nice idea to use the Unicode arrow to identify the special inline match mode, using #→. It is pretty and won't confuse with common commands.

$ echo foo                    #→ foo
$ head /etc/passwd            #→ --lines 10
$ tac /etc/passwd | tac       #→ --file /etc/passwd
$ cat /etc/passwd             #→ --egrep ^root:
$ echo $((2 + 10))            #→ --regex ^\d+$
$ make test                   #→ --exit 0
$ pwd                         #→ --eval echo $PWD

The years passed, and now I find it annoying that I can't type that arrow directly in my keyboard. I always have to copy/paste from somewhere else. That's not a good user experience.

Recently, doing some tests with clitest in the Alpine Linux docker image, the Unicode char just didn't work in /bin/ash. Using any other ASCII-only marker was ok.

I'm inclined to change the default to the ASCII alternative #=>. It's uglier, but more portable and easier to type.

$ echo foo                    #=> foo
$ head /etc/passwd            #=> --lines 10
$ tac /etc/passwd | tac       #=> --file /etc/passwd
$ cat /etc/passwd             #=> --egrep ^root:
$ echo $((2 + 10))            #=> --regex ^\d+$
$ make test                   #=> --exit 0
$ pwd                         #=> --eval echo $PWD

Since a default setting will change, this will break backward compatibility with previous versions and will require a new major version.

Current scripts who rely in the Unicode marker can just add a new option to continue using it without changing the test files (note the required space at the end):

clitest --inline-prefix '#→ ' tests.txt

Any thoughts on that?

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions