Index: /trunk/doc/soju.1.scd
===================================================================
--- /trunk/doc/soju.1.scd	(revision 771)
+++ /trunk/doc/soju.1.scd	(revision 772)
@@ -237,5 +237,5 @@
 		To clear all commands, set it to the empty string.
 
-*network update* <name> [options...]
+*network update* [name] [options...]
 	Update an existing network. The options are the same as the
 	_network create_ command.
@@ -244,9 +244,15 @@
 	network.
 
-*network delete* <name>
+	If _name_ is not specified, the current network is updated.
+
+*network delete* [name]
 	Disconnect and delete a network.
 
-*network quote* <name> <command>
+	If _name_ is not specified, the current network is deleted.
+
+*network quote* [name] <command>
 	Send a raw IRC line as-is to a network.
+
+	If _name_ is not specified, the command is sent to the current network.
 
 *network status*
Index: /trunk/service.go
===================================================================
--- /trunk/service.go	(revision 771)
+++ /trunk/service.go	(revision 772)
@@ -209,15 +209,15 @@
 				},
 				"update": {
-					usage:  "<name> [-addr addr] [-name name] [-username username] [-pass pass] [-realname realname] [-nick nick] [-enabled enabled] [-connect-command command]...",
+					usage:  "[name] [-addr addr] [-name name] [-username username] [-pass pass] [-realname realname] [-nick nick] [-enabled enabled] [-connect-command command]...",
 					desc:   "update a network",
 					handle: handleServiceNetworkUpdate,
 				},
 				"delete": {
-					usage:  "<name>",
+					usage:  "[name]",
 					desc:   "delete a network",
 					handle: handleServiceNetworkDelete,
 				},
 				"quote": {
-					usage:  "<name> <command>",
+					usage:  "[name] <command>",
 					desc:   "send a raw line to a network",
 					handle: handleServiceNetworkQuote,
@@ -410,4 +410,20 @@
 	*f.ptr = &v
 	return nil
+}
+
+func getNetworkFromArg(dc *downstreamConn, params []string) (*network, []string, error) {
+	name, params := popArg(params)
+	if name == "" {
+		if dc.network == nil {
+			return nil, params, fmt.Errorf("no network selected, a name argument is required")
+		}
+		return dc.network, params, nil
+	} else {
+		net := dc.user.getNetwork(name)
+		if net == nil {
+			return nil, params, fmt.Errorf("unknown network %q", name)
+		}
+		return net, params, nil
+	}
 }
 
@@ -551,16 +567,12 @@
 
 func handleServiceNetworkUpdate(ctx context.Context, dc *downstreamConn, params []string) error {
-	if len(params) < 1 {
-		return fmt.Errorf("expected at least one argument")
+	net, params, err := getNetworkFromArg(dc, params)
+	if err != nil {
+		return err
 	}
 
 	fs := newNetworkFlagSet()
-	if err := fs.Parse(params[1:]); err != nil {
-		return err
-	}
-
-	net := dc.user.getNetwork(params[0])
-	if net == nil {
-		return fmt.Errorf("unknown network %q", params[0])
+	if err := fs.Parse(params); err != nil {
+		return err
 	}
 
@@ -580,11 +592,7 @@
 
 func handleServiceNetworkDelete(ctx context.Context, dc *downstreamConn, params []string) error {
-	if len(params) != 1 {
-		return fmt.Errorf("expected exactly one argument")
-	}
-
-	net := dc.user.getNetwork(params[0])
-	if net == nil {
-		return fmt.Errorf("unknown network %q", params[0])
+	net, params, err := getNetworkFromArg(dc, params)
+	if err != nil {
+		return err
 	}
 
@@ -598,21 +606,24 @@
 
 func handleServiceNetworkQuote(ctx context.Context, dc *downstreamConn, params []string) error {
-	if len(params) != 2 {
-		return fmt.Errorf("expected exactly two arguments")
-	}
-
-	net := dc.user.getNetwork(params[0])
-	if net == nil {
-		return fmt.Errorf("unknown network %q", params[0])
+	if len(params) != 1 && len(params) != 2 {
+		return fmt.Errorf("expected one or two arguments")
+	}
+
+	raw := params[len(params)-1]
+	params = params[:len(params)-1]
+
+	net, params, err := getNetworkFromArg(dc, params)
+	if err != nil {
+		return err
 	}
 
 	uc := net.conn
 	if uc == nil {
-		return fmt.Errorf("network %q is not currently connected", params[0])
-	}
-
-	m, err := irc.ParseMessage(params[1])
-	if err != nil {
-		return fmt.Errorf("failed to parse command %q: %v", params[1], err)
+		return fmt.Errorf("network %q is not currently connected", net.GetName())
+	}
+
+	m, err := irc.ParseMessage(raw)
+	if err != nil {
+		return fmt.Errorf("failed to parse command %q: %v", raw, err)
 	}
 	uc.SendMessage(ctx, m)
