diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-12-11 14:33:22 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-12-11 14:33:22 +0000 |
commit | 00cbf7c47c0f642a9fe3d6b0189ed1ed642564e6 (patch) | |
tree | 5c52050103c20836cda1bad7a732de319fc1ad20 /perl_checker.src/perl_checker.ml | |
parent | d42f84dc16ea124b864f0ae4eeb3b8071009fe54 (diff) | |
download | perl-MDK-Common-00cbf7c47c0f642a9fe3d6b0189ed1ed642564e6.tar perl-MDK-Common-00cbf7c47c0f642a9fe3d6b0189ed1ed642564e6.tar.gz perl-MDK-Common-00cbf7c47c0f642a9fe3d6b0189ed1ed642564e6.tar.bz2 perl-MDK-Common-00cbf7c47c0f642a9fe3d6b0189ed1ed642564e6.tar.xz perl-MDK-Common-00cbf7c47c0f642a9fe3d6b0189ed1ed642564e6.zip |
add option "-t" enabling titi to precise tab-width=4
fix a bug in getting exported functions (fixes "unknown function gtkshow")
Diffstat (limited to 'perl_checker.src/perl_checker.ml')
-rw-r--r-- | perl_checker.src/perl_checker.ml | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/perl_checker.src/perl_checker.ml b/perl_checker.src/perl_checker.ml index eac011f..6ad9ce2 100644 --- a/perl_checker.src/perl_checker.ml +++ b/perl_checker.src/perl_checker.ml @@ -27,7 +27,11 @@ let findfile dirs f = List.find Sys.file_exists (List.map (fun dir -> dir ^ "/" let rec parse_file state file = try if !Flags.verbose then print_endline_flush ("checking " ^ file) ; - let channel = Unix.open_process_in (Printf.sprintf "%s \"%s\"" (if !Flags.expand_tabs then "expand" else "cat") file) in + let command = + match !Flags.expand_tabs with + | Some width -> "expand -t " ^ string_of_int width + | None -> "cat" in + let channel = Unix.open_process_in (Printf.sprintf "%s \"%s\"" command file) in let lexbuf = Lexing.from_channel channel in try Info.start_a_new_file file ; @@ -77,12 +81,13 @@ let parse_options = let pot_file = ref "" in let generate_pot_chosen file = Flags.generate_pot := true ; - Flags.expand_tabs := false ; + Flags.expand_tabs := None ; pot_file := file in let options = [ "-v", Arg.Set Flags.verbose, " be verbose" ; "-q", Arg.Set Flags.quiet, " be quiet" ; + "-t", Arg.Int (fun i -> Flags.expand_tabs := Some i), " set the tabulation width (default is 8)" ; "--restrict-to-files", Arg.Set restrict_to_files, " only display warnings concerning the file(s) given on command line" ; "--generate-pot", Arg.String generate_pot_chosen, "" ; ] in |