cmdcolor icon indicating copy to clipboard operation
cmdcolor copied to clipboard

Accept arguments in lieu of STDIN

Open BobVul opened this issue 11 years ago • 4 comments

Perhaps accept arguments, so it can be called like:

cmdcolor \033[31m RED ON DEFAULT

This could be useful from batch scripts.

BobVul avatar Dec 01 '14 04:12 BobVul

Sure, I'll look into this. However, for now, the same can be accomplished with the following:

IF [%1] == [PIPE] (
    SHIFT
) ELSE (
    CALL %0 PIPE %* | cmdcolor
    GOTO :EOF
)

This makes the script pipe itself through cmdcolor, so any echo beyond that will be colored.

alecmev avatar Dec 01 '14 07:12 alecmev

Thanks for considering it.

Yes, that is an alternative. However, it has a slightly different effect: the colour persists until manually reset. To achieve the same effect as running the command for each line, it would be necessary to reset to the default at the end of each echo.

Currently, I'm using echo text | cmdcolor. This is definitely more of a nice-to-have - it would make scripts tidier.

BobVul avatar Dec 02 '14 00:12 BobVul