summaryrefslogtreecommitdiff
path: root/wiki/2017-05-miniperi/IMG_20170530_150006.jpg
AgeCommit message (Expand)Author
2019-12-09wiki: Porting wiki: Porting 2017-05 MiniPeriConKuninori Morimoto
href='#n33'>33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
#! /usr/bin/env python3
#===============================
#
# find
#
# 2019/02/07 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
#===============================
import sys
import os
import re

import base

#====================================
#
# find
#
#====================================
class find(base.base):

    #--------------------
    # default_arg
    #--------------------
    def default_arg(self, arg):
        # return [] for -all
        #
        # replace -a NoAssignee to -na ""
        #
        # add "-ns Done" automatically
        # if user doesn't specify "-s" or "-ns" or "-is"
        match = 0
        for i in range(len(arg)):
            if (arg[i] == "-all"):
                return []
            if ((arg[i] == "-a") and
                (arg[i+1] == "NoAssignee")):
                arg[i] = "-na"
                arg[i+1] = ""
            if ((arg[i] == "-s") or (arg[i] == "-ns") or (arg[i] == "-is")):
                match = 1

        if (not match):
            arg += ["-ns", "Done"]

        return arg

    #--------------------
    # parse_option
    #--------------------
    def parse_option(self, arg, option, tag, hit):

        op = "-l"	# hit
        if (not hit):
            op = "-L"	# not hit

        match = 0
        for cmd in arg:
            if (cmd == option):
                match = 1
            elif (match):
                if (option == "-b"):
                    tag = cmd
                    tgt = ""
                else:
                    # Wolfram,Shimoda
                    # ->
                    # (Wolfram|Shimoda)