package frame

import (
	"fmt"
	"os"
	"strings"

	"github.com/zetamatta/go-windows-netresource"
	"github.com/zetamatta/go-windows-subst"
)

func optionNetUse(arg string) {
	piece := strings.SplitN(arg, "=", 2)
	if len(piece) >= 2 {
		_, err := netresource.NetUse(piece[0], piece[1])
		if err != nil {
			fmt.Fprintf(os.Stderr, "--netuse: %s: %s\n", arg, err.Error())
		}
	}
}

func optionSubst(arg string) {
	piece := strings.SplitN(arg, "=", 2)
	if len(piece) >= 2 {
		subst.Define(piece[0], piece[1])
	}
}

package frame

import (
	"strings"

	"github.com/zetamatta/go-windows-netresource"
	"github.com/zetamatta/go-windows-subst"
)

func optionNetUse(arg string) {
	piece := strings.SplitN(arg, "=", 2)
	if len(piece) >= 2 {
		netresource.NetUse(piece[0], piece[1])
	}
}

func optionSubst(arg string) {
	piece := strings.SplitN(arg, "=", 2)
	if len(piece) >= 2 {
		subst.Define(piece[0], piece[1])
	}
}

Revert "If option --netuse fails, print error"
Revert "If option --netuse fails, print error"

This reverts commit c9dbb41c3eb7f5041ee423ae2451c6e4c07daa12.
because surpress `The local device name is already in use.`
