Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions Sources/Swiftly/Proxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,18 @@ public enum Proxy {

if CommandLine.arguments.count == 1 {
// User ran swiftly with no extra arguments in an uninstalled environment, so we jump directly into
// an simple init.
// a simple init.
try await Init.execute(ctx, assumeYes: false, noModifyProfile: false, overwrite: false, platform: nil, verbose: false, skipInstall: false, quietShellFollowup: false)
return
} else if CommandLine.arguments.count >= 2 && CommandLine.arguments[1] == "init" {
// Let the user run the init command with their arguments, if any.
} else if CommandLine.arguments.count >= 2 && ["init", "--generate-completion-script"].contains(CommandLine.arguments[1]) {
// Let the user run the init command or completion script generation with arguments, if any.
await Swiftly.main()
return
} else if CommandLine.arguments.count == 2 && (CommandLine.arguments[1] == "--help" || CommandLine.arguments[1] == "--experimental-dump-help") {
// Allow the showing of help information
} else if CommandLine.arguments.count == 2 && ["--help", "--experimental-dump-help"].contains(CommandLine.arguments[1]) {
// Just print help information.
await Swiftly.main()
return
} else {
// We've been invoked outside the "init" subcommand and we're not yet configured.
// This will throw if the configuration couldn't be loaded and give the user an actionable message.
throw err
}
Expand Down