ipadm: translate to English, fix help alignment
- All ipadm-internal messages (usage, prompts, errors) are now English - Usage text is built programmatically from a (left, desc) row list with computed column width instead of hand-aligned spaces, so it can't drift out of alignment again when rows are added/changed - README's literal usage block updated to match; rest of the repo docs stay German
This commit is contained in:
@@ -21,15 +21,15 @@ type LineStore[T any] struct {
|
||||
|
||||
func openLineStore[T any](path, header string, parse func(string) (T, error), format func(T) string) (*LineStore[T], error) {
|
||||
if err := os.MkdirAll(dirOf(path), 0755); err != nil {
|
||||
return nil, fmt.Errorf("kann Verzeichnis für %s nicht anlegen: %w", path, err)
|
||||
return nil, fmt.Errorf("cannot create directory for %s: %w", path, err)
|
||||
}
|
||||
f, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE, 0644)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("kann %s nicht öffnen: %w", path, err)
|
||||
return nil, fmt.Errorf("cannot open %s: %w", path, err)
|
||||
}
|
||||
if err := syscall.Flock(int(f.Fd()), syscall.LOCK_EX); err != nil {
|
||||
f.Close()
|
||||
return nil, fmt.Errorf("kann Lock auf %s nicht setzen: %w", path, err)
|
||||
return nil, fmt.Errorf("cannot lock %s: %w", path, err)
|
||||
}
|
||||
return &LineStore[T]{path: path, file: f, header: header, parse: parse, format: format}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user