diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2021-05-10 15:13:37 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2021-05-10 15:14:11 +0200 |
commit | 8300c34660b1711fad1cbdafd9aa470d19f5a47d (patch) | |
tree | 62db20612bfd83679414619c5816bb957f579e5c /contrib/gcc-changelog/git_email.py | |
parent | 902692c1cbdb5c0ce7ea865fa5677aaeb78802f4 (diff) | |
download | gcc-8300c34660b1711fad1cbdafd9aa470d19f5a47d.zip gcc-8300c34660b1711fad1cbdafd9aa470d19f5a47d.tar.gz gcc-8300c34660b1711fad1cbdafd9aa470d19f5a47d.tar.bz2 |
contrib/gcc-changelog: Add/improve --help
contrib/ChangeLog:
* gcc-changelog/git_check_commit.py (__Main__): State in --help
the default value for 'revisions'.
* gcc-changelog/git_email.py (show_help): Add.
(__main__): Handle -h and --help.
Diffstat (limited to 'contrib/gcc-changelog/git_email.py')
-rwxr-xr-x | contrib/gcc-changelog/git_email.py | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/contrib/gcc-changelog/git_email.py b/contrib/gcc-changelog/git_email.py index b0547b3..7ebf4c4 100755 --- a/contrib/gcc-changelog/git_email.py +++ b/contrib/gcc-changelog/git_email.py @@ -72,10 +72,25 @@ class GitEmail(GitCommit): commit_to_info_hook=lambda x: None) -# With zero arguments, process every patch file in the ./patches directory. -# With one argument, process the named patch file. -# Patch files must be in 'git format-patch' format. +def show_help(): + print(""" +usage: git_email.py [--help] [patch file ...] + +Check git ChangeLog format of a patch + +With zero arguments, process every patch file in the +./patches directory. +With one argument, process the named patch file. + +Patch files must be in 'git format-patch' format. +""") + sys.exit(0) + + if __name__ == '__main__': + if len(sys.argv) == 2 and (sys.argv[1] == '-h' or sys.argv[1] == '--help'): + show_help() + if len(sys.argv) == 1: allfiles = [] for root, _dirs, files in os.walk('patches'): |