Add /window name variant
This commit is contained in:
		
							parent
							
								
									f4868fc906
								
							
						
					
					
						commit
						6ca54617ce
					
				@ -115,6 +115,8 @@ Send a raw IRC command.
 | 
			
		||||
.
 | 
			
		||||
.Ss UI Commands
 | 
			
		||||
.Bl -tag -width Ds
 | 
			
		||||
.It Ic /window Ar name
 | 
			
		||||
Switch to window by name.
 | 
			
		||||
.It Ic /window Ar num , Ic / Ns Ar num
 | 
			
		||||
Switch to window by number.
 | 
			
		||||
.El
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										10
									
								
								command.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								command.c
									
									
									
									
									
								
							@ -14,6 +14,7 @@
 | 
			
		||||
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <ctype.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
 | 
			
		||||
@ -64,8 +65,13 @@ static void commandQuit(size_t id, char *params) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void commandWindow(size_t id, char *params) {
 | 
			
		||||
	(void)id;
 | 
			
		||||
	if (params) uiShowNum(strtoul(params, NULL, 10));
 | 
			
		||||
	if (!params) return;
 | 
			
		||||
	if (isdigit(params[0])) {
 | 
			
		||||
		uiShowNum(strtoul(params, NULL, 10));
 | 
			
		||||
	} else {
 | 
			
		||||
		id = idFind(params);
 | 
			
		||||
		if (id) uiShowID(id);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static const struct Handler {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user