# Cannot debug / inspect a PrologScript on a mac

**URL:** <https://swi-prolog.discourse.group/t/cannot-debug-inspect-a-prologscript-on-a-mac/3721>\
**Category:** Help!\
**Created:** [March 15, 2021, 6:20pm UTC](https://swi-prolog.discourse.group/t/cannot-debug-inspect-a-prologscript-on-a-mac/3721 "2021-03-15T18:20:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![remy.s](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@remy.s](https://swi-prolog.discourse.group/u/remy.s)\
**Post date:** [March 15, 2021, 6:20pm UTC](https://swi-prolog.discourse.group/t/cannot-debug-inspect-a-prologscript-on-a-mac/3721/1 "2021-03-15T18:20:01Z")

</div>

I have the following prolog script, which when called in in my shell, runs as expected

```prolog
#!/usr/bin/env swipl -t prolog
:- initialization (main, halt).
main(Argv):-writeln(Argv).

```

```prolog
% ./tst.pl a b c
[a,b,c]

```

According to the documentation in [2.11.2.1 Using PrologScript](https://www.swi-prolog.org/pldoc/man?section=compilation); it should be possible to open this file for debugging / inspection purposes using the -l or -t flags.

Instead, I have the following result:

```prolog
% swipl -l tst.pl
[]

```

```prolog
% swipl -t prolog tst.pl
[]

```

This is with SWI-Prolog (threaded, 64 bits, version 8.3.20) on a mac (using zsh)  
Is this a regression, or am I doing something wrong?

---

<div class="post-metadata">

**Author:** ![remy.s](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@remy.s](https://swi-prolog.discourse.group/u/remy.s)\
**Post date:** [March 16, 2021, 12:04pm UTC](https://swi-prolog.discourse.group/t/cannot-debug-inspect-a-prologscript-on-a-mac/3721/2 "2021-03-16T12:04:11Z")

</div>

Sorry,  
Corrected my file, and all works as expected:

```prolog
#!/usr/bin/env swipl
:- initialization(main, main).
main(Argv):-writeln(Argv).

```
