golang之flag简单使用方法
package main
import (
"flag"
"fmt"
)
func main() {
//flag简单使用方法
backup_dir := flag.String("b", "/home/default_dir", "backup path")
debug_mode := flag.Bool("d", false, "debug mode")
flag.Parse()
fmt.Println("backup_dir: ",*backup_dir)
fmt.Println("debug_mode: ",*debug_mode)
}
来源:CSDN
作者:e421083458
链接:https://blog.csdn.net/e421083458/article/details/52711981