Naheel-Azawy / stpv

Simple Terminal PreViewer
GNU General Public License v3.0
96 stars 12 forks source link

Fix error when there are no files matching the glob #24

Closed NikitaIvanovV closed 2 years ago

NikitaIvanovV commented 2 years ago

I was working on other PRs and had this error:

cat: '/tmp/stpvimgfifo*-pid': No such file or directory
error: unsupported SysV option

Usage:
 ps [options]

 Try 'ps --help <simple|list|output|threads|misc|all>'
  or 'ps --help <s|l|o|t|m|a>'
 for additional help text.

For more details see ps(1).

It turned out that a glob simply outputs itself if nothing matches. So this PR replaces a plain globbing with find command that outputs nothing in that case.