mirror of
				https://github.com/sammy-ette/Hilbish
				synced 2025-08-10 02:52:03 +00:00 
			
		
		
		
	feat: args variable (resolves #49)
anytime hilbish is ran as shebang or given a script to run, itll provide an `args` variable which will be the args a user provides to the script. it includes the execute path, as most argv's do
This commit is contained in:
		
							parent
							
								
									0f9d3732fb
								
							
						
					
					
						commit
						fd478e883f
					
				
							
								
								
									
										2
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								main.go
									
									
									
									
									
								
							| @ -14,6 +14,7 @@ import ( | ||||
| 	"github.com/pborman/getopt" | ||||
| 	"github.com/bobappleyard/readline" | ||||
| 	"github.com/yuin/gopher-lua" | ||||
| 	"layeh.com/gopher-luar" | ||||
| 	"golang.org/x/term" | ||||
| ) | ||||
| 
 | ||||
| @ -118,6 +119,7 @@ func main() { | ||||
| 
 | ||||
| 	RunInput(*cmdflag) | ||||
| 	if getopt.NArgs() > 0 { | ||||
| 		l.SetGlobal("args", luar.New(l, getopt.Args())) | ||||
| 		err := l.DoFile(getopt.Arg(0)) | ||||
| 		if err != nil { | ||||
| 			fmt.Fprintln(os.Stderr, err) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user