:- module program_name. :- interface. :- import_module io. :- pred main(io::di, io::uo) is det. :- implementation. main(!IO) :- % The first argument is used as the program name if it is not otherwise % available. (We could also have used the predicate io.progname_base/4 % if we did not want path preceding the program name.) io.progname("", ProgName, !IO), io.print_line(ProgName, !IO). :- end_module program_name.