From ebbd8b3525adf5fef72cfbbf0bfa30beceec1cfc Mon Sep 17 00:00:00 2001 From: Victor Häggqvist Date: Thu, 15 Oct 2015 14:10:22 +0200 Subject: unified fail msg --- giti | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/giti b/giti index 1d56cff..0502902 100755 --- a/giti +++ b/giti @@ -109,18 +109,19 @@ def giti(kind: str): print('Found no exact match, let\'s give searching a try...') filepath = search_for_file(kind) if not filepath: - print('Can\'t help any more, exiting') - print('No changes made') - exit(0) + terminate_gracefully() gifile = get_ignore_file(filepath, path=True) if not gifile: - print('Can\'t help any more, exiting') - print('No changes made') - exit(0) + terminate_gracefully() save_file(gifile) +def terminate_gracefully(): + print('Can\'t help any more, exiting') + print('No changes made') + exit(0) + def show_help(): print('Usage: giti [language or stuff]') -- cgit v1.2.3