k3s/pkg/kubectl
Kubernetes Submit Queue c19569f03f Merge pull request #34502 from fabianofranz/cli_usability_improvements
Automatic merge from submit-queue

Improvements to CLI usability and maintainability

Improves `kubectl` from an usability perspective by

1. Fixing how we handle terminal width in help. Some sections like the flags use the entire available width, while others like long descriptions breaks lines but don't follow a well established max width (screenshot below). This PR adds a new responsive writer that will adjust to terminal width and set 80, 100, or 120 columns as the max width, but not more than that given POSIX best practices and recommendations for better readability.
![terminal_width](https://cloud.githubusercontent.com/assets/158611/19253184/b23a983e-8f1f-11e6-9bae-667dd5981485.png)
2. Adds our own normalizers for long descriptions and cmd examples which allows us better control about how things like lists, paragraphs, line breaks, etc are printed. Features markdown support. Looks like `templates.LongDesc` and `templates.Examples` instead of `dedent.Dedend`.
3. Allows simple reordering and reuse of help and usage sections.
3. Adds `verify-cli-conventions.sh` which intends to run tests to make sure cmd developers are using what we propose as [kubectl conventions](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/kubectl-conventions.md). Just a couple simple tests for now but the framework is there and it's easy to extend.
4. Update [kubectl conventions](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/kubectl-conventions.md) to use our own normalizers instead of `dedent.Dedent`.

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
Improves how 'kubectl' uses the terminal size when printing help and usage.
```

@kubernetes/kubectl
2016-10-17 23:41:23 -07:00
..
cmd Tools for checking CLI conventions 2016-10-17 11:50:02 -02:00
metricsutil Fix printing container usage. 2016-09-14 12:11:24 +02:00
resource Merge pull request #33546 from k82cn/k8s_15834 2016-10-15 06:50:00 -07:00
testing Add +optional tag to all fields with omitempty json tag 2016-10-17 08:52:13 -07:00
OWNERS
apply.go Fix typos 2016-10-15 00:21:00 +03:00
autoscale.go
bash_comp_utils.go
configmap.go
configmap_test.go
custom_column_printer.go Simplify the output in AfterPrint() 2016-09-08 09:42:17 +10:00
custom_column_printer_test.go
deployment.go Add "create deployment" sub-command 2016-08-08 13:24:30 +10:00
deployment_test.go Add "create deployment" sub-command 2016-08-08 13:24:30 +10:00
describe.go Remove duplicate code from kubectl describe 2016-10-14 12:39:34 +03:00
describe_test.go kubectl: move events sorting interface to the api for general use 2016-09-18 19:25:42 +02:00
doc.go
explain.go
generate.go
generate_test.go
history.go
interfaces.go
kubectl.go make shortcut expanding restmapper handle all 2016-09-15 11:03:51 -04:00
kubectl_test.go
namespace.go
namespace_test.go Fix namespace_test error message 2016-08-08 12:08:57 +10:00
proxy_server.go Fix various typos in kubectl 2016-08-02 19:51:51 +03:00
proxy_server_test.go
quota.go Add --scopes to kubectl-create-quota and add tests 2016-07-26 14:12:35 +02:00
quota_test.go Add --scopes to kubectl-create-quota and add tests 2016-07-26 14:12:35 +02:00
resource_filter.go add resource handling before printing 2016-09-21 10:03:59 -04:00
resource_printer.go Add NumberReady to DaemonSet status 2016-10-12 15:15:10 +02:00
resource_printer_test.go Add NumberReady to DaemonSet status 2016-10-12 15:15:10 +02:00
rollback.go rollout undo add dry-run implementation 2016-09-08 08:02:04 +08:00
rolling_updater.go move the retry util out of pkg/client/unversioned 2016-10-13 16:10:24 -07:00
rolling_updater_test.go remove testapi.Default.GroupVersion 2016-10-07 10:10:54 -04:00
rollout_status.go kubectl: add --revision flag in rollout status 2016-10-10 15:04:46 +02:00
rollout_status_test.go kubectl: add --revision flag in rollout status 2016-10-10 15:04:46 +02:00
run.go use len > 0 to replace port > 0 2016-09-28 10:23:25 +08:00
run_test.go add port validate when --port is set or --expose=true 2016-09-01 17:24:02 +08:00
scale.go change petset replicas type from int to int32 2016-10-08 17:13:20 +08:00
scale_test.go convert rest of kubectl to generated clients 2016-09-12 08:22:34 -04:00
secret.go
secret_for_docker_registry.go
secret_for_docker_registry_test.go
secret_for_tls.go
secret_for_tls_test.go the created path should be closed in test case 2016-09-06 11:08:52 +08:00
secret_test.go
service.go Merge pull request #28239 from ApsOps/kubectl-expose-headless-svc 2016-08-02 01:18:19 -07:00
service_basic.go make portallocator.ErrNotInRange a type 2016-10-04 13:19:24 -04:00
service_basic_test.go Add "create service" sub-commands 2016-08-08 12:31:21 +10:00
service_test.go Merge pull request #28239 from ApsOps/kubectl-expose-headless-svc 2016-08-02 01:18:19 -07:00
serviceaccount.go
serviceaccount_test.go
sorted_resource_name_list.go
sorted_resource_name_list_test.go
sorting_printer.go Simplify the output in AfterPrint() 2016-09-08 09:42:17 +10:00
sorting_printer_test.go
stop.go convert rest of kubectl to generated clients 2016-09-12 08:22:34 -04:00
stop_test.go convert rest of kubectl to generated clients 2016-09-12 08:22:34 -04:00
version.go convert more command to use a generated clientset 2016-09-12 07:38:34 -04:00