@@ -98,16 +98,19 @@ def main():
9898 guess .add_argument ("encoding" , nargs = "*" , help = "list of known encodings to apply (default: none)" )
9999 guess .add_argument ("-c" , "--codec-categories" , nargs = "*" , help = "codec categories to be included in the search ; "
100100 "format: string|tuple" )
101+ guess .add_argument ("-d" , "--min-depth" , default = 0 , type = int , help = "minimum codec search depth before triggering "
102+ "results (default: 0)" )
103+ guess .add_argument ("-D" , "--max-depth" , default = 5 , type = int , help = "maximum codec search depth (default: 5)" )
101104 guess .add_argument ("-e" , "--exclude-codecs" , nargs = "*" , help = "codecs to be explicitely not used ; "
102105 "format: string|tuple" )
103- guess .add_argument ("-f" , "--stop-function" , default = "text" , help = "result checking function (default: text) ; "
104- "format: printables|text|flag|lang_[bigram]|[regex]" )
105- guess .add_argument ("--max-depth" , default = 5 , type = int , help = "maximum codec search depth (default: 5)" )
106- guess .add_argument ("--min-depth" , default = 0 , type = int , help = "minimum codec search depth before triggering results "
107- "(default: 0)" )
108- guess .add_argument ("--extended" , action = "store_true" ,
106+ guess .add_argument ("-E" , "--extended" , action = "store_true" ,
109107 help = "while using the scoring heuristic, also consider null scores (default: False)" )
110- guess .add_argument ("--no-heuristic" , action = "store_true" , help = "do not use the scoring heuristic (default: False)" )
108+ lng = "lang_%s" % LANG
109+ def_func = lng if getattr (stopfunc , lng , None ) else "text"
110+ guess .add_argument ("-f" , "--stop-function" , default = def_func , help = "result checking function (default: %s) ; "
111+ "format: printables|text|flag|lang_[bigram]|[regex]" % def_func )
112+ guess .add_argument ("-H" , "--heuristic" , action = "store_true" , help = "use the scoring heuristic for accelerating"
113+ " the search (default: False)" )
111114 guess .add_argument ("-s" , "--do-not-stop" , action = "store_true" ,
112115 help = "do not stop if a valid output is found (default: False)" )
113116 guess .add_argument ("-v" , "--verbose" , action = "store_true" ,
@@ -117,9 +120,9 @@ def main():
117120 "format: string|tuple|list(strings|tuples)" )
118121 rank .add_argument ("-e" , "--exclude-codecs" , help = "codecs to be explicitely not used ; "
119122 "format: string|tuple|list(strings|tuples)" )
120- rank .add_argument ("-l" , "--limit" , type = int , default = 10 , help = "limit the number of displayed results" )
121- rank .add_argument ("--extended" , action = "store_true" ,
123+ rank .add_argument ("-E" , "--extended" , action = "store_true" ,
122124 help = "while using the scoring heuristic, also consider null scores (default: False)" )
125+ rank .add_argument ("-l" , "--limit" , type = int , default = 10 , help = "limit the number of displayed results" )
123126 search = sparsers .add_parser ("search" , help = "search for codecs" )
124127 search .add_argument ("pattern" , nargs = "+" , help = "encoding pattern to search" )
125128 listi = sparsers .add_parser ("list" , help = "list items" )
@@ -198,7 +201,7 @@ def main():
198201 args .encoding ,
199202 not args .do_not_stop ,
200203 True , # show
201- not args .no_heuristic ,
204+ args .heuristic ,
202205 args .extended ,
203206 args .verbose )
204207 for i , o in enumerate (r .items ()):
0 commit comments