Last active
September 28, 2025 15:59
-
-
Save amarao/36327a6f77b86b90c2bca72ba03c9d3a to your computer and use it in GitHub Desktop.
Revisions
-
amarao revised this gist
Sep 12, 2021 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,15 +9,15 @@ def main(command_line=None): action='store_true', help='Print debug info' ) subparsers = parser.add_subparsers(dest='command') blame = subparsers.add_parser('blame', help='blame people') blame.add_argument( '--dry-run', help='do not blame, just pretend', action='store_true' ) blame.add_argument('name', nargs='+', help='name(s) to blame') praise = subparsers.add_parser('praise', help='praise someone') praise.add_argument('name', help='name of person to praise') praise.add_argument( 'reason', -
amarao created this gist
Sep 11, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ #!/usr/bin/env python import argparse def main(command_line=None): parser = argparse.ArgumentParser('Blame Praise app') parser.add_argument( '--debug', action='store_true', help='Print debug info' ) subprasers = parser.add_subparsers(dest='command') blame = subprasers.add_parser('blame', help='blame people') blame.add_argument( '--dry-run', help='do not blame, just pretend', action='store_true' ) blame.add_argument('name', nargs='+', help='name(s) to blame') praise = subprasers.add_parser('praise', help='praise someone') praise.add_argument('name', help='name of person to praise') praise.add_argument( 'reason', help='what to praise for (optional)', default="no reason", nargs='?' ) args = parser.parse_args(command_line) if args.debug: print("debug: " + str(args)) if args.command == 'blame': if args.dry_run: print("Not for real") print("blaming " + ", ".join(args.name)) elif args.command == 'praise': print('praising ' + args.name + ' for ' + args.reason) if __name__ == '__main__': main()