-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend
list
command by additional output formats (#105)
* Add option to list all available tags * Add json output format to list command * Add basic documentation for `list` command
- Loading branch information
Showing
11 changed files
with
216 additions
and
36 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
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
40 changes: 40 additions & 0 deletions
40
src/main/java/com/askimed/nf/test/commands/AbstractCommand.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,40 @@ | ||
package com.askimed.nf.test.commands; | ||
|
||
import java.util.concurrent.Callable; | ||
|
||
import com.askimed.nf.test.App; | ||
import com.askimed.nf.test.util.AnsiText; | ||
import com.askimed.nf.test.util.Emoji; | ||
|
||
import picocli.CommandLine.Option; | ||
import picocli.CommandLine.Help.Visibility; | ||
|
||
public abstract class AbstractCommand implements Callable<Integer> { | ||
|
||
@Option(names = { | ||
"--silent" }, description = "Hide header and program version", required = false, showDefaultValue = Visibility.ALWAYS) | ||
private boolean silent = false; | ||
|
||
@Override | ||
public Integer call() throws Exception { | ||
|
||
if (!silent) { | ||
printHeader(); | ||
} | ||
|
||
return execute(); | ||
} | ||
|
||
public abstract Integer execute() throws Exception; | ||
|
||
private void printHeader() { | ||
|
||
System.out.println(); | ||
System.out.println(Emoji.ROCKET + AnsiText.bold(" " + App.NAME + " " + App.VERSION)); | ||
System.out.println("https://code.askimed.com/nf-test"); | ||
System.out.println("(c) 2021 - 2023 Lukas Forer and Sebastian Schoenherr"); | ||
System.out.println(); | ||
|
||
} | ||
|
||
} |
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
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
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
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
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
6 changes: 2 additions & 4 deletions
6
src/main/java/com/askimed/nf/test/commands/VersionCommand.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
Oops, something went wrong.