X-Git-Url: https://git.0d.be/?p=git-acab.git;a=blobdiff_plain;f=git-acab;h=0a651468a0a8d5a04c73a1c59f23300b5fbc82d5;hp=159933ba52cc075e25495b2ed96fccb1e593788c;hb=fcf1fc0f29755cc49b030e5b680bcacabb7fea9c;hpb=acab0a73706e12abdeee7d94301a80449dce6422 diff --git a/git-acab b/git-acab index 159933b..0a65146 100755 --- a/git-acab +++ b/git-acab @@ -10,7 +10,8 @@ import time parser = argparse.ArgumentParser() parser.add_argument('--start', type=str, default='commit', help='now or commit') parser.add_argument('--prefix', action='store_true') -parser.add_argument('-v', '--verbose', action='store_true') +parser.add_argument('--suffix', action='store_true') +parser.add_argument('-q', '--quiet', action='store_true') args = parser.parse_args() if args.start == 'commit': @@ -33,7 +34,7 @@ while True: # will give new commit hashes as the commit date (not author date) will # be different. direction = - direction - if args.verbose: + if not args.quiet: print( '%5d - %s - [%s:%02d]' % ( @@ -56,11 +57,12 @@ while True: capture_output=True, ) p = subprocess.run(['git', 'rev-parse', 'HEAD'], capture_output=True) - if args.prefix: - if b'acab' == p.stdout[:4]: - break - elif b'acab' in p.stdout: + if args.prefix and not p.stdout.startswith(b'acab'): + continue + if args.suffix and not p.stdout.strip().endswith(b'acab'): + continue + if b'acab' in p.stdout: break -if args.verbose: - print('\ngot %s' % p.stdout.decode().strip()) +if not args.quiet: + print('\ngot %s 🔥🚓' % p.stdout.decode().strip())