Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Use COLUMNS environment variable for console width #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vadz
Copy link
Contributor

@vadz vadz commented Mar 4, 2016

If this variable is defined (which is not always the case but at least
respecting it allows us to wrap things properly if it is), use it instead of
the hard-coded 80 character line width.

Closes #7.


Notice that I had to update catch.hpp as well because otherwise I was getting incomprehensible errors from main.cpp which used Tbc::TextAttributes from there and not from clara.h itself. In fact, I think this points out a serious problem with the current stitching approach: it can easily result in ODR violations because the same stuff is stitched into both catch.hpp and clara.h. To solve this you'd need to use unique namespaces for the internal stuff for the two headers.

BTW, why does Clara use .h extension when CATCH uses .hpp? Wouldn't it be better to use the latter for Clara too, if only for consistency?

If this variable is defined (which is not always the case but at least
respecting it allows us to wrap things properly if it is), use it instead of
the hard-coded 80 character line width.

Closes catchorg#7.
@philsquared
Copy link
Collaborator

Thanks for this. I'd like to use this PR at some point.
My concern at the moment is that I think you've hit on a problem with a half-finished implementation of an idea. I think I need to do a bit more work on the stitching script as the TextAttributes lib should be independently embedded in both Clara and Catch - thus avoiding ODR (and other) issues.
Unfortunately I haven't touched that for a while and I don't think it was completely finished. It's also a bit complex. So I'm going to need to do a big push to get that sorted - which I won't have time for for a while.

So I just wanted to let you know that I'm not ignoring this in the meantime.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants