Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: panic happend when only use -f option #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions core/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,12 @@ func ParseOptions() *Options {
if len(options.Domain) > 0 && options.Verify {
gologger.Fatalf("-d 与 -verify参数不可以同时出现!")
}
if options.FileName != "" && !FileExists(options.FileName) {
gologger.Fatalf("文件:%s 不存在!\n", options.FileName)
if options.FileName != "" {
if !FileExists(options.FileName) {
gologger.Fatalf("文件:%s 不存在!\n", options.FileName)
} else if !options.Verify || len(options.Domain) == 0 {
gologger.Fatalf("-f需配合-d或-verify使用!\n", )
Ro0tk1t marked this conversation as resolved.
Show resolved Hide resolved
}
}
if !options.Stdin && options.Verify && options.FileName == "" {
gologger.Fatalf("启用了 -verify 参数但传入域名为空!")
Expand Down