Last active
October 20, 2022 05:01
-
-
Save DavidPiper94/ec7b9883abcaa299005252d09b31e597 to your computer and use it in GitHub Desktop.
Example code for article about ArgumentParser - Defining the top level command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ArgumentParser | |
import Foundation | |
// 1 | |
struct CLINotes: ParsableCommand { | |
// 2 | |
static let fileExtension = ".clinote" | |
// 3 | |
static let configuration: CommandConfiguration = CommandConfiguration( | |
commandName: "clinotes", | |
abstract: "Manage your notes from the command line", | |
usage: nil, | |
discussion: "Create your nodes from the command-line. Each file generated with this tool has the extension \(fileExtension).", | |
version: "1.0.0", | |
shouldDisplay: true, | |
subcommands: [], | |
defaultSubcommand: nil, | |
helpNames: .shortAndLong | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment