ambevar-dotfiles/.config/fish/functions/describe.fish

22 lines
468 B
Fish
Raw Normal View History

function describe -d 'Extended "type"'
2016-10-13 11:09:04 +02:00
for i in $argv
set typ (type -t $i ^ /dev/null)
if test $status -ne 0
set -l path $i
ls -l $path
file $path | cut -d':' -f2 | cut -b 2-
type -pq pacman; and pacman -Qo $path ^ /dev/null
continue
end
switch $typ
2016-10-13 11:09:04 +02:00
case file
set -l path (type -p $i)
ls -l $path
file $path | cut -d':' -f2 | cut -b 2-
type -pq pacman; and pacman -Qo $path ^ /dev/null
2016-10-13 11:09:04 +02:00
case '*'
type $i
2016-10-13 11:09:04 +02:00
end
end
end