Sha256: b241524b2ff9c67a1c2d0eb9bb444978ec2ddd123155d657e9b55d3419f94d21

Contents?: true

Size: 877 Bytes

Versions: 2

Compression:

Stored size: 877 Bytes

Contents

# Copyright: 2015 Masatake YAMATO
# License: GPL-2

CTAGS=$1

if ! sort --help | grep --quiet GNU; then
    echo "GNU sort is needed to run this test case"
    exit 77
fi

print_help()
{
    ${CTAGS} --quiet --options=NONE --help
}

opt_sort()
{
    sort --ignore-case --stable
}

extract_short_options()
{
    sed -n '/Usage:/,$p'  | \
    sed -n 's/\(^  -[[:alnum:]]\).*/\1/p'
}

extract_long_options()
{
    sed -n '/Usage:/,$p'  | \
    sed -n 's/\(^  --[:alnum:][<>[:alnum:]_-]*\).*/\1/p'
}

extract_debug_options()
{
    sed -n '/Usage:/,$p'  | \
    sed -n 's/\(^  --_[<>[:alnum:]_-]*\).*/\1/p'
}


gdiff()
{
    print_help | extract_$1_options > ./$1.tmp
    print_help | extract_$1_options | opt_sort > ./sorted-$1.tmp

    diff -ruN ./$1.tmp ./sorted-$1.tmp
    r=$?
    rm ./$1.tmp ./sorted-$1.tmp

    return $r
}

gdiff short && gdiff long  && gdiff debug
exit $?

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ctags.rb-1.1.4 ext/vendor/ctags/Tmain/sorted-help-message.d/run.sh
ctags.rb-1.1.3 ext/vendor/ctags/Tmain/sorted-help-message.d/run.sh