GithubHelp home page GithubHelp logo

csdiff's Introduction

csdiff : Colorize The Output Of The 'sdiff' Command

csdiff is a simple perl wrapper that produces a colorized version of the output of the UNIX 'sdiff' command.

Screenshot

Invocation

The program is invoked much like 'sdiff' itself. Most options and arguments are passed on directly to sdiff, and the output is intercepted and colorized using ANSI color sequences. The exception is for a select few options that csdiff will interpret for itself when placed in front of any other options that 'sdiff' understands. The csdiff-specific options are -C (context mode), -F (filter mode) and -S (summary mode).

  csdiff        file1 file2  # compare two files
  csdiff     -i file1 file2  # use -i option of sdiff
  csdiff -C5 -i file1 file2  # here, -C is an option of csdiff

csdiff Options

  • The -C option selects how many lines of context to show around changes.

  • The -F option selects which parts of the report to show. One or several of these letters can be specified:

    • 's' or 'u' Same or unchanged lines
    • 'a' Added lines
    • 'd' Deleted lines
    • 'm' or 'c' Modified/changed lines
    • 'o' Omitted (only when -C is specified)

    Several of these letter can be supplied to a single -F option:

  csdiff -F adm file1 file2   # only shows added, deleted and modified lines
  • Note that when using -C and -F at the same time, unselected reports in -F become part of the definition of 'context' for -C.

  • The -S option triggers a 'summary' mode (no diff is shown, and -F and -C are ignored)

History

This is an old wrapper script, written probably around 2006 by Pierre Rioux and privately maintained until its release on GitHub in August 2015. The code stinks a bit, but it's quite stable and has been working flawlessly on Mac OS X and Linux platforms ever since it was created.

csdiff's People

Contributors

prioux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.