Skip to content

Commit

Permalink
fix(cli): command usage guidelines (#94)
Browse files Browse the repository at this point in the history
There is a guideline how cli usage help texts should be formatted: https://en.wikipedia.org/wiki/Command-line_interface#Command_description_syntax

Tanka did not satisfy those rules but it should, so now it does
  • Loading branch information
m1ome authored and sh0rez committed Oct 9, 2019
1 parent 8b87f6c commit 13238e5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cmd/tk/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func envSetCmd() *cobra.Command {

func envAddCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "add [path]",
Use: "add <path>",
Short: "create a new environment",
Args: cobra.ExactArgs(1),
Annotations: map[string]string{
Expand Down Expand Up @@ -144,7 +144,7 @@ func addEnv(dir string, cfg *v1alpha1.Config) error {

func envRemoveCmd() *cobra.Command {
return &cobra.Command{
Use: "remove [path]",
Use: "remove <path>",
Aliases: []string{"rm"},
Short: "delete an environment",
Annotations: map[string]string{
Expand Down
2 changes: 1 addition & 1 deletion cmd/tk/jsonnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
func evalCmd() *cobra.Command {
cmd := &cobra.Command{
Short: "evaluate the jsonnet to json",
Use: "eval [path]",
Use: "eval <path>",
Args: cobra.ExactArgs(1),
Annotations: map[string]string{
"args": "baseDir",
Expand Down
4 changes: 2 additions & 2 deletions cmd/tk/tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
func toolCmd() *cobra.Command {
cmd := &cobra.Command{
Short: "handy utilities for working with jsonnet",
Use: "tool",
Use: "tool [command]",
}
cmd.AddCommand(jpathCmd())
cmd.AddCommand(importsCmd())
Expand Down Expand Up @@ -51,7 +51,7 @@ func jpathCmd() *cobra.Command {

func importsCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "imports [file]",
Use: "imports <file>",
Short: "list all transitive imports of a file",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
Expand Down
6 changes: 3 additions & 3 deletions cmd/tk/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func workflowFlags(fs *pflag.FlagSet) *workflowFlagVars {

func applyCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "apply [path]",
Use: "apply <path>",
Short: "apply the configuration to the cluster",
Args: cobra.ExactArgs(1),
Annotations: map[string]string{
Expand Down Expand Up @@ -71,7 +71,7 @@ func diffCmd() *cobra.Command {
cmp.Handlers.Add("diffStrategy", complete.PredictSet("native", "subset"))

cmd := &cobra.Command{
Use: "diff [path]",
Use: "diff <path>",
Short: "differences between the configuration and the cluster",
Args: cobra.ExactArgs(1),
Annotations: map[string]string{
Expand Down Expand Up @@ -144,7 +144,7 @@ func diff(state []kubernetes.Manifest, pager bool, opts kubernetes.DiffOpts) (ch

func showCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "show [path]",
Use: "show <path>",
Short: "jsonnet as yaml",
Args: cobra.ExactArgs(1),
Annotations: map[string]string{
Expand Down

0 comments on commit 13238e5

Please sign in to comment.