mirror of https://github.com/Hilbis/Hilbish
feat: handle -h option
parent
b974ada64e
commit
e6c4c32bd7
6
main.go
6
main.go
|
@ -44,6 +44,7 @@ func main() {
|
||||||
defaultConfPath = filepath.Join(strings.Replace(defaultConfDir, "~", homedir, 1), ".hilbishrc.lua")
|
defaultConfPath = filepath.Join(strings.Replace(defaultConfDir, "~", homedir, 1), ".hilbishrc.lua")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
helpflag := getopt.BoolLong("help", 'h', "Prints Hilbish flags")
|
||||||
verflag := getopt.BoolLong("version", 'v', "Prints Hilbish version")
|
verflag := getopt.BoolLong("version", 'v', "Prints Hilbish version")
|
||||||
setshflag := getopt.BoolLong("setshellenv", 'S', "Sets $SHELL to Hilbish's executed path")
|
setshflag := getopt.BoolLong("setshellenv", 'S', "Sets $SHELL to Hilbish's executed path")
|
||||||
cmdflag := getopt.StringLong("command", 'c', "", "Executes a command on startup")
|
cmdflag := getopt.StringLong("command", 'c', "", "Executes a command on startup")
|
||||||
|
@ -57,6 +58,11 @@ func main() {
|
||||||
interactiveflag := getopt.Lookup('i').Seen()
|
interactiveflag := getopt.Lookup('i').Seen()
|
||||||
noexecflag := getopt.Lookup('n').Seen()
|
noexecflag := getopt.Lookup('n').Seen()
|
||||||
|
|
||||||
|
if *helpflag {
|
||||||
|
getopt.PrintUsage(os.Stdout)
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
if *cmdflag == "" || interactiveflag {
|
if *cmdflag == "" || interactiveflag {
|
||||||
interactive = true
|
interactive = true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue