# CommandLine.arguments is not concurrency-safe

**URL:** <https://forums.swift.org/t/commandline-arguments-is-not-concurrency-safe/68095>\
**Category:** Using Swift\
**Created:** [October 27, 2023, 1:35am UTC](https://forums.swift.org/t/commandline-arguments-is-not-concurrency-safe/68095 "2023-10-27T01:35:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![taylorswift](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/taylorswift/32/43413_2.png) [@taylorswift](https://forums.swift.org/u/taylorswift)\
**Post date:** [October 27, 2023, 1:35am UTC](https://forums.swift.org/t/commandline-arguments-is-not-concurrency-safe/68095/1 "2023-10-27T01:35:36Z")

</div>

```plaintext
Main.Options.swift:34:64: warning: 
reference to static property 'arguments' is not concurrency-safe 
because it involves shared mutable state

```

```swift
        var arguments = CommandLine.arguments.makeIterator()

```

how do i fix this?

---

<div class="post-metadata">

**Author:** ![eskimo](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/eskimo/32/13558_2.png) [@eskimo](https://forums.swift.org/u/eskimo)\
**Post date:** [October 27, 2023, 8:03am UTC](https://forums.swift.org/t/commandline-arguments-is-not-concurrency-safe/68095/2 "2023-10-27T08:03:43Z")

</div>

This is a [known issue](https://github.com/apple/swift/issues/66213).

My standard workaround is to use `ProcessInfo` but, given your aversion to Foundation, I doubt you’ll want to follow me down that path.

Share and Enjoy

Quinn “The Eskimo!” @ DTS @ Apple
