-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Removing deprecated commands, making armadaUrl flag work as expected * Converting armadactl flags to kebab-case * Cleaning up CLI, cleaning up CLI docs, moving reporting commands, separating out reprioritize commands * Moving resources to their own directory * Removing capitalisation * This is an empty commit in order to trigger PR check re-run * This is an empty commit in order to trigger PR check re-run * Modifying cancel, preempt to use verb-noun structure. Modified cancel jobSet to use correct Armada API endpoint. * Making reprioritize command require queue and job-set * Updating documentation * Tidying go.mod file, linting Co-authored-by: Mustafa Ilyas <Mustafa.Ilyas@gresearch.co.uk>
- Loading branch information
1 parent
7ac9527
commit e66d6d8
Showing
30 changed files
with
620 additions
and
479 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package cmd | ||
|
||
import ( | ||
"embed" | ||
"fmt" | ||
"io/fs" | ||
|
||
"github.com/charmbracelet/glamour" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
//go:embed resources/README.md | ||
var ArmadactlReadMe embed.FS | ||
|
||
//go:embed resources/glamourStyle.json | ||
var GlamourStyle embed.FS | ||
|
||
func docsCmd() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "docs", | ||
Short: "Prints comprehensive Armadactl documentation", | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
readmeContent, err := fs.ReadFile(ArmadactlReadMe, "resources/README.md") | ||
if err != nil { | ||
return fmt.Errorf("could not read content from documentation file: %s", err) | ||
} | ||
|
||
glamourStyleContent, err := fs.ReadFile(GlamourStyle, "resources/glamourStyle.json") | ||
if err != nil { | ||
return fmt.Errorf("could not read content from documentation file: %s", err) | ||
} | ||
|
||
renderer, err := glamour.NewTermRenderer( | ||
glamour.WithStylesFromJSONBytes(glamourStyleContent), | ||
glamour.WithWordWrap(120), | ||
) | ||
if err != nil { | ||
return fmt.Errorf("could not create documentation renderer: %s", err) | ||
} | ||
|
||
out, err := renderer.Render(string(readmeContent)) | ||
if err != nil { | ||
return fmt.Errorf("could not render content from documentation file: %s", err) | ||
} | ||
|
||
fmt.Println(out) | ||
return nil | ||
}, | ||
} | ||
|
||
return cmd | ||
} |
Oops, something went wrong.