summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ChangeLog4
-rw-r--r--src/dash.15
-rw-r--r--src/options.c16
3 files changed, 21 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index e72849c..10ec45c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-12-23  Richard M Kreuter <kreuter@progn.net>
+
+	* Add set +o support.
+
 2007-12-23  Steve Langasek <steve.langasek@canonical.com>
 
 	* Fixed bad pointer arithmetic in evalcommand.
diff --git a/src/dash.1 b/src/dash.1
index 9b8ab0e..b4140eb 100644
--- a/src/dash.1
+++ b/src/dash.1
@@ -1782,6 +1782,11 @@ With no arguments, it lists the values of all shell variables.
 If options are given, it sets the specified option
 flags, or clears them as described in the section called
 .Sx Argument List Processing .
+As a special case, if the option is -o or +o and no argument is
+supplied, the shell prints the settings of all its options.  If the
+option is -o, the settings are printed in a human-readable format; if
+the option is +o, the settings are printed in a format suitable for
+reinput to the shell to affect the same option settings.
 .Pp
 The third use of the set command is to set the values of the shell's
 positional parameters to the specified args.
diff --git a/src/options.c b/src/options.c
index f669117..48c9671 100644
--- a/src/options.c
+++ b/src/options.c
@@ -240,10 +240,18 @@ minus_o(char *name, int val)
 	int i;
 
 	if (name == NULL) {
-		out1str("Current option settings\n");
-		for (i = 0; i < NOPTS; i++)
-			out1fmt("%-16s%s\n", optnames[i],
-				optlist[i] ? "on" : "off");
+		if (val) {
+			out1str("Current option settings\n");
+			for (i = 0; i < NOPTS; i++)
+				out1fmt("%-16s%s\n", optnames[i],
+					optlist[i] ? "on" : "off");
+		} else {
+			for (i = 0; i < NOPTS; i++)
+				out1fmt("set %s %s\n",
+					optlist[i] ? "-o" : "+o",
+					optnames[i]);
+
+		}
 	} else {
 		for (i = 0; i < NOPTS; i++)
 			if (equal(name, optnames[i])) {
809d0a0ba62&follow=1'>Move nick and tag coloring to color.cJune McEnroe 2019-02-25Add M-l to list the logJune McEnroe 2019-02-25Output raw to standard error if it is not a terminalJune McEnroe 2019-02-25Update tag colorsJune McEnroe This kind of incurs a lot of writes usually for no reason. The only place this matters is when cold-opening a /query. I wonder if there's a better way to do that. 2019-02-25Add color to tagsJune McEnroe 2019-02-25Remove tag X macros againJune McEnroe 2019-02-25Add M-a to switch to hot or unread windowJune McEnroe 2019-02-25Refactor uiReadJune McEnroe Centralizes the branching. 2019-02-24Scroll by full pages with PageUp/PageDownJune McEnroe 2019-02-23Clarify /window documentationJune McEnroe 2019-02-23Use first word of params in input commandsJune McEnroe Prevents anything weird from happening when tab-completing, which inserts a space. 2019-02-23Add C-n and C-p key bindings to switch windowsJune McEnroe 2019-02-23Change example command to join #ascii.town on freenodeJune McEnroe 2019-02-23Call def_prog_mode after termNoFlowJune McEnroe So that the settings get restored after /url or /man. 2019-02-22Move IRC formatting reset to C-sJune McEnroe Opens C-n for window switching. 2019-02-22Disable terminal flow controlJune McEnroe This opens up C-o, C-q and C-s for key bindings without C-v. 2019-02-22Bind up and down arrows to scrollJune McEnroe Honestly it's kind of weird that IRC clients usually use these for input history. 2019-02-22Remove topic TODOJune McEnroe I played around with it and it doesn't look right unless there is only one channel listed in the status. 2019-02-22Add /znc commandJune McEnroe Only because ZNC tells you to use it and expects it to work. 2019-02-22Update status line after scrolling and term eventsJune McEnroe 2019-02-22Reorganize input.cJune McEnroe 2019-02-22Fix name of <raw> window in man pageJune McEnroe 2019-02-22Rename global tags with angle bracketsJune McEnroe 2019-02-22Show status window while connectingJune McEnroe 2019-02-22Reorganize UI code for the umpteenth timeJune McEnroe It's actually in a good state now, I think. 2019-02-21Replace "view" with "window"June McEnroe I think originally I didn't want to use the same word as curses WINDOW but it's really much clearer for the user if they're just called windows. UI code probably needs yet another rewrite though. Still feels messy. 2019-02-21Remove ROT13June McEnroe It's just not convenient when it can only do the whole line... 2019-02-21Clean up man pageJune McEnroe 2019-01-26Draw UI before connectingJune McEnroe Otherwise the "Traveling" message isn't visible while connecting. 2019-01-25Avoid unused variable warnings with getyxJune McEnroe 2019-01-25Add GNU/Linux build instructionsJune McEnroe