Skip to content

feature request: send a signal if the message was truncated or not #21

@llimllib

Description

@llimllib

I want to use ttok to truncate input, and inform the user if it was truncated. At the moment, that'd mean I have to call ttok twice as far as I can tell - once to count the tokens and a second time to truncate.

ttok takes about 0.16 seconds to run on my machine even with minimal input, which means that two calls add up to .3 seconds, which is definitely perceptible to the user.

You probably can't alter the return code of ttok -t at this point; many users are likely depending on the return code being 0 whether it truncates or not.

The only way I can think of to implement this feature would be with another command-line flag for "truncate and signal", which would return a non-zero status code if it truncated the input - any out of band signalling mechanism I can think of seems like it wouldn't work across platforms

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions