xref: /openbsd/usr.bin/vi/ex/ex_set.c (revision 486aa1f0)
1 /*	$OpenBSD: ex_set.c,v 1.6 2014/11/12 04:28:41 bentley Exp $	*/
2 
3 /*-
4  * Copyright (c) 1992, 1993, 1994
5  *	The Regents of the University of California.  All rights reserved.
6  * Copyright (c) 1992, 1993, 1994, 1995, 1996
7  *	Keith Bostic.  All rights reserved.
8  *
9  * See the LICENSE file for redistribution information.
10  */
11 
12 #include "config.h"
13 
14 #include <sys/types.h>
15 #include <sys/queue.h>
16 
17 #include <bitstring.h>
18 #include <limits.h>
19 #include <stdio.h>
20 
21 #include "../common/common.h"
22 
23 /*
24  * ex_set -- :set
25  *	Ex set option.
26  *
27  * PUBLIC: int ex_set(SCR *, EXCMD *);
28  */
29 int
ex_set(SCR * sp,EXCMD * cmdp)30 ex_set(SCR *sp, EXCMD *cmdp)
31 {
32 	switch(cmdp->argc) {
33 	case 0:
34 		opts_dump(sp, CHANGED_DISPLAY);
35 		break;
36 	default:
37 		if (opts_set(sp, cmdp->argv, cmdp->cmd->usage))
38 			return (1);
39 		break;
40 	}
41 	return (0);
42 }
43