diff options
Diffstat (limited to 'scripts/find.py')
-rwxr-xr-x | scripts/find.py | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/scripts/find.py b/scripts/find.py index 9941bff..d5060cd 100755 --- a/scripts/find.py +++ b/scripts/find.py @@ -27,7 +27,7 @@ class find(base.base): # replace -a NoAssignee to -na "" # # add "-ns Done" automatically - # if user doesn't specify "-s" or "-ns" + # if user doesn't specify "-s" or "-ns" or "-is" match = 0 for i in range(len(arg)): if (arg[i] == "-all"): @@ -36,7 +36,7 @@ class find(base.base): (arg[i+1] == "NoAssignee")): arg[i] = "-na" arg[i+1] = "" - if ((arg[i] == "-s") or (arg[i] == "-ns")): + if ((arg[i] == "-s") or (arg[i] == "-ns") or (arg[i] == "-is")): match = 1 if (not match): @@ -47,7 +47,7 @@ class find(base.base): #-------------------- # parse_option #-------------------- - def parse_option(self, arg, option, char, hit): + def parse_option(self, arg, option, tag, hit): op = "-l" # hit if (not hit): @@ -58,13 +58,17 @@ class find(base.base): if (cmd == option): match = 1 elif (match): - # Wolfram,Shimoda - # -> - # (Wolfram|Shimoda) - tgt = "({})".format(cmd.replace(",", "|")) - - self.files = self.run("echo \"{}\" | xargs egrep {} \"{}:\s+{}\"".\ - format(self.files, op, char, tgt)) + if (option == "-b"): + tag = cmd + tgt = "" + else: + # Wolfram,Shimoda + # -> + # (Wolfram|Shimoda) + tgt = "\s+({})".format(cmd.replace(",", "|")) + + self.files = self.run("echo \"{}\" | xargs egrep {} \"{}:{}\"".\ + format(self.files, op, tag, tgt)) return #-------------------- @@ -118,6 +122,7 @@ class find(base.base): # -na : not matched assignee # -t : matched team # -nt : not matched team + # -b : bsp if (self.files): self.parse_option(arg, "-s", "status", 1) self.parse_option(arg, "-ns", "status", 0) @@ -125,6 +130,7 @@ class find(base.base): self.parse_option(arg, "-na", "assignee", 0) self.parse_option(arg, "-t", "team", 1) self.parse_option(arg, "-nt", "team", 0) + self.parse_option(arg, "-b", None, 1) #-------------------- # get |