if len(sys.argv) == 3:
parser.add_argument('-O', action='store_true', default=False, help='FILE exists and is owned by the effective user ID')
parser.add_argument("x", type=str, help="File1")
args = parser.parse_args()
x = args.x
y = None
elif len(sys.argv) == 4:
group.add_argument("-o", action="store_true", help='either EXPRESSION1 or EXPRESSION2 is true')
parser.add_argument("x", type=str, help="File1")
parser.add_argument("y", type=str, help="File2")
args = parser.parse_args()
x = args.x
y = args.y
elif
else:
parser.add_argument('-O', action='store_true', default=False, help='FILE exists and is owned by the effective user ID')
group.add_argument("-o", action="store_true", help='either EXPRESSION1 or EXPRESSION2 is true')
print(parser.print_help())
return 1
mydict = vars(args)
edict = {
'b':isBlockfile,
'c':isCharspecial,
'd':isDirectory,
'e':isExists,
'f':isFile,
'g':issetGroupID,
'G':isownGroupID,
'k':isStickyBit,
'L':isLink,
'O':isownUserID,
'p':isnamePipe,
'r':isRead,
'S':isSocket,
'u':issetUserID,
'w':isWriter,
'x':isExecute,
'a':isAnd,
'o':isOR,
'nt':isNewthan,
'ot':isOlderthan,
'eq':isEqual,
'ge':isGraterEqual,
'gt':isGranterthan,
'le':isLessEqual,
'lt':isLessthan,
'ne':isNotEqual,
'z':isZero,
'n':isNonZero,
}
for key in mydict:
key, value = key, mydict[key]
if value == True:
edict[key](x, y)
if __name__ == '__main__':
main()
python test4
最新推荐文章于 2024-11-09 21:51:27 发布