github.com/jlowellwofford/u-root@v1.0.0/pkg/uroot/util/usage.go (about)

     1  // Copyright 2014-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 util
     6  
     7  import (
     8  	"flag"
     9  	"os"
    10  )
    11  
    12  func Usage(cmd string) {
    13  	defUsage := flag.Usage
    14  	flag.Usage = func() {
    15  		os.Args[0] = cmd
    16  		defUsage()
    17  	}
    18  }