gopkg.in/hugelgupf/u-root.v9@v9.0.0-20180831063832-3f6f1057f09b/cmds/umount/umount_linux.go (about)

     1  // Copyright 2017 the u-root Authors. All rights reserved
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package main
     6  
     7  import (
     8  	"errors"
     9  	"flag"
    10  
    11  	"github.com/u-root/u-root/pkg/mount"
    12  )
    13  
    14  var (
    15  	force = flag.Bool("f", false, "Force unmount")
    16  	lazy  = flag.Bool("l", false, "Lazy unmount")
    17  )
    18  
    19  func umount() error {
    20  	flag.Parse()
    21  	a := flag.Args()
    22  	if len(a) != 1 {
    23  		return errors.New("Usage: umount [-f | -l] path")
    24  	}
    25  	path := a[0]
    26  	return mount.Unmount(path, *force, *lazy)
    27  }