Make -ext flag required for the create command

This commit is contained in:
Dale Hui 2018-06-17 19:36:16 -07:00
parent 872a561495
commit c3794da4ed
1 changed files with 4 additions and 2 deletions

View File

@ -128,9 +128,11 @@ Database drivers: `+strings.Join(database.List(), ", ")+"\n")
}
name := createFlagSet.Arg(0)
if *extPtr != "" {
*extPtr = "." + strings.TrimPrefix(*extPtr, ".")
if *extPtr == "" {
log.fatal("error: -ext flag must be specified")
}
*extPtr = "." + strings.TrimPrefix(*extPtr, ".")
if *dirPtr != "" {
*dirPtr = strings.Trim(*dirPtr, "/") + "/"
}