#!/usr/bin/env ruby require 'gli' require 'itools' include GLI::App program_desc 'a collection of tools for ios developer' version Itools::VERSION desc "解析linkmap" arg 'xxx.txt' command :parse do |c| c.action do |global_options, options, args| if args.size == 1 Itools::LinkMap.parser(args[0]) else Itools::LinkMap.parser_by_folder(args) end end end desc "在文件夹或文件中查找字符串(或者字符串组)" arg 'xxx.txt' command :search do |c| c.action do |global_options, options, args| Itools::StringSearcher.search_result(args[0],args[1]) end end # 查找工程中没有用到的图片 desc "查找无用图片" arg 'xxx.txt' command :find do |c| c.action do |global_options, options, args| Itools::ImgFinder.find(args[0]) end end # 查找Xcode工程中没有用到的类 desc "查找无用类" arg 'xxx.txt' command :search_unuse_class do |c| c.action do |global_options, options, args| Itools::ClassFinder.search_unuse_class(args) end end # 计算占用内存大小 desc "计算文件或者文件夹占用内存大小" arg 'xxx.txt' command :size_for do |c| c.action do |global_options, options, args| Itools::Memory.sizeFor(args) end end # 查找文件 desc "查找文件" arg 'file name' command :search_file do |c| c.action do |global_options, options, args| Itools::FileSearcher.searchFile(args) end end # 统计代码行数 desc "统计代码行数" arg 'file name or folder' command :count_code_line do |c| c.action do |global_options, options, args| Itools::CodeCouner.count_line(args) end end #本地commit规范化 desc "通过执行该命令,hook 本地commit,然后进行规范化" arg 'git项目根目录' command :pre_commit do |c| c.action do |global_options,options, args| Itools::GitSets.commit_msg_init(args) end end #本地commit规范化 desc "通过执行该命令,可以将podfile.lock中所有的依赖平铺至Podifle中" arg 'podfile.lock' command :podfile_tiled do |c| c.action do |global_options,options, args| Itools::PodfileTiled.podfile_tiled(args) end end exit run(ARGV)