Skip to content

Commit 62e6f9e

Browse files
committed
improve argument and error handling
1 parent 525aa37 commit 62e6f9e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/1-fetch/github_fetch.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ def parse_arguments():
7171
action="store_true",
7272
help="Enable git actions (fetch, merge, add, commit, and push)",
7373
)
74-
return parser.parse_args()
74+
args = parser.parse_args()
75+
if not args.enable_save and args.enable_git:
76+
parser.error("--enable-git requires --enable-save")
77+
return args
7578

7679

7780
def check_for_completion():
@@ -190,7 +193,8 @@ def main():
190193
LOGGER.error(e.message)
191194
sys.exit(e.exit_code)
192195
except SystemExit as e:
193-
LOGGER.error(f"System exit with code: {e.code}")
196+
if e.code != 0:
197+
LOGGER.error(f"System exit with code: {e.code}")
194198
sys.exit(e.code)
195199
except KeyboardInterrupt:
196200
LOGGER.info("(130) Halted via KeyboardInterrupt.")

0 commit comments

Comments
 (0)