# Parse Error

**URL:** <https://forums.swift.org/t/parse-error/57231>\
**Category:** ArgumentParser\
**Created:** [May 10, 2022, 8:49am UTC](https://forums.swift.org/t/parse-error/57231 "2022-05-10T08:49:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidnorris78](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/davidnorris78/32/23144_2.png) [@davidnorris78](https://forums.swift.org/u/davidnorris78)\
**Post date:** [May 10, 2022, 8:49am UTC](https://forums.swift.org/t/parse-error/57231/1 "2022-05-10T08:49:55Z")

</div>

I'm trying to read in a ParsableCommand into a App to then post a Notification on macOS, but I'm running into an error when the app is trying to parse the CommandLine arguments.

Using Xcode 13.3.1. App deployment target is 12.3.

This is the error I get:

```swift
CommandError(commandStack: [NotificationApp.Notifier], parserError: ArgumentParser.ParserError.unknownOption(ArgumentParser.InputOrigin.Element.argumentIndex(2.0), ArgumentParser.Name.short("N", allowingJoined: false)))

```

Here is the code:

```swift
import SwiftUI
import UserNotifications
import ArgumentParser

@main
struct NotificationAppApp: App {
    @NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
    @StateObject var model: ContentViewModel = {
      let model = ContentViewModel()
      do {
          let parsedResult = try Notifier.parse()
          parsedResult.update(model)
      }
      catch {
        print("Error: Could not parse arguments")
        print(CommandLine.arguments.dropFirst().joined(separator: " "))
        print(Notifier.helpMessage())
        print(error)
      }
      return model
    }()
    
    var body: some Scene {
        WindowGroup {
            ContentView(model: model)
        }
    }
}

struct Notifier: ParsableCommand {

    static let configuration = CommandConfiguration(
        abstract: "A Swift command-line tool to manage notificiations")

    @Option(name: .shortAndLong, help: "The Message")
    var message: String?

}

extension Notifier {
  func update(_ viewModel: ContentViewModel) {
    if let message = message {
      viewModel.message = message
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![nnnnnnnn](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nnnnnnnn/32/264_2.png) [@nnnnnnnn](https://forums.swift.org/u/nnnnnnnn)\
**Post date:** [May 18, 2022, 2:05am UTC](https://forums.swift.org/t/parse-error/57231/2 "2022-05-18T02:05:09Z")

</div>

It looks like your command’s input includes a `-N` argument, which isn’t valid for your command. That error type is internal to the library, but you can get a human-readable string by calling `Notifier.message(for: error)` or exit with that string and a suitable error message with `Notifier.exit(withError: error)`.
