mirror of
https://github.com/Hilbis/Hilbish
synced 2025-04-22 05:23:23 +00:00
Compare commits
No commits in common. "7ac0e277396ff41f0f9a1dd935595fbb5652bd77" and "d58617b173a6857589d4d168302f78a902b48427" have entirely different histories.
7ac0e27739
...
d58617b173
15
main.go
15
main.go
@ -32,7 +32,6 @@ var (
|
||||
|
||||
hooks bait.Bait
|
||||
defaultConfPath string
|
||||
defaultHistPath string
|
||||
)
|
||||
|
||||
func main() {
|
||||
@ -44,7 +43,7 @@ func main() {
|
||||
|
||||
if defaultConfDir == "" {
|
||||
// we'll add *our* default if its empty (wont be if its changed comptime)
|
||||
if _, err := os.Stat(filepath.Join(confDir, "hilbish")); os.IsNotExist(err) {
|
||||
if _, err := os.Stat(filepath.Join(confDir, "hilbish", "hilbishrc.lua")); os.IsNotExist(err) {
|
||||
defaultConfPath = filepath.Join(homedir, "/.hilbishrc.lua")
|
||||
} else {
|
||||
defaultConfPath = filepath.Join(confDir, "hilbish", "hilbishrc.lua")
|
||||
@ -53,17 +52,7 @@ func main() {
|
||||
// else do ~ substitution
|
||||
defaultConfPath = filepath.Join(strings.Replace(defaultConfDir, "~", homedir, 1), ".hilbishrc.lua")
|
||||
}
|
||||
if defaultHistDir == "" {
|
||||
// we'll add *our* default if its empty (wont be if its changed comptime)
|
||||
if _, err := os.Stat(filepath.Join(confDir, "hilbish")); os.IsNotExist(err) {
|
||||
defaultHistPath = filepath.Join(homedir, "/.hilbish-history")
|
||||
} else {
|
||||
defaultHistPath = filepath.Join(confDir, "hilbish", ".hilbish-history")
|
||||
}
|
||||
} else {
|
||||
// else do ~ substitution
|
||||
defaultHistPath = filepath.Join(strings.Replace(defaultHistDir, "~", homedir, 1), ".hilbishrc.lua")
|
||||
}
|
||||
|
||||
helpflag := getopt.BoolLong("help", 'h', "Prints Hilbish flags")
|
||||
verflag := getopt.BoolLong("version", 'v', "Prints Hilbish version")
|
||||
setshflag := getopt.BoolLong("setshellenv", 'S', "Sets $SHELL to Hilbish's executed path")
|
||||
|
4
rl.go
4
rl.go
@ -14,7 +14,7 @@ type LineReader struct {
|
||||
// other gophers might hate this naming but this is local, shut up
|
||||
func NewLineReader(prompt string) *LineReader {
|
||||
readline.Completer = readline.FilenameCompleter
|
||||
readline.LoadHistory(defaultHistPath)
|
||||
readline.LoadHistory(homedir + "/.hilbish-history")
|
||||
|
||||
return &LineReader{
|
||||
Prompt: prompt,
|
||||
@ -31,7 +31,7 @@ func (lr *LineReader) SetPrompt(prompt string) {
|
||||
|
||||
func (lr *LineReader) AddHistory(cmd string) {
|
||||
readline.AddHistory(cmd)
|
||||
readline.SaveHistory(defaultHistPath)
|
||||
readline.SaveHistory(homedir + "/.hilbish-history")
|
||||
}
|
||||
|
||||
func (lr *LineReader) ClearInput() {
|
||||
|
1
vars.go
1
vars.go
@ -4,7 +4,6 @@ package main
|
||||
var (
|
||||
version = "v0.5.1"
|
||||
defaultConfDir = "" // ~ will be substituted for home, path for user's default config
|
||||
defaultHistDir = ""
|
||||
|
||||
prompt string // Prompt will always get changed anyway
|
||||
multilinePrompt = "> "
|
||||
|
@ -10,9 +10,9 @@ var (
|
||||
.. hilbish.xdg.data .. '/hilbish/libs/?/init.lua;'
|
||||
.. hilbish.xdg.data .. '/hilbish/libs/?/?.lua;'
|
||||
.. hilbish.xdg.data .. '/hilbish/libs/?.lua'
|
||||
.. hilbish.xdg.config .. '/hilbish/?/init.lua'
|
||||
.. hilbish.xdg.config .. '/hilbish/?/?.lua'
|
||||
.. hilbish.xdg.config .. '/hilbish/?.lua'`
|
||||
.. hilbish.xdg.config .. '/?/init.lua'
|
||||
.. hilbish.xdg.config .. '/?/?.lua'
|
||||
.. hilbish.xdg.config .. '/?.lua'`
|
||||
preloadPath = "/usr/share/hilbish/preload.lua"
|
||||
sampleConfPath = "/usr/share/hilbish/.hilbishrc.lua" // Path to default/sample config
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user