mirror of https://github.com/Hilbis/Hilbish
Compare commits
2 Commits
94f0ccf9f6
...
08c56a54ca
Author | SHA1 | Date |
---|---|---|
sammy | 08c56a54ca | |
sammy | 428db24831 |
35
main.go
35
main.go
|
@ -2,35 +2,36 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
hooks "hilbish/golibs/bait"
|
||||
"io"
|
||||
"os"
|
||||
"os/signal"
|
||||
"os/user"
|
||||
"strings"
|
||||
|
||||
hooks "hilbish/golibs/bait"
|
||||
|
||||
"github.com/akamensky/argparse"
|
||||
"github.com/bobappleyard/readline"
|
||||
lua "github.com/yuin/gopher-lua"
|
||||
"github.com/yuin/gopher-lua"
|
||||
"golang.org/x/term"
|
||||
)
|
||||
|
||||
const version = "0.3.2"
|
||||
|
||||
var l *lua.LState
|
||||
var (
|
||||
l *lua.LState
|
||||
|
||||
// User's prompt, this will get set when lua side is initialized
|
||||
var prompt string
|
||||
var multilinePrompt = "> "
|
||||
// User's prompt, this will get set when lua side is initialized
|
||||
prompt string
|
||||
multilinePrompt = "> "
|
||||
|
||||
// Map of builtin/custom commands defined in the commander lua module
|
||||
var commands = map[string]bool{}
|
||||
commands = map[string]bool{}
|
||||
aliases = map[string]string{}
|
||||
|
||||
// Command aliases
|
||||
var aliases = map[string]string{}
|
||||
var bait hooks.Bait
|
||||
var homedir string
|
||||
var running bool
|
||||
bait hooks.Bait
|
||||
homedir string
|
||||
running bool
|
||||
)
|
||||
|
||||
func main() {
|
||||
homedir, _ = os.UserHomeDir()
|
||||
|
@ -39,15 +40,15 @@ func main() {
|
|||
parser := argparse.NewParser("hilbish", "A shell for lua and flower lovers")
|
||||
verflag := parser.Flag("v", "version", &argparse.Options{
|
||||
Required: false,
|
||||
Help: "Prints Hilbish version",
|
||||
Help: "Prints Hilbish version",
|
||||
})
|
||||
setshflag := parser.Flag("S", "set-shell-env", &argparse.Options{
|
||||
Required: false,
|
||||
Help: "Sets $SHELL to Hilbish's executed path",
|
||||
Help: "Sets $SHELL to Hilbish's executed path",
|
||||
})
|
||||
configflag := parser.String("C", "config", &argparse.Options{
|
||||
Required: false,
|
||||
Help: "Sets the path to Hilbish's config",
|
||||
Help: "Sets the path to Hilbish's config",
|
||||
Default: defaultconfpath,
|
||||
})
|
||||
|
||||
|
@ -163,7 +164,7 @@ func fmtPrompt() string {
|
|||
}
|
||||
|
||||
for i, v := range args {
|
||||
if i%2 == 0 {
|
||||
if i % 2 == 0 {
|
||||
args[i] = "%" + v
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue