about summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-10-15 01:40:08 +0200
committerhut <hut@lavabit.com>2010-10-15 01:40:08 +0200
commitcc470758bc3c6f7d51d3501740d87b62573bf0bb (patch)
tree817ff1db80ba348687714f8833bab05cb09175fe /ranger
parent25d023b34085b715ca995616ab37aa73f5b66f49 (diff)
downloadranger-cc470758bc3c6f7d51d3501740d87b62573bf0bb.tar.gz
core.main: Fixed return codes
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/main.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/ranger/core/main.py b/ranger/core/main.py
index c11be241..bfb342f3 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -40,7 +40,7 @@ def main():
 	if arg.copy_config is not None:
 		fm = FM()
 		fm.copy_config_files(arg.copy_config)
-		return 0
+		return 1 if arg.fail_unless_cd else 0
 
 	SettingsAware._setup(clean=arg.clean)
 
@@ -51,7 +51,7 @@ def main():
 			target = target[7:]
 		if not os.access(target, os.F_OK):
 			print("File or directory doesn't exist: %s" % target)
-			sys.exit(1)
+			return 1
 		elif os.path.isfile(target):
 			def print_function(string):
 				print(string)
@@ -60,7 +60,7 @@ def main():
 			runner = Runner(logfunc=print_function)
 			load_apps(runner, arg.clean)
 			runner(files=[File(target)], mode=arg.mode, flags=arg.flags)
-			sys.exit(1 if arg.fail_unless_cd else 0)
+			return 1 if arg.fail_unless_cd else 0
 
 	crash_traceback = None
 	try: