mirror of
https://github.com/ceph/go-ceph
synced 2024-12-23 06:33:24 +00:00
lib: implemement parsecmdlineargs
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
This commit is contained in:
parent
bb67ba13a4
commit
c995a1c1ec
15
conn.go
15
conn.go
@ -153,3 +153,18 @@ func (c *Conn) GetClusterStats() (stat ClusterStat, err error) {
|
||||
}, nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Conn) ParseCmdLineArgs(args []string) error {
|
||||
argc := C.int(len(args))
|
||||
argv := make([]*C.char, argc)
|
||||
for i, arg := range args {
|
||||
argv[i] = C.CString(arg)
|
||||
defer C.free(unsafe.Pointer(argv[i]))
|
||||
}
|
||||
ret := C.rados_conf_parse_argv(c.cluster, argc, &argv[0])
|
||||
if ret < 0 {
|
||||
return RadosError(int(ret))
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user