Browse code

fix nil printer panic in oc set sub-cmds

juanvallejo authored on 2016/10/20 00:34:54
Showing 21 changed files
... ...
@@ -8906,6 +8906,8 @@ _oc_env()
8906 8906
     local_nonpersistent_flags+=("--from=")
8907 8907
     flags+=("--list")
8908 8908
     local_nonpersistent_flags+=("--list")
8909
+    flags+=("--no-headers")
8910
+    local_nonpersistent_flags+=("--no-headers")
8909 8911
     flags+=("--output=")
8910 8912
     two_word_flags+=("-o")
8911 8913
     local_nonpersistent_flags+=("--output=")
... ...
@@ -8922,6 +8924,17 @@ _oc_env()
8922 8922
     flags+=("--selector=")
8923 8923
     two_word_flags+=("-l")
8924 8924
     local_nonpersistent_flags+=("--selector=")
8925
+    flags+=("--show-all")
8926
+    flags+=("-a")
8927
+    local_nonpersistent_flags+=("--show-all")
8928
+    flags+=("--show-labels")
8929
+    local_nonpersistent_flags+=("--show-labels")
8930
+    flags+=("--sort-by=")
8931
+    local_nonpersistent_flags+=("--sort-by=")
8932
+    flags+=("--template=")
8933
+    flags_with_completion+=("--template")
8934
+    flags_completion+=("_filedir")
8935
+    local_nonpersistent_flags+=("--template=")
8925 8936
     flags+=("--as=")
8926 8937
     flags+=("--certificate-authority=")
8927 8938
     flags_with_completion+=("--certificate-authority")
... ...
@@ -13423,6 +13436,8 @@ _oc_set_env()
13423 13423
     local_nonpersistent_flags+=("--from=")
13424 13424
     flags+=("--list")
13425 13425
     local_nonpersistent_flags+=("--list")
13426
+    flags+=("--no-headers")
13427
+    local_nonpersistent_flags+=("--no-headers")
13426 13428
     flags+=("--output=")
13427 13429
     two_word_flags+=("-o")
13428 13430
     local_nonpersistent_flags+=("--output=")
... ...
@@ -13439,6 +13454,17 @@ _oc_set_env()
13439 13439
     flags+=("--selector=")
13440 13440
     two_word_flags+=("-l")
13441 13441
     local_nonpersistent_flags+=("--selector=")
13442
+    flags+=("--show-all")
13443
+    flags+=("-a")
13444
+    local_nonpersistent_flags+=("--show-all")
13445
+    flags+=("--show-labels")
13446
+    local_nonpersistent_flags+=("--show-labels")
13447
+    flags+=("--sort-by=")
13448
+    local_nonpersistent_flags+=("--sort-by=")
13449
+    flags+=("--template=")
13450
+    flags_with_completion+=("--template")
13451
+    flags_completion+=("_filedir")
13452
+    local_nonpersistent_flags+=("--template=")
13442 13453
     flags+=("--as=")
13443 13454
     flags+=("--certificate-authority=")
13444 13455
     flags_with_completion+=("--certificate-authority")
... ...
@@ -13862,6 +13888,8 @@ _oc_set_volumes()
13862 13862
     local_nonpersistent_flags+=("--mount-path=")
13863 13863
     flags+=("--name=")
13864 13864
     local_nonpersistent_flags+=("--name=")
13865
+    flags+=("--no-headers")
13866
+    local_nonpersistent_flags+=("--no-headers")
13865 13867
     flags+=("--output=")
13866 13868
     two_word_flags+=("-o")
13867 13869
     local_nonpersistent_flags+=("--output=")
... ...
@@ -13878,8 +13906,19 @@ _oc_set_volumes()
13878 13878
     flags+=("--selector=")
13879 13879
     two_word_flags+=("-l")
13880 13880
     local_nonpersistent_flags+=("--selector=")
13881
+    flags+=("--show-all")
13882
+    flags+=("-a")
13883
+    local_nonpersistent_flags+=("--show-all")
13884
+    flags+=("--show-labels")
13885
+    local_nonpersistent_flags+=("--show-labels")
13886
+    flags+=("--sort-by=")
13887
+    local_nonpersistent_flags+=("--sort-by=")
13881 13888
     flags+=("--source=")
13882 13889
     local_nonpersistent_flags+=("--source=")
13890
+    flags+=("--template=")
13891
+    flags_with_completion+=("--template")
13892
+    flags_completion+=("_filedir")
13893
+    local_nonpersistent_flags+=("--template=")
13883 13894
     flags+=("--type=")
13884 13895
     two_word_flags+=("-t")
13885 13896
     local_nonpersistent_flags+=("--type=")
... ...
@@ -14275,6 +14314,8 @@ _oc_volumes()
14275 14275
     local_nonpersistent_flags+=("--mount-path=")
14276 14276
     flags+=("--name=")
14277 14277
     local_nonpersistent_flags+=("--name=")
14278
+    flags+=("--no-headers")
14279
+    local_nonpersistent_flags+=("--no-headers")
14278 14280
     flags+=("--output=")
14279 14281
     two_word_flags+=("-o")
14280 14282
     local_nonpersistent_flags+=("--output=")
... ...
@@ -14291,8 +14332,19 @@ _oc_volumes()
14291 14291
     flags+=("--selector=")
14292 14292
     two_word_flags+=("-l")
14293 14293
     local_nonpersistent_flags+=("--selector=")
14294
+    flags+=("--show-all")
14295
+    flags+=("-a")
14296
+    local_nonpersistent_flags+=("--show-all")
14297
+    flags+=("--show-labels")
14298
+    local_nonpersistent_flags+=("--show-labels")
14299
+    flags+=("--sort-by=")
14300
+    local_nonpersistent_flags+=("--sort-by=")
14294 14301
     flags+=("--source=")
14295 14302
     local_nonpersistent_flags+=("--source=")
14303
+    flags+=("--template=")
14304
+    flags_with_completion+=("--template")
14305
+    flags_completion+=("_filedir")
14306
+    local_nonpersistent_flags+=("--template=")
14296 14307
     flags+=("--type=")
14297 14308
     two_word_flags+=("-t")
14298 14309
     local_nonpersistent_flags+=("--type=")
... ...
@@ -13514,6 +13514,8 @@ _openshift_cli_env()
13514 13514
     local_nonpersistent_flags+=("--from=")
13515 13515
     flags+=("--list")
13516 13516
     local_nonpersistent_flags+=("--list")
13517
+    flags+=("--no-headers")
13518
+    local_nonpersistent_flags+=("--no-headers")
13517 13519
     flags+=("--output=")
13518 13520
     two_word_flags+=("-o")
13519 13521
     local_nonpersistent_flags+=("--output=")
... ...
@@ -13530,6 +13532,17 @@ _openshift_cli_env()
13530 13530
     flags+=("--selector=")
13531 13531
     two_word_flags+=("-l")
13532 13532
     local_nonpersistent_flags+=("--selector=")
13533
+    flags+=("--show-all")
13534
+    flags+=("-a")
13535
+    local_nonpersistent_flags+=("--show-all")
13536
+    flags+=("--show-labels")
13537
+    local_nonpersistent_flags+=("--show-labels")
13538
+    flags+=("--sort-by=")
13539
+    local_nonpersistent_flags+=("--sort-by=")
13540
+    flags+=("--template=")
13541
+    flags_with_completion+=("--template")
13542
+    flags_completion+=("_filedir")
13543
+    local_nonpersistent_flags+=("--template=")
13533 13544
     flags+=("--as=")
13534 13545
     flags+=("--certificate-authority=")
13535 13546
     flags_with_completion+=("--certificate-authority")
... ...
@@ -18096,6 +18109,8 @@ _openshift_cli_set_env()
18096 18096
     local_nonpersistent_flags+=("--from=")
18097 18097
     flags+=("--list")
18098 18098
     local_nonpersistent_flags+=("--list")
18099
+    flags+=("--no-headers")
18100
+    local_nonpersistent_flags+=("--no-headers")
18099 18101
     flags+=("--output=")
18100 18102
     two_word_flags+=("-o")
18101 18103
     local_nonpersistent_flags+=("--output=")
... ...
@@ -18112,6 +18127,17 @@ _openshift_cli_set_env()
18112 18112
     flags+=("--selector=")
18113 18113
     two_word_flags+=("-l")
18114 18114
     local_nonpersistent_flags+=("--selector=")
18115
+    flags+=("--show-all")
18116
+    flags+=("-a")
18117
+    local_nonpersistent_flags+=("--show-all")
18118
+    flags+=("--show-labels")
18119
+    local_nonpersistent_flags+=("--show-labels")
18120
+    flags+=("--sort-by=")
18121
+    local_nonpersistent_flags+=("--sort-by=")
18122
+    flags+=("--template=")
18123
+    flags_with_completion+=("--template")
18124
+    flags_completion+=("_filedir")
18125
+    local_nonpersistent_flags+=("--template=")
18115 18126
     flags+=("--as=")
18116 18127
     flags+=("--certificate-authority=")
18117 18128
     flags_with_completion+=("--certificate-authority")
... ...
@@ -18540,6 +18566,8 @@ _openshift_cli_set_volumes()
18540 18540
     local_nonpersistent_flags+=("--mount-path=")
18541 18541
     flags+=("--name=")
18542 18542
     local_nonpersistent_flags+=("--name=")
18543
+    flags+=("--no-headers")
18544
+    local_nonpersistent_flags+=("--no-headers")
18543 18545
     flags+=("--output=")
18544 18546
     two_word_flags+=("-o")
18545 18547
     local_nonpersistent_flags+=("--output=")
... ...
@@ -18556,8 +18584,19 @@ _openshift_cli_set_volumes()
18556 18556
     flags+=("--selector=")
18557 18557
     two_word_flags+=("-l")
18558 18558
     local_nonpersistent_flags+=("--selector=")
18559
+    flags+=("--show-all")
18560
+    flags+=("-a")
18561
+    local_nonpersistent_flags+=("--show-all")
18562
+    flags+=("--show-labels")
18563
+    local_nonpersistent_flags+=("--show-labels")
18564
+    flags+=("--sort-by=")
18565
+    local_nonpersistent_flags+=("--sort-by=")
18559 18566
     flags+=("--source=")
18560 18567
     local_nonpersistent_flags+=("--source=")
18568
+    flags+=("--template=")
18569
+    flags_with_completion+=("--template")
18570
+    flags_completion+=("_filedir")
18571
+    local_nonpersistent_flags+=("--template=")
18561 18572
     flags+=("--type=")
18562 18573
     two_word_flags+=("-t")
18563 18574
     local_nonpersistent_flags+=("--type=")
... ...
@@ -18916,6 +18955,8 @@ _openshift_cli_volumes()
18916 18916
     local_nonpersistent_flags+=("--mount-path=")
18917 18917
     flags+=("--name=")
18918 18918
     local_nonpersistent_flags+=("--name=")
18919
+    flags+=("--no-headers")
18920
+    local_nonpersistent_flags+=("--no-headers")
18919 18921
     flags+=("--output=")
18920 18922
     two_word_flags+=("-o")
18921 18923
     local_nonpersistent_flags+=("--output=")
... ...
@@ -18932,8 +18973,19 @@ _openshift_cli_volumes()
18932 18932
     flags+=("--selector=")
18933 18933
     two_word_flags+=("-l")
18934 18934
     local_nonpersistent_flags+=("--selector=")
18935
+    flags+=("--show-all")
18936
+    flags+=("-a")
18937
+    local_nonpersistent_flags+=("--show-all")
18938
+    flags+=("--show-labels")
18939
+    local_nonpersistent_flags+=("--show-labels")
18940
+    flags+=("--sort-by=")
18941
+    local_nonpersistent_flags+=("--sort-by=")
18935 18942
     flags+=("--source=")
18936 18943
     local_nonpersistent_flags+=("--source=")
18944
+    flags+=("--template=")
18945
+    flags_with_completion+=("--template")
18946
+    flags_completion+=("_filedir")
18947
+    local_nonpersistent_flags+=("--template=")
18937 18948
     flags+=("--type=")
18938 18949
     two_word_flags+=("-t")
18939 18950
     local_nonpersistent_flags+=("--type=")
... ...
@@ -9067,6 +9067,8 @@ _oc_env()
9067 9067
     local_nonpersistent_flags+=("--from=")
9068 9068
     flags+=("--list")
9069 9069
     local_nonpersistent_flags+=("--list")
9070
+    flags+=("--no-headers")
9071
+    local_nonpersistent_flags+=("--no-headers")
9070 9072
     flags+=("--output=")
9071 9073
     two_word_flags+=("-o")
9072 9074
     local_nonpersistent_flags+=("--output=")
... ...
@@ -9083,6 +9085,17 @@ _oc_env()
9083 9083
     flags+=("--selector=")
9084 9084
     two_word_flags+=("-l")
9085 9085
     local_nonpersistent_flags+=("--selector=")
9086
+    flags+=("--show-all")
9087
+    flags+=("-a")
9088
+    local_nonpersistent_flags+=("--show-all")
9089
+    flags+=("--show-labels")
9090
+    local_nonpersistent_flags+=("--show-labels")
9091
+    flags+=("--sort-by=")
9092
+    local_nonpersistent_flags+=("--sort-by=")
9093
+    flags+=("--template=")
9094
+    flags_with_completion+=("--template")
9095
+    flags_completion+=("_filedir")
9096
+    local_nonpersistent_flags+=("--template=")
9086 9097
     flags+=("--as=")
9087 9098
     flags+=("--certificate-authority=")
9088 9099
     flags_with_completion+=("--certificate-authority")
... ...
@@ -13584,6 +13597,8 @@ _oc_set_env()
13584 13584
     local_nonpersistent_flags+=("--from=")
13585 13585
     flags+=("--list")
13586 13586
     local_nonpersistent_flags+=("--list")
13587
+    flags+=("--no-headers")
13588
+    local_nonpersistent_flags+=("--no-headers")
13587 13589
     flags+=("--output=")
13588 13590
     two_word_flags+=("-o")
13589 13591
     local_nonpersistent_flags+=("--output=")
... ...
@@ -13600,6 +13615,17 @@ _oc_set_env()
13600 13600
     flags+=("--selector=")
13601 13601
     two_word_flags+=("-l")
13602 13602
     local_nonpersistent_flags+=("--selector=")
13603
+    flags+=("--show-all")
13604
+    flags+=("-a")
13605
+    local_nonpersistent_flags+=("--show-all")
13606
+    flags+=("--show-labels")
13607
+    local_nonpersistent_flags+=("--show-labels")
13608
+    flags+=("--sort-by=")
13609
+    local_nonpersistent_flags+=("--sort-by=")
13610
+    flags+=("--template=")
13611
+    flags_with_completion+=("--template")
13612
+    flags_completion+=("_filedir")
13613
+    local_nonpersistent_flags+=("--template=")
13603 13614
     flags+=("--as=")
13604 13615
     flags+=("--certificate-authority=")
13605 13616
     flags_with_completion+=("--certificate-authority")
... ...
@@ -14023,6 +14049,8 @@ _oc_set_volumes()
14023 14023
     local_nonpersistent_flags+=("--mount-path=")
14024 14024
     flags+=("--name=")
14025 14025
     local_nonpersistent_flags+=("--name=")
14026
+    flags+=("--no-headers")
14027
+    local_nonpersistent_flags+=("--no-headers")
14026 14028
     flags+=("--output=")
14027 14029
     two_word_flags+=("-o")
14028 14030
     local_nonpersistent_flags+=("--output=")
... ...
@@ -14039,8 +14067,19 @@ _oc_set_volumes()
14039 14039
     flags+=("--selector=")
14040 14040
     two_word_flags+=("-l")
14041 14041
     local_nonpersistent_flags+=("--selector=")
14042
+    flags+=("--show-all")
14043
+    flags+=("-a")
14044
+    local_nonpersistent_flags+=("--show-all")
14045
+    flags+=("--show-labels")
14046
+    local_nonpersistent_flags+=("--show-labels")
14047
+    flags+=("--sort-by=")
14048
+    local_nonpersistent_flags+=("--sort-by=")
14042 14049
     flags+=("--source=")
14043 14050
     local_nonpersistent_flags+=("--source=")
14051
+    flags+=("--template=")
14052
+    flags_with_completion+=("--template")
14053
+    flags_completion+=("_filedir")
14054
+    local_nonpersistent_flags+=("--template=")
14044 14055
     flags+=("--type=")
14045 14056
     two_word_flags+=("-t")
14046 14057
     local_nonpersistent_flags+=("--type=")
... ...
@@ -14436,6 +14475,8 @@ _oc_volumes()
14436 14436
     local_nonpersistent_flags+=("--mount-path=")
14437 14437
     flags+=("--name=")
14438 14438
     local_nonpersistent_flags+=("--name=")
14439
+    flags+=("--no-headers")
14440
+    local_nonpersistent_flags+=("--no-headers")
14439 14441
     flags+=("--output=")
14440 14442
     two_word_flags+=("-o")
14441 14443
     local_nonpersistent_flags+=("--output=")
... ...
@@ -14452,8 +14493,19 @@ _oc_volumes()
14452 14452
     flags+=("--selector=")
14453 14453
     two_word_flags+=("-l")
14454 14454
     local_nonpersistent_flags+=("--selector=")
14455
+    flags+=("--show-all")
14456
+    flags+=("-a")
14457
+    local_nonpersistent_flags+=("--show-all")
14458
+    flags+=("--show-labels")
14459
+    local_nonpersistent_flags+=("--show-labels")
14460
+    flags+=("--sort-by=")
14461
+    local_nonpersistent_flags+=("--sort-by=")
14455 14462
     flags+=("--source=")
14456 14463
     local_nonpersistent_flags+=("--source=")
14464
+    flags+=("--template=")
14465
+    flags_with_completion+=("--template")
14466
+    flags_completion+=("_filedir")
14467
+    local_nonpersistent_flags+=("--template=")
14457 14468
     flags+=("--type=")
14458 14469
     two_word_flags+=("-t")
14459 14470
     local_nonpersistent_flags+=("--type=")
... ...
@@ -13675,6 +13675,8 @@ _openshift_cli_env()
13675 13675
     local_nonpersistent_flags+=("--from=")
13676 13676
     flags+=("--list")
13677 13677
     local_nonpersistent_flags+=("--list")
13678
+    flags+=("--no-headers")
13679
+    local_nonpersistent_flags+=("--no-headers")
13678 13680
     flags+=("--output=")
13679 13681
     two_word_flags+=("-o")
13680 13682
     local_nonpersistent_flags+=("--output=")
... ...
@@ -13691,6 +13693,17 @@ _openshift_cli_env()
13691 13691
     flags+=("--selector=")
13692 13692
     two_word_flags+=("-l")
13693 13693
     local_nonpersistent_flags+=("--selector=")
13694
+    flags+=("--show-all")
13695
+    flags+=("-a")
13696
+    local_nonpersistent_flags+=("--show-all")
13697
+    flags+=("--show-labels")
13698
+    local_nonpersistent_flags+=("--show-labels")
13699
+    flags+=("--sort-by=")
13700
+    local_nonpersistent_flags+=("--sort-by=")
13701
+    flags+=("--template=")
13702
+    flags_with_completion+=("--template")
13703
+    flags_completion+=("_filedir")
13704
+    local_nonpersistent_flags+=("--template=")
13694 13705
     flags+=("--as=")
13695 13706
     flags+=("--certificate-authority=")
13696 13707
     flags_with_completion+=("--certificate-authority")
... ...
@@ -18257,6 +18270,8 @@ _openshift_cli_set_env()
18257 18257
     local_nonpersistent_flags+=("--from=")
18258 18258
     flags+=("--list")
18259 18259
     local_nonpersistent_flags+=("--list")
18260
+    flags+=("--no-headers")
18261
+    local_nonpersistent_flags+=("--no-headers")
18260 18262
     flags+=("--output=")
18261 18263
     two_word_flags+=("-o")
18262 18264
     local_nonpersistent_flags+=("--output=")
... ...
@@ -18273,6 +18288,17 @@ _openshift_cli_set_env()
18273 18273
     flags+=("--selector=")
18274 18274
     two_word_flags+=("-l")
18275 18275
     local_nonpersistent_flags+=("--selector=")
18276
+    flags+=("--show-all")
18277
+    flags+=("-a")
18278
+    local_nonpersistent_flags+=("--show-all")
18279
+    flags+=("--show-labels")
18280
+    local_nonpersistent_flags+=("--show-labels")
18281
+    flags+=("--sort-by=")
18282
+    local_nonpersistent_flags+=("--sort-by=")
18283
+    flags+=("--template=")
18284
+    flags_with_completion+=("--template")
18285
+    flags_completion+=("_filedir")
18286
+    local_nonpersistent_flags+=("--template=")
18276 18287
     flags+=("--as=")
18277 18288
     flags+=("--certificate-authority=")
18278 18289
     flags_with_completion+=("--certificate-authority")
... ...
@@ -18701,6 +18727,8 @@ _openshift_cli_set_volumes()
18701 18701
     local_nonpersistent_flags+=("--mount-path=")
18702 18702
     flags+=("--name=")
18703 18703
     local_nonpersistent_flags+=("--name=")
18704
+    flags+=("--no-headers")
18705
+    local_nonpersistent_flags+=("--no-headers")
18704 18706
     flags+=("--output=")
18705 18707
     two_word_flags+=("-o")
18706 18708
     local_nonpersistent_flags+=("--output=")
... ...
@@ -18717,8 +18745,19 @@ _openshift_cli_set_volumes()
18717 18717
     flags+=("--selector=")
18718 18718
     two_word_flags+=("-l")
18719 18719
     local_nonpersistent_flags+=("--selector=")
18720
+    flags+=("--show-all")
18721
+    flags+=("-a")
18722
+    local_nonpersistent_flags+=("--show-all")
18723
+    flags+=("--show-labels")
18724
+    local_nonpersistent_flags+=("--show-labels")
18725
+    flags+=("--sort-by=")
18726
+    local_nonpersistent_flags+=("--sort-by=")
18720 18727
     flags+=("--source=")
18721 18728
     local_nonpersistent_flags+=("--source=")
18729
+    flags+=("--template=")
18730
+    flags_with_completion+=("--template")
18731
+    flags_completion+=("_filedir")
18732
+    local_nonpersistent_flags+=("--template=")
18722 18733
     flags+=("--type=")
18723 18734
     two_word_flags+=("-t")
18724 18735
     local_nonpersistent_flags+=("--type=")
... ...
@@ -19077,6 +19116,8 @@ _openshift_cli_volumes()
19077 19077
     local_nonpersistent_flags+=("--mount-path=")
19078 19078
     flags+=("--name=")
19079 19079
     local_nonpersistent_flags+=("--name=")
19080
+    flags+=("--no-headers")
19081
+    local_nonpersistent_flags+=("--no-headers")
19080 19082
     flags+=("--output=")
19081 19083
     two_word_flags+=("-o")
19082 19084
     local_nonpersistent_flags+=("--output=")
... ...
@@ -19093,8 +19134,19 @@ _openshift_cli_volumes()
19093 19093
     flags+=("--selector=")
19094 19094
     two_word_flags+=("-l")
19095 19095
     local_nonpersistent_flags+=("--selector=")
19096
+    flags+=("--show-all")
19097
+    flags+=("-a")
19098
+    local_nonpersistent_flags+=("--show-all")
19099
+    flags+=("--show-labels")
19100
+    local_nonpersistent_flags+=("--show-labels")
19101
+    flags+=("--sort-by=")
19102
+    local_nonpersistent_flags+=("--sort-by=")
19096 19103
     flags+=("--source=")
19097 19104
     local_nonpersistent_flags+=("--source=")
19105
+    flags+=("--template=")
19106
+    flags_with_completion+=("--template")
19107
+    flags_completion+=("_filedir")
19108
+    local_nonpersistent_flags+=("--template=")
19098 19109
     flags+=("--type=")
19099 19110
     two_word_flags+=("-t")
19100 19111
     local_nonpersistent_flags+=("--type=")
... ...
@@ -42,12 +42,19 @@ DEPRECATED: This command has been moved to "oc set env"
42 42
     Display the environment and any changes in the standard format
43 43
 
44 44
 .PP
45
+\fB\-\-no\-headers\fP=false
46
+    When using the default or custom\-column output format, don't print headers.
47
+
48
+.PP
45 49
 \fB\-o\fP, \fB\-\-output\fP=""
46
-    Display the changed objects instead of updating them. One of: json|yaml.
50
+    Output format. One of: json|yaml|wide|name|custom\-columns=...|custom\-columns\-file=...|go\-template=...|go\-template\-file=...|jsonpath=...|jsonpath\-file=... See custom columns [
51
+\[la]http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns\[ra]], golang template [
52
+\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] and jsonpath template [
53
+\[la]http://kubernetes.io/docs/user-guide/jsonpath\[ra]].
47 54
 
48 55
 .PP
49 56
 \fB\-\-output\-version\fP=""
50
-    Output the changed objects with the given version (default api\-version).
57
+    Output the formatted object with the given group version (for ex: 'extensions/v1beta1').
51 58
 
52 59
 .PP
53 60
 \fB\-\-overwrite\fP=true
... ...
@@ -69,6 +76,23 @@ DEPRECATED: This command has been moved to "oc set env"
69 69
 \fB\-l\fP, \fB\-\-selector\fP=""
70 70
     Selector (label query) to filter on
71 71
 
72
+.PP
73
+\fB\-a\fP, \fB\-\-show\-all\fP=true
74
+    When printing, show all resources (false means hide terminated pods.)
75
+
76
+.PP
77
+\fB\-\-show\-labels\fP=false
78
+    When printing, show all labels as the last column (default hide labels column)
79
+
80
+.PP
81
+\fB\-\-sort\-by\fP=""
82
+    If non\-empty, sort list types using this field specification.  The field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
83
+
84
+.PP
85
+\fB\-\-template\fP=""
86
+    Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
87
+\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].
88
+
72 89
 
73 90
 .SH OPTIONS INHERITED FROM PARENT COMMANDS
74 91
 .PP
... ...
@@ -48,12 +48,19 @@ If "\-\-env \-" is passed, environment variables can be read from STDIN using th
48 48
     Display the environment and any changes in the standard format
49 49
 
50 50
 .PP
51
+\fB\-\-no\-headers\fP=false
52
+    When using the default or custom\-column output format, don't print headers.
53
+
54
+.PP
51 55
 \fB\-o\fP, \fB\-\-output\fP=""
52
-    Display the changed objects instead of updating them. One of: json|yaml.
56
+    Output format. One of: json|yaml|wide|name|custom\-columns=...|custom\-columns\-file=...|go\-template=...|go\-template\-file=...|jsonpath=...|jsonpath\-file=... See custom columns [
57
+\[la]http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns\[ra]], golang template [
58
+\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] and jsonpath template [
59
+\[la]http://kubernetes.io/docs/user-guide/jsonpath\[ra]].
53 60
 
54 61
 .PP
55 62
 \fB\-\-output\-version\fP=""
56
-    Output the changed objects with the given version (default api\-version).
63
+    Output the formatted object with the given group version (for ex: 'extensions/v1beta1').
57 64
 
58 65
 .PP
59 66
 \fB\-\-overwrite\fP=true
... ...
@@ -75,6 +82,23 @@ If "\-\-env \-" is passed, environment variables can be read from STDIN using th
75 75
 \fB\-l\fP, \fB\-\-selector\fP=""
76 76
     Selector (label query) to filter on
77 77
 
78
+.PP
79
+\fB\-a\fP, \fB\-\-show\-all\fP=true
80
+    When printing, show all resources (false means hide terminated pods.)
81
+
82
+.PP
83
+\fB\-\-show\-labels\fP=false
84
+    When printing, show all labels as the last column (default hide labels column)
85
+
86
+.PP
87
+\fB\-\-sort\-by\fP=""
88
+    If non\-empty, sort list types using this field specification.  The field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
89
+
90
+.PP
91
+\fB\-\-template\fP=""
92
+    Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
93
+\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].
94
+
78 95
 
79 96
 .SH OPTIONS INHERITED FROM PARENT COMMANDS
80 97
 .PP
... ...
@@ -92,12 +92,19 @@ For descriptions on other volume types, see
92 92
     Name of the volume. If empty, auto generated for add operation
93 93
 
94 94
 .PP
95
+\fB\-\-no\-headers\fP=false
96
+    When using the default or custom\-column output format, don't print headers.
97
+
98
+.PP
95 99
 \fB\-o\fP, \fB\-\-output\fP=""
96
-    Display the changed objects instead of updating them. One of: json|yaml
100
+    Output format. One of: json|yaml|wide|name|custom\-columns=...|custom\-columns\-file=...|go\-template=...|go\-template\-file=...|jsonpath=...|jsonpath\-file=... See custom columns [
101
+\[la]http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns\[ra]], golang template [
102
+\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] and jsonpath template [
103
+\[la]http://kubernetes.io/docs/user-guide/jsonpath\[ra]].
97 104
 
98 105
 .PP
99 106
 \fB\-\-output\-version\fP=""
100
-    Output the changed objects with the given version (default api\-version).
107
+    Output the formatted object with the given group version (for ex: 'extensions/v1beta1').
101 108
 
102 109
 .PP
103 110
 \fB\-\-overwrite\fP=false
... ...
@@ -120,10 +127,27 @@ For descriptions on other volume types, see
120 120
     Selector (label query) to filter on
121 121
 
122 122
 .PP
123
+\fB\-a\fP, \fB\-\-show\-all\fP=true
124
+    When printing, show all resources (false means hide terminated pods.)
125
+
126
+.PP
127
+\fB\-\-show\-labels\fP=false
128
+    When printing, show all labels as the last column (default hide labels column)
129
+
130
+.PP
131
+\fB\-\-sort\-by\fP=""
132
+    If non\-empty, sort list types using this field specification.  The field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
133
+
134
+.PP
123 135
 \fB\-\-source\fP=""
124 136
     Details of volume source as json string. This can be used if the required volume type is not supported by \-\-type option. (e.g.: '{"gitRepo": {"repository": <git-url>, "revision": <commit-hash>}}')
125 137
 
126 138
 .PP
139
+\fB\-\-template\fP=""
140
+    Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
141
+\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].
142
+
143
+.PP
127 144
 \fB\-t\fP, \fB\-\-type\fP=""
128 145
     Type of the volume source for add operation. Supported options: emptyDir, hostPath, secret, configmap, persistentVolumeClaim
129 146
 
... ...
@@ -66,12 +66,19 @@ DEPRECATED: This command has been moved to "oc set volume"
66 66
     Name of the volume. If empty, auto generated for add operation
67 67
 
68 68
 .PP
69
+\fB\-\-no\-headers\fP=false
70
+    When using the default or custom\-column output format, don't print headers.
71
+
72
+.PP
69 73
 \fB\-o\fP, \fB\-\-output\fP=""
70
-    Display the changed objects instead of updating them. One of: json|yaml
74
+    Output format. One of: json|yaml|wide|name|custom\-columns=...|custom\-columns\-file=...|go\-template=...|go\-template\-file=...|jsonpath=...|jsonpath\-file=... See custom columns [
75
+\[la]http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns\[ra]], golang template [
76
+\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] and jsonpath template [
77
+\[la]http://kubernetes.io/docs/user-guide/jsonpath\[ra]].
71 78
 
72 79
 .PP
73 80
 \fB\-\-output\-version\fP=""
74
-    Output the changed objects with the given version (default api\-version).
81
+    Output the formatted object with the given group version (for ex: 'extensions/v1beta1').
75 82
 
76 83
 .PP
77 84
 \fB\-\-overwrite\fP=false
... ...
@@ -94,10 +101,27 @@ DEPRECATED: This command has been moved to "oc set volume"
94 94
     Selector (label query) to filter on
95 95
 
96 96
 .PP
97
+\fB\-a\fP, \fB\-\-show\-all\fP=true
98
+    When printing, show all resources (false means hide terminated pods.)
99
+
100
+.PP
101
+\fB\-\-show\-labels\fP=false
102
+    When printing, show all labels as the last column (default hide labels column)
103
+
104
+.PP
105
+\fB\-\-sort\-by\fP=""
106
+    If non\-empty, sort list types using this field specification.  The field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
107
+
108
+.PP
97 109
 \fB\-\-source\fP=""
98 110
     Details of volume source as json string. This can be used if the required volume type is not supported by \-\-type option. (e.g.: '{"gitRepo": {"repository": <git-url>, "revision": <commit-hash>}}')
99 111
 
100 112
 .PP
113
+\fB\-\-template\fP=""
114
+    Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
115
+\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].
116
+
117
+.PP
101 118
 \fB\-t\fP, \fB\-\-type\fP=""
102 119
     Type of the volume source for add operation. Supported options: emptyDir, hostPath, secret, configmap, persistentVolumeClaim
103 120
 
... ...
@@ -42,12 +42,19 @@ DEPRECATED: This command has been moved to "openshift cli set env"
42 42
     Display the environment and any changes in the standard format
43 43
 
44 44
 .PP
45
+\fB\-\-no\-headers\fP=false
46
+    When using the default or custom\-column output format, don't print headers.
47
+
48
+.PP
45 49
 \fB\-o\fP, \fB\-\-output\fP=""
46
-    Display the changed objects instead of updating them. One of: json|yaml.
50
+    Output format. One of: json|yaml|wide|name|custom\-columns=...|custom\-columns\-file=...|go\-template=...|go\-template\-file=...|jsonpath=...|jsonpath\-file=... See custom columns [
51
+\[la]http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns\[ra]], golang template [
52
+\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] and jsonpath template [
53
+\[la]http://kubernetes.io/docs/user-guide/jsonpath\[ra]].
47 54
 
48 55
 .PP
49 56
 \fB\-\-output\-version\fP=""
50
-    Output the changed objects with the given version (default api\-version).
57
+    Output the formatted object with the given group version (for ex: 'extensions/v1beta1').
51 58
 
52 59
 .PP
53 60
 \fB\-\-overwrite\fP=true
... ...
@@ -69,6 +76,23 @@ DEPRECATED: This command has been moved to "openshift cli set env"
69 69
 \fB\-l\fP, \fB\-\-selector\fP=""
70 70
     Selector (label query) to filter on
71 71
 
72
+.PP
73
+\fB\-a\fP, \fB\-\-show\-all\fP=true
74
+    When printing, show all resources (false means hide terminated pods.)
75
+
76
+.PP
77
+\fB\-\-show\-labels\fP=false
78
+    When printing, show all labels as the last column (default hide labels column)
79
+
80
+.PP
81
+\fB\-\-sort\-by\fP=""
82
+    If non\-empty, sort list types using this field specification.  The field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
83
+
84
+.PP
85
+\fB\-\-template\fP=""
86
+    Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
87
+\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].
88
+
72 89
 
73 90
 .SH OPTIONS INHERITED FROM PARENT COMMANDS
74 91
 .PP
... ...
@@ -48,12 +48,19 @@ If "\-\-env \-" is passed, environment variables can be read from STDIN using th
48 48
     Display the environment and any changes in the standard format
49 49
 
50 50
 .PP
51
+\fB\-\-no\-headers\fP=false
52
+    When using the default or custom\-column output format, don't print headers.
53
+
54
+.PP
51 55
 \fB\-o\fP, \fB\-\-output\fP=""
52
-    Display the changed objects instead of updating them. One of: json|yaml.
56
+    Output format. One of: json|yaml|wide|name|custom\-columns=...|custom\-columns\-file=...|go\-template=...|go\-template\-file=...|jsonpath=...|jsonpath\-file=... See custom columns [
57
+\[la]http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns\[ra]], golang template [
58
+\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] and jsonpath template [
59
+\[la]http://kubernetes.io/docs/user-guide/jsonpath\[ra]].
53 60
 
54 61
 .PP
55 62
 \fB\-\-output\-version\fP=""
56
-    Output the changed objects with the given version (default api\-version).
63
+    Output the formatted object with the given group version (for ex: 'extensions/v1beta1').
57 64
 
58 65
 .PP
59 66
 \fB\-\-overwrite\fP=true
... ...
@@ -75,6 +82,23 @@ If "\-\-env \-" is passed, environment variables can be read from STDIN using th
75 75
 \fB\-l\fP, \fB\-\-selector\fP=""
76 76
     Selector (label query) to filter on
77 77
 
78
+.PP
79
+\fB\-a\fP, \fB\-\-show\-all\fP=true
80
+    When printing, show all resources (false means hide terminated pods.)
81
+
82
+.PP
83
+\fB\-\-show\-labels\fP=false
84
+    When printing, show all labels as the last column (default hide labels column)
85
+
86
+.PP
87
+\fB\-\-sort\-by\fP=""
88
+    If non\-empty, sort list types using this field specification.  The field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
89
+
90
+.PP
91
+\fB\-\-template\fP=""
92
+    Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
93
+\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].
94
+
78 95
 
79 96
 .SH OPTIONS INHERITED FROM PARENT COMMANDS
80 97
 .PP
... ...
@@ -92,12 +92,19 @@ For descriptions on other volume types, see
92 92
     Name of the volume. If empty, auto generated for add operation
93 93
 
94 94
 .PP
95
+\fB\-\-no\-headers\fP=false
96
+    When using the default or custom\-column output format, don't print headers.
97
+
98
+.PP
95 99
 \fB\-o\fP, \fB\-\-output\fP=""
96
-    Display the changed objects instead of updating them. One of: json|yaml
100
+    Output format. One of: json|yaml|wide|name|custom\-columns=...|custom\-columns\-file=...|go\-template=...|go\-template\-file=...|jsonpath=...|jsonpath\-file=... See custom columns [
101
+\[la]http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns\[ra]], golang template [
102
+\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] and jsonpath template [
103
+\[la]http://kubernetes.io/docs/user-guide/jsonpath\[ra]].
97 104
 
98 105
 .PP
99 106
 \fB\-\-output\-version\fP=""
100
-    Output the changed objects with the given version (default api\-version).
107
+    Output the formatted object with the given group version (for ex: 'extensions/v1beta1').
101 108
 
102 109
 .PP
103 110
 \fB\-\-overwrite\fP=false
... ...
@@ -120,10 +127,27 @@ For descriptions on other volume types, see
120 120
     Selector (label query) to filter on
121 121
 
122 122
 .PP
123
+\fB\-a\fP, \fB\-\-show\-all\fP=true
124
+    When printing, show all resources (false means hide terminated pods.)
125
+
126
+.PP
127
+\fB\-\-show\-labels\fP=false
128
+    When printing, show all labels as the last column (default hide labels column)
129
+
130
+.PP
131
+\fB\-\-sort\-by\fP=""
132
+    If non\-empty, sort list types using this field specification.  The field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
133
+
134
+.PP
123 135
 \fB\-\-source\fP=""
124 136
     Details of volume source as json string. This can be used if the required volume type is not supported by \-\-type option. (e.g.: '{"gitRepo": {"repository": <git-url>, "revision": <commit-hash>}}')
125 137
 
126 138
 .PP
139
+\fB\-\-template\fP=""
140
+    Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
141
+\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].
142
+
143
+.PP
127 144
 \fB\-t\fP, \fB\-\-type\fP=""
128 145
     Type of the volume source for add operation. Supported options: emptyDir, hostPath, secret, configmap, persistentVolumeClaim
129 146
 
... ...
@@ -66,12 +66,19 @@ DEPRECATED: This command has been moved to "openshift cli set volume"
66 66
     Name of the volume. If empty, auto generated for add operation
67 67
 
68 68
 .PP
69
+\fB\-\-no\-headers\fP=false
70
+    When using the default or custom\-column output format, don't print headers.
71
+
72
+.PP
69 73
 \fB\-o\fP, \fB\-\-output\fP=""
70
-    Display the changed objects instead of updating them. One of: json|yaml
74
+    Output format. One of: json|yaml|wide|name|custom\-columns=...|custom\-columns\-file=...|go\-template=...|go\-template\-file=...|jsonpath=...|jsonpath\-file=... See custom columns [
75
+\[la]http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns\[ra]], golang template [
76
+\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] and jsonpath template [
77
+\[la]http://kubernetes.io/docs/user-guide/jsonpath\[ra]].
71 78
 
72 79
 .PP
73 80
 \fB\-\-output\-version\fP=""
74
-    Output the changed objects with the given version (default api\-version).
81
+    Output the formatted object with the given group version (for ex: 'extensions/v1beta1').
75 82
 
76 83
 .PP
77 84
 \fB\-\-overwrite\fP=false
... ...
@@ -94,10 +101,27 @@ DEPRECATED: This command has been moved to "openshift cli set volume"
94 94
     Selector (label query) to filter on
95 95
 
96 96
 .PP
97
+\fB\-a\fP, \fB\-\-show\-all\fP=true
98
+    When printing, show all resources (false means hide terminated pods.)
99
+
100
+.PP
101
+\fB\-\-show\-labels\fP=false
102
+    When printing, show all labels as the last column (default hide labels column)
103
+
104
+.PP
105
+\fB\-\-sort\-by\fP=""
106
+    If non\-empty, sort list types using this field specification.  The field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
107
+
108
+.PP
97 109
 \fB\-\-source\fP=""
98 110
     Details of volume source as json string. This can be used if the required volume type is not supported by \-\-type option. (e.g.: '{"gitRepo": {"repository": <git-url>, "revision": <commit-hash>}}')
99 111
 
100 112
 .PP
113
+\fB\-\-template\fP=""
114
+    Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
115
+\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].
116
+
117
+.PP
101 118
 \fB\-t\fP, \fB\-\-type\fP=""
102 119
     Type of the volume source for add operation. Supported options: emptyDir, hostPath, secret, configmap, persistentVolumeClaim
103 120
 
... ...
@@ -67,7 +67,7 @@ type BuildHookOptions struct {
67 67
 	ShortOutput bool
68 68
 	Mapper      meta.RESTMapper
69 69
 
70
-	PrintObject func(runtime.Object) error
70
+	PrintObject func([]*resource.Info) error
71 71
 
72 72
 	Script     string
73 73
 	Entrypoint bool
... ...
@@ -154,7 +154,9 @@ func (o *BuildHookOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command, ar
154 154
 
155 155
 	output := kcmdutil.GetFlagString(cmd, "output")
156 156
 	if len(output) != 0 {
157
-		o.PrintObject = func(obj runtime.Object) error { return f.PrintObject(cmd, mapper, obj, o.Out) }
157
+		o.PrintObject = func(infos []*resource.Info) error {
158
+			return f.PrintResourceInfos(cmd, infos, o.Out)
159
+		}
158 160
 	}
159 161
 
160 162
 	o.Encoder = f.JSONEncoder()
... ...
@@ -216,11 +218,7 @@ func (o *BuildHookOptions) Run() error {
216 216
 	}
217 217
 
218 218
 	if o.PrintObject != nil {
219
-		object, err := resource.AsVersionedObject(infos, !singular, o.OutputVersion, kapi.Codecs.LegacyCodec(o.OutputVersion))
220
-		if err != nil {
221
-			return err
222
-		}
223
-		return o.PrintObject(object)
219
+		return o.PrintObject(infos)
224 220
 	}
225 221
 
226 222
 	failed := false
... ...
@@ -66,7 +66,7 @@ type BuildSecretOptions struct {
66 66
 	Local       bool
67 67
 	Mapper      meta.RESTMapper
68 68
 
69
-	PrintObject func(runtime.Object) error
69
+	PrintObject func([]*resource.Info) error
70 70
 
71 71
 	Secret string
72 72
 	Push   bool
... ...
@@ -195,8 +195,10 @@ func (o *BuildSecretOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command,
195 195
 	}
196 196
 
197 197
 	output := kcmdutil.GetFlagString(cmd, "output")
198
-	if len(output) != 0 || o.Local {
199
-		o.PrintObject = func(obj runtime.Object) error { return f.PrintObject(cmd, mapper, obj, o.Out) }
198
+	if len(output) > 0 || o.Local {
199
+		o.PrintObject = func(infos []*resource.Info) error {
200
+			return f.PrintResourceInfos(cmd, infos, o.Out)
201
+		}
200 202
 	}
201 203
 
202 204
 	o.Encoder = f.JSONEncoder()
... ...
@@ -239,11 +241,7 @@ func (o *BuildSecretOptions) Run() error {
239 239
 	}
240 240
 
241 241
 	if o.PrintObject != nil {
242
-		object, err := resource.AsVersionedObject(infos, !singular, o.OutputVersion, kapi.Codecs.LegacyCodec(o.OutputVersion))
243
-		if err != nil {
244
-			return err
245
-		}
246
-		return o.PrintObject(object)
242
+		return o.PrintObject(infos)
247 243
 	}
248 244
 
249 245
 	errs := []error{}
... ...
@@ -74,7 +74,7 @@ type DeploymentHookOptions struct {
74 74
 	Local       bool
75 75
 	Mapper      meta.RESTMapper
76 76
 
77
-	PrintObject func(runtime.Object) error
77
+	PrintObject func([]*resource.Info) error
78 78
 
79 79
 	Pre    bool
80 80
 	Mid    bool
... ...
@@ -177,7 +177,9 @@ func (o *DeploymentHookOptions) Complete(f *clientcmd.Factory, cmd *cobra.Comman
177 177
 
178 178
 	output := kcmdutil.GetFlagString(cmd, "output")
179 179
 	if len(output) != 0 || o.Local {
180
-		o.PrintObject = func(obj runtime.Object) error { return f.PrintObject(cmd, mapper, obj, o.Out) }
180
+		o.PrintObject = func(infos []*resource.Info) error {
181
+			return f.PrintResourceInfos(cmd, infos, o.Out)
182
+		}
181 183
 	}
182 184
 
183 185
 	o.Encoder = f.JSONEncoder()
... ...
@@ -261,11 +263,7 @@ func (o *DeploymentHookOptions) Run() error {
261 261
 	}
262 262
 
263 263
 	if o.PrintObject != nil {
264
-		object, err := resource.AsVersionedObject(infos, !singular, o.OutputVersion, kapi.Codecs.LegacyCodec(o.OutputVersion))
265
-		if err != nil {
266
-			return err
267
-		}
268
-		return o.PrintObject(object)
264
+		return o.PrintObject(infos)
269 265
 	}
270 266
 
271 267
 	failed := false
... ...
@@ -12,9 +12,7 @@ import (
12 12
 
13 13
 	"github.com/spf13/cobra"
14 14
 	kapi "k8s.io/kubernetes/pkg/api"
15
-	"k8s.io/kubernetes/pkg/api/unversioned"
16 15
 	"k8s.io/kubernetes/pkg/fieldpath"
17
-	"k8s.io/kubernetes/pkg/kubectl"
18 16
 	kcmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
19 17
 	"k8s.io/kubernetes/pkg/kubectl/resource"
20 18
 	"k8s.io/kubernetes/pkg/runtime"
... ...
@@ -101,8 +99,8 @@ func NewCmdEnv(fullName string, f *clientcmd.Factory, in io.Reader, out, errout
101 101
 	cmd.Flags().StringSliceVarP(&filenames, "filename", "f", filenames, "Filename, directory, or URL to file to use to edit the resource.")
102 102
 	cmd.Flags().Bool("overwrite", true, "If true, allow environment to be overwritten, otherwise reject updates that overwrite existing environment.")
103 103
 	cmd.Flags().String("resource-version", "", "If non-empty, the labels update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource.")
104
-	cmd.Flags().StringP("output", "o", "", "Display the changed objects instead of updating them. One of: json|yaml.")
105
-	cmd.Flags().String("output-version", "", "Output the changed objects with the given version (default api-version).")
104
+
105
+	kcmdutil.AddPrinterFlags(cmd)
106 106
 
107 107
 	cmd.MarkFlagFilename("filename", "yaml", "yml", "json")
108 108
 
... ...
@@ -476,37 +474,8 @@ func RunEnv(f *clientcmd.Factory, in io.Reader, out, errout io.Writer, cmd *cobr
476 476
 		return nil
477 477
 	}
478 478
 
479
-	if len(outputFormat) != 0 {
480
-		outputVersion, err := kcmdutil.OutputVersion(cmd, clientConfig.GroupVersion)
481
-		if err != nil {
482
-			return err
483
-		}
484
-		objects, err := resource.AsVersionedObjects(infos, outputVersion, kapi.Codecs.LegacyCodec(outputVersion))
485
-		if err != nil {
486
-			return err
487
-		}
488
-		if len(objects) != len(infos) {
489
-			return fmt.Errorf("could not convert all objects to API version %q", outputVersion)
490
-		}
491
-		p, _, err := kubectl.GetPrinter(outputFormat, "", false)
492
-		if err != nil {
493
-			return err
494
-		}
495
-
496
-		resourceList := &kapi.List{
497
-			TypeMeta: unversioned.TypeMeta{
498
-				Kind:       "List",
499
-				APIVersion: outputVersion.Version,
500
-			},
501
-			ListMeta: unversioned.ListMeta{},
502
-			Items:    objects,
503
-		}
504
-
505
-		if err := p.PrintObj(resourceList, out); err != nil {
506
-			return err
507
-		}
508
-
509
-		return nil
479
+	if len(outputFormat) > 0 {
480
+		return f.PrintResourceInfos(cmd, infos, out)
510 481
 	}
511 482
 
512 483
 	objects, err := resource.AsVersionedObjects(infos, gv, kapi.Codecs.LegacyCodec(gv))
... ...
@@ -83,7 +83,7 @@ type ProbeOptions struct {
83 83
 	Mapper        meta.RESTMapper
84 84
 	OutputVersion unversioned.GroupVersion
85 85
 
86
-	PrintObject            func(runtime.Object) error
86
+	PrintObject            func([]*resource.Info) error
87 87
 	UpdatePodSpecForObject func(runtime.Object, func(spec *kapi.PodSpec) error) (bool, error)
88 88
 
89 89
 	Readiness bool
... ...
@@ -194,8 +194,10 @@ func (o *ProbeOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command, args [
194 194
 		Flatten()
195 195
 
196 196
 	output := kcmdutil.GetFlagString(cmd, "output")
197
-	if len(output) != 0 {
198
-		o.PrintObject = func(obj runtime.Object) error { return f.PrintObject(cmd, mapper, obj, o.Out) }
197
+	if len(output) > 0 {
198
+		o.PrintObject = func(infos []*resource.Info) error {
199
+			return f.PrintResourceInfos(cmd, infos, o.Out)
200
+		}
199 201
 	}
200 202
 
201 203
 	o.Encoder = f.JSONEncoder()
... ...
@@ -318,11 +320,7 @@ func (o *ProbeOptions) Run() error {
318 318
 	}
319 319
 
320 320
 	if o.PrintObject != nil {
321
-		object, err := resource.AsVersionedObject(infos, !singular, o.OutputVersion, kapi.Codecs.LegacyCodec(o.OutputVersion))
322
-		if err != nil {
323
-			return err
324
-		}
325
-		return o.PrintObject(object)
321
+		return o.PrintObject(infos)
326 322
 	}
327 323
 
328 324
 	failed := false
... ...
@@ -86,7 +86,7 @@ type TriggersOptions struct {
86 86
 	OutputVersion unversioned.GroupVersion
87 87
 
88 88
 	PrintTable  bool
89
-	PrintObject func(runtime.Object) error
89
+	PrintObject func([]*resource.Info) error
90 90
 
91 91
 	Remove    bool
92 92
 	RemoveAll bool
... ...
@@ -210,8 +210,10 @@ func (o *TriggersOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command, arg
210 210
 		Flatten()
211 211
 
212 212
 	output := kcmdutil.GetFlagString(cmd, "output")
213
-	if len(output) != 0 {
214
-		o.PrintObject = func(obj runtime.Object) error { return f.PrintObject(cmd, mapper, obj, o.Out) }
213
+	if len(output) > 0 {
214
+		o.PrintObject = func(infos []*resource.Info) error {
215
+			return f.PrintResourceInfos(cmd, infos, o.Out)
216
+		}
215 217
 	}
216 218
 
217 219
 	o.Encoder = f.JSONEncoder()
... ...
@@ -286,11 +288,7 @@ func (o *TriggersOptions) Run() error {
286 286
 		return fmt.Errorf("%s/%s is not a deployment config or build config", infos[0].Mapping.Resource, infos[0].Name)
287 287
 	}
288 288
 	if o.PrintObject != nil {
289
-		object, err := resource.AsVersionedObject(infos, !singular, o.OutputVersion, kapi.Codecs.LegacyCodec(o.OutputVersion))
290
-		if err != nil {
291
-			return err
292
-		}
293
-		return o.PrintObject(object)
289
+		return o.PrintObject(infos)
294 290
 	}
295 291
 
296 292
 	failed := false
... ...
@@ -18,7 +18,6 @@ import (
18 18
 	kresource "k8s.io/kubernetes/pkg/api/resource"
19 19
 	"k8s.io/kubernetes/pkg/api/unversioned"
20 20
 	kclient "k8s.io/kubernetes/pkg/client/unversioned"
21
-	"k8s.io/kubernetes/pkg/kubectl"
22 21
 	kcmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
23 22
 	"k8s.io/kubernetes/pkg/kubectl/resource"
24 23
 	"k8s.io/kubernetes/pkg/labels"
... ...
@@ -117,6 +116,7 @@ type VolumeOptions struct {
117 117
 	Containers    string
118 118
 	Confirm       bool
119 119
 	Output        string
120
+	PrintObject   func([]*resource.Info) error
120 121
 	OutputVersion unversioned.GroupVersion
121 122
 
122 123
 	// Add op params
... ...
@@ -152,7 +152,7 @@ func NewCmdVolume(fullName string, f *clientcmd.Factory, out, errOut io.Writer)
152 152
 		Run: func(cmd *cobra.Command, args []string) {
153 153
 			addOpts.TypeChanged = cmd.Flag("type").Changed
154 154
 
155
-			err := opts.Validate(args)
155
+			err := opts.Validate(cmd, args)
156 156
 			if err != nil {
157 157
 				kcmdutil.CheckErr(kcmdutil.UsageError(cmd, err.Error()))
158 158
 			}
... ...
@@ -176,8 +176,6 @@ func NewCmdVolume(fullName string, f *clientcmd.Factory, out, errOut io.Writer)
176 176
 	cmd.Flags().StringVar(&opts.Name, "name", "", "Name of the volume. If empty, auto generated for add operation")
177 177
 	cmd.Flags().StringVarP(&opts.Containers, "containers", "c", "*", "The names of containers in the selected pod templates to change - may use wildcards")
178 178
 	cmd.Flags().BoolVar(&opts.Confirm, "confirm", false, "Confirm that you really want to remove multiple volumes")
179
-	cmd.Flags().StringVarP(&opts.Output, "output", "o", "", "Display the changed objects instead of updating them. One of: json|yaml")
180
-	cmd.Flags().String("output-version", "", "Output the changed objects with the given version (default api-version).")
181 179
 
182 180
 	cmd.Flags().StringVarP(&addOpts.Type, "type", "t", "", "Type of the volume source for add operation. Supported options: emptyDir, hostPath, secret, configmap, persistentVolumeClaim")
183 181
 	cmd.Flags().StringVarP(&addOpts.MountPath, "mount-path", "m", "", "Mount path inside the container. Optional param for --add or --remove")
... ...
@@ -190,6 +188,7 @@ func NewCmdVolume(fullName string, f *clientcmd.Factory, out, errOut io.Writer)
190 190
 	cmd.Flags().StringVar(&addOpts.ClaimMode, "claim-mode", "ReadWriteOnce", "Set the access mode of the claim to be created. Valid values are ReadWriteOnce (rwo), ReadWriteMany (rwm), or ReadOnlyMany (rom)")
191 191
 	cmd.Flags().StringVar(&addOpts.Source, "source", "", "Details of volume source as json string. This can be used if the required volume type is not supported by --type option. (e.g.: '{\"gitRepo\": {\"repository\": <git-url>, \"revision\": <commit-hash>}}')")
192 192
 
193
+	kcmdutil.AddPrinterFlags(cmd)
193 194
 	cmd.MarkFlagFilename("filename", "yaml", "yml", "json")
194 195
 
195 196
 	// deprecate --list option
... ...
@@ -198,7 +197,7 @@ func NewCmdVolume(fullName string, f *clientcmd.Factory, out, errOut io.Writer)
198 198
 	return cmd
199 199
 }
200 200
 
201
-func (v *VolumeOptions) Validate(args []string) error {
201
+func (v *VolumeOptions) Validate(cmd *cobra.Command, args []string) error {
202 202
 	if len(v.Selector) > 0 {
203 203
 		if _, err := labels.Parse(v.Selector); err != nil {
204 204
 			return errors.New("--selector=<selector> must be a valid label selector")
... ...
@@ -229,7 +228,8 @@ func (v *VolumeOptions) Validate(args []string) error {
229 229
 		return errors.New("you may only specify one operation at a time")
230 230
 	}
231 231
 
232
-	if v.List && len(v.Output) > 0 {
232
+	output := kcmdutil.GetFlagString(cmd, "output")
233
+	if v.List && len(output) > 0 {
233 234
 		return errors.New("--list and --output may not be specified together")
234 235
 	}
235 236
 
... ...
@@ -341,6 +341,13 @@ func (v *VolumeOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command, out,
341 341
 	}
342 342
 	mapper, typer := f.Object(false)
343 343
 
344
+	v.Output = kcmdutil.GetFlagString(cmd, "output")
345
+	if len(v.Output) > 0 {
346
+		v.PrintObject = func(infos []*resource.Info) error {
347
+			return f.PrintResourceInfos(cmd, infos, v.Out)
348
+		}
349
+	}
350
+
344 351
 	v.DefaultNamespace = cmdNamespace
345 352
 	v.ExplicitNamespace = explicit
346 353
 	v.Out = out
... ...
@@ -431,18 +438,8 @@ func (v *VolumeOptions) RunVolume(args []string) error {
431 431
 	if patchError != nil {
432 432
 		return patchError
433 433
 	}
434
-
435
-	objects, err := resource.AsVersionedObject(infos, false, v.OutputVersion, kapi.Codecs.LegacyCodec(v.OutputVersion))
436
-	if err != nil {
437
-		return err
438
-	}
439
-
440
-	if len(v.Output) != 0 {
441
-		p, _, err := kubectl.GetPrinter(v.Output, "", false)
442
-		if err != nil {
443
-			return err
444
-		}
445
-		return p.PrintObj(objects, v.Out)
434
+	if v.PrintObject != nil {
435
+		return v.PrintObject(infos)
446 436
 	}
447 437
 
448 438
 	failed := false
... ...
@@ -17,6 +17,7 @@ import (
17 17
 	"github.com/blang/semver"
18 18
 	"github.com/emicklei/go-restful/swagger"
19 19
 	"github.com/golang/glog"
20
+	"github.com/spf13/cobra"
20 21
 	"github.com/spf13/pflag"
21 22
 
22 23
 	"k8s.io/kubernetes/pkg/api"
... ...
@@ -164,6 +165,8 @@ type Factory struct {
164 164
 	clients               *clientCache
165 165
 
166 166
 	ImageResolutionOptions FlagBinder
167
+
168
+	PrintResourceInfos func(*cobra.Command, []*resource.Info, io.Writer) error
167 169
 }
168 170
 
169 171
 func DefaultGenerators(cmdName string) map[string]kubectl.Generator {
... ...
@@ -487,6 +490,42 @@ func NewFactory(clientConfig kclientcmd.ClientConfig) *Factory {
487 487
 		}
488 488
 		return describe.NewHumanReadablePrinter(options), nil
489 489
 	}
490
+	// PrintResourceInfos receives a list of resource infos and prints versioned objects if a generic output format was specified
491
+	// otherwise, it iterates through info objects, printing each resource with a unique printer for its mapping
492
+	w.PrintResourceInfos = func(cmd *cobra.Command, infos []*resource.Info, out io.Writer) error {
493
+		printer, generic, err := cmdutil.PrinterForCommand(cmd)
494
+		if err != nil {
495
+			return nil
496
+		}
497
+		if !generic {
498
+			for _, info := range infos {
499
+				mapping := info.ResourceMapping()
500
+				printer, err := w.PrinterForMapping(cmd, mapping, false)
501
+				if err != nil {
502
+					return err
503
+				}
504
+				if err := printer.PrintObj(info.Object, out); err != nil {
505
+					return nil
506
+				}
507
+			}
508
+			return nil
509
+		}
510
+
511
+		clientConfig, err := w.ClientConfig()
512
+		if err != nil {
513
+			return err
514
+		}
515
+		outputVersion, err := cmdutil.OutputVersion(cmd, clientConfig.GroupVersion)
516
+		if err != nil {
517
+			return err
518
+		}
519
+		object, err := resource.AsVersionedObject(infos, len(infos) != 1, outputVersion, api.Codecs.LegacyCodec(outputVersion))
520
+		if err != nil {
521
+			return err
522
+		}
523
+		return printer.PrintObj(object, out)
524
+
525
+	}
490 526
 	kCanBeExposed := w.Factory.CanBeExposed
491 527
 	w.CanBeExposed = func(kind unversioned.GroupKind) error {
492 528
 		if kind == deployapi.Kind("DeploymentConfig") {
... ...
@@ -13,5 +13,13 @@ os::cmd::expect_success_and_not_text 'oc get is' 'is/test1'
13 13
 os::cmd::expect_success 'oc create -f examples/sample-app/application-template-custombuild.json'
14 14
 os::cmd::expect_success_and_text 'oc new-app ruby-helloworld-sample' 'deploymentconfig "frontend" created'
15 15
 os::cmd::expect_success_and_text 'oc get all --all-namespaces' 'cmd-printer[\ ]+bc\/ruby\-sample\-build'
16
+
17
+# Test that infos printer supports all outputFormat options
18
+os::cmd::expect_success_and_text 'oc new-app node -o yaml | oc set env -f - MYVAR=value' 'deploymentconfig "node" updated'
19
+os::cmd::expect_success 'oc new-app node -o yaml | oc set env -f - MYVAR=value -o custom-colums="NAME:.metadata.name"'
20
+os::cmd::expect_success_and_text 'oc new-app node -o yaml | oc set env -f - MYVAR=value -o yaml' 'apiVersion: v1'
21
+os::cmd::expect_success_and_text 'oc new-app node -o yaml | oc set env -f - MYVAR=value -o json' '"apiVersion": "v1"'
22
+os::cmd::expect_success_and_text 'oc new-app node -o yaml | oc set env -f - MYVAR=value -o wide' 'node'
23
+os::cmd::expect_success_and_text 'oc new-app node -o yaml | oc set env -f - MYVAR=value -o name' 'deploymentconfig/node'
16 24
 echo "resource printer: ok"
17 25
 os::test::junit::declare_suite_end
18 26
\ No newline at end of file