forked from kiss-community/kiss
kiss-owns: Make output simpler.
This changes the output of the utility to the package name of the match if one exists. The utility is now usable in scripts.
This commit is contained in:
parent
a92cb95673
commit
f59b725cdd
@ -6,7 +6,7 @@
|
|||||||
file=$(readlink -f "$KISS_ROOT/${1##$KISS_ROOT}")
|
file=$(readlink -f "$KISS_ROOT/${1##$KISS_ROOT}")
|
||||||
|
|
||||||
[ -f "$file" ] || {
|
[ -f "$file" ] || {
|
||||||
printf 'usage: kiss-owns [/path/to/file]\n'
|
printf 'usage: kiss-owns [/path/to/file]\n' >&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20,4 +20,4 @@ pkg_owns=$(grep -lFx "${file##$KISS_ROOT}" \
|
|||||||
pkg_owns=${pkg_owns%/*}
|
pkg_owns=${pkg_owns%/*}
|
||||||
pkg_owns=${pkg_owns##*/}
|
pkg_owns=${pkg_owns##*/}
|
||||||
|
|
||||||
printf '%s\n' "[$pkg_owns] owns '$1'"
|
printf '%s\n' "$pkg_owns"
|
||||||
|
Loading…
Reference in New Issue
Block a user