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 {
99 abstract: " Gets the current input source "
1010 )
1111
12+ @Flag ( help: " Indicatetes if keyboard layout input source should be provided. " )
13+ var layout = false
14+
1215 func run( ) throws {
1316 let manager = InputSourceManager ( )
14- guard let inputSource = manager. getCurrentKeybaordInputSource ( ) else {
15- print ( " No input source found " )
16- return
17- }
1817
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) " )
2230 }
23-
24- print ( " Id : \( inputSource. id) , name: \( inputSource. localizedName) " )
25- print ( " Id : \( layouInputSource. id) , name: \( layouInputSource. localizedName) " )
2631 }
2732}
You can’t perform that action at this time.
0 commit comments