Skip to content

wpdevelopment11/diff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Implementation of the Hunt-McIlroy algorithm and the diff command-line utility

Command-line utilities

diff-cli.py - Print the diff of the two files or strings

The diff is printed in the normal output format.

Usage:
diff-cli.py [-h] [-s] fileA fileB

Print the diff. In other words, print the changes needs to be done to the first file to produce the second one.

Positional arguments:
  fileA          Path to the first file
  fileB          Path to the second file

Options:
  -s, --strings  Interpret both arguments as strings
  -h, --help     show this help message and exit

lcs-cli.py - Print the longest common subsequence between the two files or strings

Usage:
lcs-cli.py [-h] [-s] fileA fileB

Print the longest common subsequence (LCS) between the two files.

Positional arguments:
  fileA          Path to the first file
  fileB          Path to the second file

Options:
  -s, --strings  Interpret both arguments as strings
  -h, --help     show this help message and exit

API

Find the longest common subsequence (LCS) of the two sequences.

LCS(seq_a, seq_b)

Given the LCS and the two sequences create the hunks of differences.

get_hunks(lcs, seq_a, seq_b)

Run tests

python -m unittest discover test

About

Implementation of the Hunt-McIlroy algorithm and the diff utility in Python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy