Skip to content

Commit 13238e5

Browse files
m1omesh0rez
authored andcommitted
fix(cli): command usage guidelines (#94)
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
1 parent 8b87f6c commit 13238e5

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

cmd/tk/env.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func envSetCmd() *cobra.Command {
8989

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

145145
func envRemoveCmd() *cobra.Command {
146146
return &cobra.Command{
147-
Use: "remove [path]",
147+
Use: "remove <path>",
148148
Aliases: []string{"rm"},
149149
Short: "delete an environment",
150150
Annotations: map[string]string{

cmd/tk/jsonnet.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
func evalCmd() *cobra.Command {
1515
cmd := &cobra.Command{
1616
Short: "evaluate the jsonnet to json",
17-
Use: "eval [path]",
17+
Use: "eval <path>",
1818
Args: cobra.ExactArgs(1),
1919
Annotations: map[string]string{
2020
"args": "baseDir",

cmd/tk/tool.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
func toolCmd() *cobra.Command {
2020
cmd := &cobra.Command{
2121
Short: "handy utilities for working with jsonnet",
22-
Use: "tool",
22+
Use: "tool [command]",
2323
}
2424
cmd.AddCommand(jpathCmd())
2525
cmd.AddCommand(importsCmd())
@@ -51,7 +51,7 @@ func jpathCmd() *cobra.Command {
5151

5252
func importsCmd() *cobra.Command {
5353
cmd := &cobra.Command{
54-
Use: "imports [file]",
54+
Use: "imports <file>",
5555
Short: "list all transitive imports of a file",
5656
Args: cobra.ExactArgs(1),
5757
Run: func(cmd *cobra.Command, args []string) {

cmd/tk/workflow.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func workflowFlags(fs *pflag.FlagSet) *workflowFlagVars {
2727

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

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

145145
func showCmd() *cobra.Command {
146146
cmd := &cobra.Command{
147-
Use: "show [path]",
147+
Use: "show <path>",
148148
Short: "jsonnet as yaml",
149149
Args: cobra.ExactArgs(1),
150150
Annotations: map[string]string{

0 commit comments

Comments
 (0)