github.com/xyproto/u-root@v6.0.1-0.20200302025726-5528e0c77a3c+incompatible/cmds/core/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 }