-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
98 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
1c1 | ||
< 0 | ||
--- | ||
> 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
0a1 | ||
> 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
1c1 | ||
< 0 | ||
--- | ||
> 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
1d0 | ||
< 0 | ||
1d0 | ||
< 1 | ||
1d0 | ||
< 2 | ||
1d0 | ||
< 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
bin/* | ||
cat | ||
coreutils/* | ||
diffutils/* | ||
diff | ||
etc/* | ||
gawk/* | ||
gnulib/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env bash | ||
#!dgsh | ||
# | ||
# Dgsh-compatible wrapping of the GNU diff command | ||
# Depending on the arguments, the command can accept 0-N inputs | ||
# | ||
|
||
|
||
# For the parsing of long options see | ||
# https://stackoverflow.com/questions/402377/using-getopts-in-bash-shell-script-to-get-long-and-short-command-line-options/7680682#7680682 | ||
optspec=":qscC:uU:enyW:pF:tTlrNx:X:S:iEZbwBIaD:dv-:" | ||
while getopts "$optspec" optchar; do | ||
case "${optchar}" in | ||
-) | ||
case "${OPTARG}" in | ||
from-file) | ||
from_file="${!OPTIND}" | ||
OPTIND=$(($OPTIND + 1)) | ||
;; | ||
from-file=*) | ||
from_file=${OPTARG#*=} | ||
;; | ||
to-file) | ||
to_file="${!OPTIND}" | ||
OPTIND=$(($OPTIND + 1)) | ||
;; | ||
to-file=*) | ||
to_file=${OPTARG#*=} | ||
;; | ||
esac | ||
;; | ||
esac | ||
done | ||
|
||
# Examine the number of remaining (non-option) arguments | ||
case $(($# - $OPTIND + 1)) in | ||
0) | ||
if [[ -n "$from_file" ]] || [[ -n "$to_file" ]] ; then | ||
# An arbitrary number of inputs can be handled | ||
exec dgsh-wrap -i a /usr/bin/diff "$@" | ||
else | ||
# Exactly two inputs are required | ||
exec dgsh-wrap /usr/bin/diff "$@" '<|' '<|' | ||
fi | ||
;; | ||
1) | ||
if [[ -n "$from_file" ]] || [[ -n "$to_file" ]] ; then | ||
# No input is required | ||
exec dgsh-wrap -i 0 /usr/bin/diff "$@" | ||
elif [[ "${!OPTIND}" == '-' ]] ; then | ||
# One (non-stdin) input is required | ||
exec dgsh-wrap -I /usr/bin/diff "$@" '<|' | ||
else | ||
# One (stdin) input is required | ||
exec dgsh-wrap /usr/bin/diff "$@" - | ||
fi | ||
;; | ||
*) | ||
# No input is required | ||
exec dgsh-wrap -i 0 /usr/bin/diff "$@" | ||
;; | ||
esac |
Submodule diffutils
deleted from
b9c7e0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters