Print nixos rules on exit

Signed-off-by: Hadi <hadi@example.com>
This commit is contained in:
Hadi
2026-05-06 14:41:50 +02:00
parent ecd12f18e0
commit 1ac92a5ace
4 changed files with 65 additions and 19 deletions
+4
View File
@@ -74,6 +74,10 @@ func extractField(rule, field string) string {
return rest[:end]
}
func NixOSRule(dev Device, status Status) string {
return fmt.Sprintf("%s id %s name \"%s\"", status, dev.VidPid, dev.Name)
}
func extractUnquoted(rule, field string) string {
prefix := field + " "
idx := strings.Index(rule, prefix)