Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file options.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104(**************************************************************************)(* -*- tuareg -*- *)(* *)(* Copyright (C) 2017,2018,2019 Yann Régis-Gianas, Nicolas Jeannerod, *)(* Ralf Treinen. *)(* *)(* This is free software: you can redistribute it and/or modify it *)(* under the terms of the GNU General Public License, version 3. *)(* *)(* Additional terms apply, due to the reproduction of portions of *)(* the POSIX standard. Please refer to the file COPYING for details. *)(**************************************************************************)typebackend=|Json|Bin|SimpleJson|Dot|NoSerialisationlet_backend=refJsonletbackend_of_string=function|"json"->Json|"bin"->Bin|"simple"->SimpleJson|"dot"->Dot|"none"->NoSerialisation|_->assertfalseletset_backendx=x|>backend_of_string|>((:=)_backend)letbackend()=!_backendlet_input_files=ref[]letappend_filef=_input_files:=f::!_input_filesletinput_files()=!_input_filesletoutput_file_of_input_files=matchbackend()with|Json->s^".json"|Bin->s^".morbig"|SimpleJson->s^".sjson"|Dot->s^".dot"|NoSerialisation->assertfalselet_skip_nosh=reffalseletskip_nosh()=!_skip_noshlet_continue_after_error=reffalseletcontinue_after_error()=!_continue_after_errorlet_display_stats=reffalseletdisplay_stats()=!_display_statslet_from_stdin=reffalseletfrom_stdin()=!_from_stdinlet_disable_alias_expansion=reffalseletdisable_alias_expansion()=!_disable_alias_expansionlet_error_on_unspecified=reffalseleterror_on_unspecified()=!_error_on_unspecifiedlet_debug=reffalseletdebug()=!_debugletusage_msg="\
Usage: morbig [options] file...
"letshow_version_and_exit()=Printf.printf"morbig %s\n"Version.current;exit0letanalyze_command_line_arguments()=Arg.(letoptions=["--as",Symbol(["json";"bin";"simple";"dot";"none"],set_backend)," Set the output format. (default is json.)";"--skip-nosh",Set_skip_nosh," Skip input files that are ELF, or have a bash or perl magic string.";"--continue-after-error",Set_continue_after_error," Continue after error with the next script.";"--disable-alias-expansion",Set_disable_alias_expansion," Disable alias expansion.";"--error-on-unspecified",Set_error_on_unspecified," Stop when an unspecified syntax is used.";"--display-stats",Set_display_stats," Display statistics on failures and skipped files.";"--from-stdin",Set_from_stdin," Get names of scripts to parse from standard input.";"--debug",Set_debug," Activate debugging information.";"--version",Unitshow_version_and_exit," Show version number and exit."]inparse(alignoptions)append_fileusage_msg)