# Command line scripts that use a -c or -x argument no longer work

**URL:** <https://swi-prolog.discourse.group/t/command-line-scripts-that-use-a-c-or-x-argument-no-longer-work/1099>\
**Category:** Help!\
**Created:** [August 21, 2019, 4:29am UTC](https://swi-prolog.discourse.group/t/command-line-scripts-that-use-a-c-or-x-argument-no-longer-work/1099 "2019-08-21T04:29:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cjm](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/cjm/32/440_2.png) [@cjm](https://swi-prolog.discourse.group/u/cjm)\
**Post date:** [August 21, 2019, 4:29am UTC](https://swi-prolog.discourse.group/t/command-line-scripts-that-use-a-c-or-x-argument-no-longer-work/1099/1 "2019-08-21T04:29:23Z")

</div>

I recently switched to SWI-Prolog version 8 (8.0.3), it looks like a few things happened with command line processing. My scripts that previously accepted `-c` as an option no longer accept this. It looks like this is being interpreted directly by swipl and not passed to my program.

this can be seen with the following:

footest:

```prolog
#!/usr/bin/env swipl 

:- initialization main.

main(Argv):-
        writeln(Argv),
        halt.

```

as expected:

```prolog
$ footest -a foo.yaml
[-a,foo.yaml]

```

however:

```prolog
$ footest -c foo.yaml
ERROR: source_sink `'foo.yaml'' does not exist

```

Same thing for `-x`.

It’s not clear if this is intentional or if there is any way I can get my `-c` option back, without writing some kind of wrapper script?

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [August 21, 2019, 7:09am UTC](https://swi-prolog.discourse.group/t/command-line-scripts-that-use-a-c-or-x-argument-no-longer-work/1099/2 "2019-08-21T07:09:25Z")

</div>

I think we should consider this a mistake. Given saved states, `#!` scripts and plan running Prolog there are quite a few options though ☹ I’ll have a look.

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [August 21, 2019, 8:39am UTC](https://swi-prolog.discourse.group/t/command-line-scripts-that-use-a-c-or-x-argument-no-longer-work/1099/3 "2019-08-21T08:39:59Z")

</div>

Pushed ea88f5f4b6bfe3ad87bbc86a930125fdf2b18842 to `swipl-devel` to fix this. Considering tabling is probably important to you, the devel series is more promising anyway 🙂
