-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix:
fcli fod issue list
: Add --include
option to allow for retri…
…eving `fixed` and/or `suppressed` issues (fixes #545)
- Loading branch information
1 parent
7857239
commit 01c2ac2
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...core/fcli-fod/src/main/java/com/fortify/cli/fod/issue/cli/mixin/FoDIssueIncludeMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.fortify.cli.fod.issue.cli.mixin; | ||
|
||
import com.fortify.cli.common.rest.unirest.IHttpRequestUpdater; | ||
import kong.unirest.HttpRequest; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import picocli.CommandLine; | ||
import java.util.List; | ||
|
||
public class FoDIssueIncludeMixin implements IHttpRequestUpdater { | ||
@CommandLine.Option(names = {"--include", "-i"}, split = ",", descriptionKey = "fcli.fod.issue.list.includeIssue") | ||
private List<FoDIssueInclude> includes; | ||
|
||
public HttpRequest<?> updateRequest(HttpRequest<?> request) { | ||
for ( var include : includes) { | ||
request = request.queryString(include.getRequestParameterName(), "true"); | ||
} | ||
return request; | ||
} | ||
|
||
@RequiredArgsConstructor | ||
public static enum FoDIssueInclude { | ||
fixed("includeFixed"), suppressed("includeSuppressed"); | ||
|
||
@Getter | ||
private final String requestParameterName; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters