1.0 version
This commit is contained in:
19
internal/app/file.go
Normal file
19
internal/app/file.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func GetFilePath() (string, error) {
|
||||
fp := ""
|
||||
|
||||
for _, v := range os.Args[1:] {
|
||||
if !strings.HasPrefix(v, "-") {
|
||||
fp = v
|
||||
return fp, nil
|
||||
}
|
||||
}
|
||||
return "", errors.New("not enough arguments")
|
||||
}
|
||||
Reference in New Issue
Block a user