mirror of https://github.com/garabik/grc.git
graceful failure when grcat run without conffile (closes #5)
This commit is contained in:
parent
41583f607d
commit
0ed1bb8da3
4
grcat
4
grcat
|
@ -87,6 +87,10 @@ conffile = None
|
|||
if 'HOME' in os.environ:
|
||||
home = [os.environ['HOME']+"/.grc/"]
|
||||
conffilepath = [""] + home + ["/usr/local/share/grc/", "/usr/share/grc/"]
|
||||
if len(sys.argv) != 2:
|
||||
sys.stderr.write("You are not supposed to call grcat directly, but the usage is: grcat conffile\n")
|
||||
sys.exit(1)
|
||||
|
||||
conffile_arg = sys.argv[1] # tentative conffile
|
||||
for i in conffilepath:
|
||||
if os.path.isfile(i+conffile_arg):
|
||||
|
|
Loading…
Reference in New Issue