Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

acoc

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

acoc

  • 0.7.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

acoc - arbitrary command output colourer

acoc is a regular expression based colour formatter for programs that display output on the command-line.

It works as a wrapper around the target program, executing it and capturing the stdout stream. Optionally, stderr can be redirected to stdout, so that it, too, can be manipulated.

acoc then applies matching rules to patterns in the output and applies colour sets to those matches.

Usage

Just call the command you want to color after acoc. Arguments are passed normally:

acoc command [arg1 .. argN]

acoc supports the following command-line options:

OptionDescription
-h or --helpDisplay usage information.
-v or --versionDisplay version information.

Installation

Installing as a RubyGem should solve all dependencies:

$ gem install acoc

acoc can also make use of Masahiro Tomita's Ruby/TPty library to allocate pseudo-terminals in order to fool those programs that behave differently if their stdout stream is not connected to a tty. ls is one such program.

Whilst Ruby/TPty is not mandatory (acoc will ignore its absence), it's installation is recommended in order to improve the transparency of acoc's operation.

Configuration

Files

By reading the regular expressions on the configuration file, acoc decides how to color the output. Here's the order of reading:

  1. /usr/local/etc/acoc.conf
  2. /etc/acoc.conf
  3. ~/.acoc.conf

NOTE: When you run acoc for the first time, it places an example file on your home directory. Instructions on how to customize and add your commands are included there.

Environment Variables

acoc also responds to environment variables. You'd normally use them like this:

$ export VAR="value"
$ acoc

If ACOC is set to none, no colouring will be performed.

If ACOCRC is set, specifies the location of an additional configuration file.

Contributing

acoc is only as good as the configuration file that it uses. If you compose pattern-matching rules that you think would be useful to other people, please send them to me for inclusion in a subsequent release.

Bugs

  • Nested regular expressions do not work well. Inner subexpressions need to use clustering (?:), not capturing (). In other words, they can be used for matching, but not for colouring.

Author

acoc was written by Ian Macdonald ian@caliban.org

The Ruby Gem was made by Alexandre Dantas eu@alexdantas.net

License

Copyright (C) 2003-2004 Ian Macdonald

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

FAQs

Package last updated on 21 Jan 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc