File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed
Sources/InputSourceManagerCli Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -9,19 +9,24 @@ struct GetInputSource: ParsableCommand {
9
9
abstract: " Gets the current input source "
10
10
)
11
11
12
+ @Flag ( help: " Indicatetes if keyboard layout input source should be provided. " )
13
+ var layout = false
14
+
12
15
func run( ) throws {
13
16
let manager = InputSourceManager ( )
14
- guard let inputSource = manager. getCurrentKeybaordInputSource ( ) else {
15
- print ( " No input source found " )
16
- return
17
- }
18
17
19
- guard let layouInputSource = manager. getCurrentKeybaordLayoutInputSource ( ) else {
20
- print ( " No input source found " )
21
- return
18
+ if layout {
19
+ guard let inputSource = manager. getCurrentKeybaordLayoutInputSource ( ) else {
20
+ print ( " No input source found " )
21
+ return
22
+ }
23
+ print ( " Id : \( inputSource. id) , name: \( inputSource. localizedName) " )
24
+ } else {
25
+ guard let inputSource = manager. getCurrentKeybaordInputSource ( ) else {
26
+ print ( " No input source found " )
27
+ return
28
+ }
29
+ print ( " Id : \( inputSource. id) , name: \( inputSource. localizedName) " )
22
30
}
23
-
24
- print ( " Id : \( inputSource. id) , name: \( inputSource. localizedName) " )
25
- print ( " Id : \( layouInputSource. id) , name: \( layouInputSource. localizedName) " )
26
31
}
27
32
}
You can’t perform that action at this time.
0 commit comments