mirror of
https://github.com/divan/expvarmon.git
synced 2025-04-27 13:48:55 +08:00
16 lines
301 B
Go
16 lines
301 B
Go
![]() |
package main
|
||
|
|
||
|
import (
|
||
|
"path/filepath"
|
||
|
)
|
||
|
|
||
|
// BaseCommand returns cleaned command name from Cmdline array.
|
||
|
//
|
||
|
// I.e. "./some.service/binary.name -arg 1 -arg" will be "binary.name".
|
||
|
func BaseCommand(cmdline []string) string {
|
||
|
if len(cmdline) == 0 {
|
||
|
return ""
|
||
|
}
|
||
|
return filepath.Base(cmdline[0])
|
||
|
}
|