diff --git a/src/brewserverblocklist/bargparse.py b/src/brewserverblocklist/bargparse.py deleted file mode 100644 index a04d9dd..0000000 --- a/src/brewserverblocklist/bargparse.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env python - -# SPDX-FileCopyrightText: 2023 Tobias Diekershoff -# -# SPDX-License-Identifier: CC-BY-SA-2.5 - -""" -This expansion of the ArgParser class will display the --help results by -default if an error occurs (e.g. no arguments are passed to the script). - -It is based on an StackOverflow answer from 2010 by unutbu who refered to -a reply from Steven Bethard as source of the code. Postings of that time -on StackOverflow are published under the terms of a CreativeCommons license -specifically under the CC-BY-SA-2.5 so this module is put under the same -license. - -https://stackoverflow.com/questions/4042452/display-help-message-with-python-argparse-when-script-is-called-without-any-argu/4042861#4042861 -""" - -import argparse -import sys - -class MyParser(argparse.ArgumentParser): - def error(self, message): - sys.stderr.write('error: %s\n' % message) - self.print_help() - sys.exit(2)