mirror of
https://github.com/yarlson/lnk.git
synced 2025-08-31 18:01:41 +02:00
refactor(core): simplify Lnk creation with functional options pattern
This commit is contained in:
@@ -16,12 +16,7 @@ func newPullCmd() *cobra.Command {
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
host, _ := cmd.Flags().GetString("host")
|
||||
|
||||
var lnk *core.Lnk
|
||||
if host != "" {
|
||||
lnk = core.NewLnkWithHost(host)
|
||||
} else {
|
||||
lnk = core.NewLnk()
|
||||
}
|
||||
lnk := core.NewLnk(core.WithHost(host))
|
||||
|
||||
restored, err := lnk.Pull()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user