| 1 | package exepath |
| 2 | |
| 3 | import "path/filepath" |
| 4 | import "strings" |
| 5 | |
| 6 | // By default, contains the lowercase basename of Abs with any file extension stripped. |
| 7 | // |
| 8 | // This can be changed by any configuration code which knows better. It may be |
| 9 | // used e.g. as the application name for syslog. |
| 10 | var ProgramName string |
| 11 | |
| 12 | // Used to track what set the program name. |
| 13 | var ProgramNameSetter = "default" |
| 14 | |
| 15 | func initProgramName() { |
| 16 | b := filepath.Base(Abs) |
| 17 | ProgramName = strings.ToLower(b[0 : len(b)-len(filepath.Ext(b))]) |
| 18 | } |