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

Support dig format for resolver #47

Merged
merged 2 commits into from
Apr 11, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
fix comment
didil committed Apr 11, 2023
commit 8382de8fcacfdf573d5dc2a40156b8e79ddbb519
3 changes: 1 addition & 2 deletions lib/target_query.go
Original file line number Diff line number Diff line change
@@ -21,14 +21,13 @@ var commandsWithResolver = []string{

func ParseTargetQuery(cmd string, args []string) (*TargetQuery, error) {
targetQuery := &TargetQuery{}
// Target
if len(args) == 0 {
return nil, errors.New("provided target is empty")
}

resolver, argsWithoutResolver := findAndRemoveResolver(args)

if resolver != "" {
// resolver was found
if !slices.Contains(commandsWithResolver, cmd) {
return nil, fmt.Errorf("command %s does not accept a resolver argument. @%s was provided", cmd, resolver)
}