Skip to content

Commit d633b43

Browse files
authored
[Windows] Don't try to detect shell. (#253)
1 parent bb370a3 commit d633b43

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/ArgumentParser/Completions/CompletionsGenerator.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ public struct CompletionShell: RawRepresentable, Hashable, CaseIterable {
4242

4343
/// Returns an instance representing the current shell, if recognized.
4444
public static func autodetected() -> CompletionShell? {
45+
#if os(Windows)
46+
return nil
47+
#else
4548
// FIXME: This retrieves the user's preferred shell, not necessarily the one currently in use.
4649
guard let shellVar = getenv("SHELL") else { return nil }
4750
let shellParts = String(cString: shellVar).split(separator: "/")
4851
return CompletionShell(rawValue: String(shellParts.last ?? ""))
52+
#endif
4953
}
5054

5155
/// An array of all supported shells for completion scripts.

0 commit comments

Comments
 (0)