Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
garabik committed May 21, 2017
2 parents ec7dbb8 + 2df1e97 commit ffd3b12
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
grc (1.11.1-1) unstable; urgency=low

* better error handling if command is not found

-- Radovan Garabík <[email protected]> Sun, 21 May 2017 16:01:51 +0200

grc (1.11-1) unstable; urgency=low

* clean up directories
Expand Down
17 changes: 9 additions & 8 deletions grc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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]
Expand Down
3 changes: 2 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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


0 comments on commit ffd3b12

Please sign in to comment.