Merge branch 'devel'

This commit is contained in:
Radovan Garabík 2017-05-21 16:46:51 +02:00
commit ffd3b12a40
4 changed files with 18 additions and 9 deletions

View File

@ -198,3 +198,4 @@ Or for zsh users, append to `~/.zshrc`:
Add to `~/.config/fish/config.fish` or in a new file in `~/.config/fish/conf.d/`:
source /usr/local/etc/grc.fish

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
grc (1.11.1-1) unstable; urgency=low
* better error handling if command is not found
-- Radovan Garabík <garabik@kassiopeia.juls.savba.sk> Sun, 21 May 2017 16:01:51 +0200
grc (1.11-1) unstable; urgency=low
* clean up directories

17
grc
View File

@ -6,11 +6,11 @@ import os, re, string, sys, getopt, signal
def version():
print ("Generic Colouriser 1.11")
print ("Generic Colouriser 1.11.1")
sys.exit()
def help():
print("""Generic Colouriser 1.11
print("""Generic Colouriser 1.11.1
grc [options] command [args]
Options:
-e --stderr redirect stderr. If this option is selected,
@ -137,7 +137,11 @@ if cfile != "" and colour:
os.dup2(chie, 2)
os.close(choe)
os.close(chie)
os.execvp(args[0], args)
try:
os.execvp(args[0], args)
except OSError as e:
sys.stderr.write('grc: %s: %s\n' % (args[0], e.strerror))
sys.exit(1)
if stdoutff:
@ -190,11 +194,8 @@ else:
if pidp == 0:
try:
os.execvp(args[0], args)
except FileNotFoundError:
sys.stderr.write('grc: %s: command not found\n' % args[0])
sys.exit(1)
except PermissionError:
sys.stderr.write('grc: %s: Permission error\n' % args[0])
except OSError as e:
sys.stderr.write('grc: %s: %s\n' % (args[0], e.strerror))
sys.exit(1)
try:
status = os.wait()[1]

View File

@ -21,7 +21,8 @@ cp -fv grc.1 $MANDIR/man1
cp -fv grcat.1 $MANDIR/man1
mkdir -p $CONFDIR
cp -fv grc.conf $CONFDIR
cp -fv grc.zsh $CONFDIR
cp -fv grc.fish $CONFDIR
mkdir -p $PROFILEDIR
cp -fv grc.bashrc $PROFILEDIR