Skip to content

Commit 5f4920e

Browse files
mlaventureTibor Vass
authored andcommitted
Add example for device-cgroup-rule to man
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
1 parent 12670c0 commit 5f4920e

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

man/generate.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ func loadLongDescription(cmd *cobra.Command, path string) error {
6262
return err
6363
}
6464
cmd.Long = string(content)
65+
66+
fullpath = filepath.Join(path, cmd.Name()+"-example.md")
67+
if _, err := os.Stat(fullpath); err != nil {
68+
continue
69+
}
70+
71+
content, err = ioutil.ReadFile(fullpath)
72+
if err != nil {
73+
return err
74+
}
75+
cmd.Example = string(content)
76+
6577
}
6678
return nil
6779
}

0 commit comments

Comments
 (0)