itaysk / kubectl-neat

Clean up Kubernetes yaml and json output to make it readable
Apache License 2.0
1.68k stars 100 forks source link

cmd: default value of the inputFile flag #46

Open iamyeka opened 3 years ago

iamyeka commented 3 years ago

https://github.com/itaysk/kubectl-neat/blob/78c0fa27d5f8f4e8f192ce3dd38e26737f5cf271/cmd/cmd.go#L35 https://github.com/itaysk/kubectl-neat/blob/78c0fa27d5f8f4e8f192ce3dd38e26737f5cf271/cmd/cmd.go#L60-L68

In daily work, when we need to know how to use a command tool(for example: kubectl), we simply execute kubectl -h or just kubectl, then the help information will be shown on the screen. However, kubectl-neat cannot be executed like that which is a little confusing if someone uses the tool directly without reading README.md carefully.

itaysk commented 3 years ago

Hi @w0nwig thanks for taking the time to open this issue. kubectl-neat should print help info when the -h or --help flags are used. did that not work for you?

iamyeka commented 3 years ago

I mean when i simply execute kubectl-neat (without -h or --help), there's no output cause the program is waiting for stdin which is a little weird if i don't know The Default Value Of InputFile Is '-'. When i use other tools like kubectl and type kubectl on the console, my purpose is to see the help info of this tool.

The output will be like below when i type kubectl:

MacBook-Pro-WRJ:~ wrj$ kubectl
kubectl controls the Kubernetes cluster manager.

 Find more information at: https://kubernetes.io/docs/reference/kubectl/overview/

Basic Commands (Beginner):
  create         Create a resource from a file or from stdin.
  expose         使用 replication controller, service, deployment 或者 pod 并暴露它作为一个 新的
Kubernetes Service
  run            在集群中运行一个指定的镜像
  set            为 objects 设置一个指定的特征

Basic Commands (Intermediate):
  explain        查看资源的文档
  get            显示一个或更多 resources
  edit           在服务器上编辑一个资源
  delete         Delete resources by filenames, stdin, resources and names, or by resources and label selector

Deploy Commands:
  rollout        Manage the rollout of a resource
  scale          为 Deployment, ReplicaSet, Replication Controller 或者 Job 设置一个新的副本数量
  autoscale      自动调整一个 Deployment, ReplicaSet, 或者 ReplicationController 的副本数量

Cluster Management Commands:
  certificate    修改 certificate 资源.
  cluster-info   显示集群信息
  top            Display Resource (CPU/Memory/Storage) usage.
  cordon         标记 node 为 unschedulable
  uncordon       标记 node 为 schedulable
  drain          Drain node in preparation for maintenance
  taint          更新一个或者多个 node 上的 taints