mirror of
				https://github.com/sammy-ette/Hilbish
				synced 2025-08-10 02:52:03 +00:00 
			
		
		
		
	Compare commits
	
		
			4 Commits
		
	
	
		
			38233ccda4
			...
			e4833bdba9
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | e4833bdba9 | ||
|  | 63061e3a52 | ||
|  | 4596159b8f | ||
|  | 9eabe5323d | 
| @ -30,6 +30,6 @@ func (b *Bait) throw(name string, args ...interface{}) { | |||||||
| 	b.Em.Emit(name, args...) | 	b.Em.Emit(name, args...) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (b *Bait) catch(name string, catcher func(interface{})) { | func (b *Bait) catch(name string, catcher func(...interface{})) { | ||||||
| 	b.Em.On(name, catcher) | 	b.Em.On(name, catcher) | ||||||
| } | } | ||||||
|  | |||||||
							
								
								
									
										5
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								main.go
									
									
									
									
									
								
							| @ -184,7 +184,10 @@ input: | |||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		input = strings.TrimSpace(input) | 		input = strings.TrimSpace(input) | ||||||
| 		if len(input) == 0 { continue } | 		if len(input) == 0 { | ||||||
|  | 			hooks.Em.Emit("command.exit", 0) | ||||||
|  | 			continue | ||||||
|  | 		} | ||||||
| 
 | 
 | ||||||
| 		if strings.HasSuffix(input, "\\") { | 		if strings.HasSuffix(input, "\\") { | ||||||
| 			for { | 			for { | ||||||
|  | |||||||
							
								
								
									
										1
									
								
								rl.go
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								rl.go
									
									
									
									
									
								
							| @ -22,6 +22,7 @@ func NewLineReader(prompt string) *LineReader { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (lr *LineReader) Read() (string, error) { | func (lr *LineReader) Read() (string, error) { | ||||||
|  | 	hooks.Em.Emit("command.precmd", nil) | ||||||
| 	return readline.String(lr.Prompt) | 	return readline.String(lr.Prompt) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										1
									
								
								shell.go
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								shell.go
									
									
									
									
									
								
							| @ -31,6 +31,7 @@ func RunInput(input string) { | |||||||
| 			continue | 			continue | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  | 	hooks.Em.Emit("command.preexec", input, cmdString) | ||||||
| 
 | 
 | ||||||
| 	// First try to load input, essentially compiling to bytecode | 	// First try to load input, essentially compiling to bytecode | ||||||
| 	fn, err := l.LoadString(cmdString) | 	fn, err := l.LoadString(cmdString) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user