-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeywalk-gen.go
More file actions
43 lines (35 loc) · 874 Bytes
/
Copy pathkeywalk-gen.go
File metadata and controls
43 lines (35 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// SPDX-License-Identifier: AGPL-3.0-or-later
// © 2025 Stephan Hegemann
package main
import (
"go-keywalker/libkeywalk"
"os"
"flag"
"log"
)
// variables for cli arguments
var (
cli_keymap string
cli_min_length int
cli_max_length int
)
func init() {
//definition of available cli arguments
flag.StringVar(&cli_keymap, "k", "", "Mandatory. Keymap file (.nsk) of the keyboard you want to walk.")
flag.IntVar(&cli_min_length, "m", 1, "Minimum length of the keywalk. Value has to be > 0")
flag.IntVar(&cli_max_length, "M", 4, "Maximum length of the keywalk. Value has to be > 0")
}
func printHelpAndExit() {
flag.PrintDefaults()
os.Exit(0)
}
func main() {
flag.Parse()
if len(cli_keymap) <= 0 {
printHelpAndExit()
}
err := libkeywalk.WalkCompleteKeymapFile(cli_keymap, cli_min_length, cli_max_length, os.Stdout)
if err != nil {
log.Fatal(err)
}
}