-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy path_prototool
1000 lines (978 loc) · 56.9 KB
/
_prototool
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#compdef prototool
# -----------------------------------------------------------------------------
# The BSD-3-Clause License
#
# Copyright (c) 2018, Koichi Shiraishi
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of que nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# -----------------------------------------------------------------------------
#
# github.com/uber/prototool
#
# -----------------------------------------------------------------------------
#
# Usage:
# prototool [command]
#
# Available Commands:
# all Compile, then format and overwrite, then re-compile and generate, then lint, stopping if any step fails.
# break Top-level command for breaking change commands.
# cache Interact with the cache.
# compile Compile with protoc to check for failures.
# config Interact with configuration files.
# create Create the given Protobuf files according to a template that passes default prototool lint.
# files Print all files that match the input arguments.
# format Format a proto file and compile with protoc to check for failures.
# generate Generate with protoc.
# grpc Call a gRPC endpoint. Be sure to set the required flags address, method, and either data or stdin.
# help Help about any command
# inspect Top-level command for inspection commands.
# lint Lint proto files and compile with protoc to check for failures.
# version Print the version.
#
# Flags:
# --debug Run in debug mode, which will print out debug logging.
# -h, --help help for prototool
#
# Use "prototool [command] --help" for more information about a command.
#
# -----------------------------------------------------------------------------
#
# Compile, then format and overwrite, then re-compile and generate, then lint, stopping if any step fails.
#
# Usage:
# prototool all [dirOrFile] [flags]
#
# Flags:
# --cache-path string The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.
# --config-data string The configuration data to use instead of reading prototool.yaml or prototool.json files.
# This will act as if there is a configuration file with the given data in the current directory, and no other configuration files recursively.
# This is an advanced feature and is not recommended to be generally used.
# --disable-format Do not run formatting.
# --disable-lint Do not run linting.
# --error-format string The colon-separated fields to print out on error. Valid values are "filename:line:column:id:message". (default "filename:line:column:message")
# -f, --fix Fix the file according to the Style Guide.
# -h, --help help for all
# --json Output as JSON.
# --protoc-bin-path string The path to the protoc binary. Setting this option will ignore the config protoc.version setting. This flag must be used with protoc-wkt-path and must not be used with the protoc-url flag.
# --protoc-url string The url to use to download the protoc zip file, otherwise uses GitHub Releases. Setting this option will ignore the config protoc.version setting.
# --protoc-wkt-path string The path to the well-known types. Setting this option will ignore the config protoc.version setting. This flag must be used with protoc-bin-path and must not be used with the protoc-url flag.
#
# Global Flags:
# --debug Run in debug mode, which will print out debug logging.
#
# -----------------------------------------------------------------------------
#
# Top-level command for breaking change commands.
#
# Usage:
# prototool break [command]
#
# Available Commands:
# check Check for breaking changes.
#
# Flags:
# -h, --help help for break
#
# Global Flags:
# --debug Run in debug mode, which will print out debug logging.
#
# Use "prototool break [command] --help" for more information about a command.
#
# -----------------------------------------------------------------------------
#
# Check for breaking changes.
#
# This command must be run from the root of a git repository.
#
# The input directory must be relative.
#
# Usage:
# prototool break check [dir] [flags]
#
# Flags:
# --allow-beta-deps Allow stable packages to depend on beta packages. This is implicitly set if --include-beta is set.
# --cache-path string The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.
# --config-data string The configuration data to use instead of reading prototool.yaml or prototool.json files.
# This will act as if there is a configuration file with the given data in the current directory, and no other configuration files recursively.
# This is an advanced feature and is not recommended to be generally used.
# --git-branch string The git branch to check against. The default is the default branch.
# --git-tag string The git tag to check against. The default is to not use tags and use the default branch.
# -h, --help help for check
# --include-beta Include beta packages in breaking change detection.
# --json Output as JSON.
# --protoc-bin-path string The path to the protoc binary. Setting this option will ignore the config protoc.version setting. This flag must be used with protoc-wkt-path and must not be used with the protoc-url flag.
# --protoc-url string The url to use to download the protoc zip file, otherwise uses GitHub Releases. Setting this option will ignore the config protoc.version setting.
# --protoc-wkt-path string The path to the well-known types. Setting this option will ignore the config protoc.version setting. This flag must be used with protoc-bin-path and must not be used with the protoc-url flag.
#
# Global Flags:
# --debug Run in debug mode, which will print out debug logging.
#
# -----------------------------------------------------------------------------
#
# Interact with the cache.
#
# Usage:
# prototool cache [command]
#
# Available Commands:
# delete Delete all artifacts in the default cache.
# update Update the cache by downloading all artifacts.
#
# Flags:
# -h, --help help for cache
#
# Global Flags:
# --debug Run in debug mode, which will print out debug logging.
#
# Use "prototool cache [command] --help" for more information about a command.
#
# -----------------------------------------------------------------------------
#
# Delete all artifacts in the default cache.
#
# The following directory will be deleted based on environment variables:
#
# - If $XDG_CACHE_HOME is set, then $XDG_CACHE_HOME/prototool will be deleted.
# - Otherwise, if on Linux, $HOME/.cache/prototool will be deleted, or on Darwin,
# $HOME/Library/Caches/prototool will be deleted.
#
# This will not delete any custom caches created using the --cache-path flag or
# PROTOTOOL_CACHE_PATH environment variable.
#
# Usage:
# prototool cache delete [flags]
#
# Flags:
# -h, --help help for delete
#
# Global Flags:
# --debug Run in debug mode, which will print out debug logging.
#
# -----------------------------------------------------------------------------
#
# Update the cache by downloading all artifacts.
#
# This will download artifacts to a cache directory before running any commands.
# Note that calling this command is not necessary, all artifacts are automatically
# downloaded when required by other commands. This just provides a mechanism to
# pre-cache artifacts during your build.
#
# Artifacts are downloaded to the following directories based on flags and
# environment variables:
#
# - If --cache-path is set, then this directory will be used. The user is
# expected to manually manage this directory, and the "delete" subcommand
# will have no effect on it.
# - Otherwise, if $PROTOTOOL_CACHE_PATH is set, then this directory will be used.
# The user is expected to manually manage this directory, and the "delete"
# subcommand will have no effect on it.
# - Otherwise, if $XDG_CACHE_HOME is set, then $XDG_CACHE_HOME/prototool
# will be used.
# - Otherwise, if on Linux, $HOME/.cache/prototool will be used, or on Darwin,
# $HOME/Library/Caches/prototool will be used.
#
# Usage:
# prototool cache update [dirOrFile] [flags]
#
# Flags:
# --cache-path string The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.
# --config-data string The configuration data to use instead of reading prototool.yaml or prototool.json files.
# This will act as if there is a configuration file with the given data in the current directory, and no other configuration files recursively.
# This is an advanced feature and is not recommended to be generally used.
# -h, --help help for update
#
# Global Flags:
# --debug Run in debug mode, which will print out debug logging.
#
# -----------------------------------------------------------------------------
#
# Compile with protoc to check for failures.
#
# Stubs will not be generated. To generate stubs, use the "gen" command. Calling
# "compile" has the effect of calling protoc with "-o /dev/null".
#
# Usage:
# prototool compile [dirOrFile] [flags]
#
# Flags:
# --cache-path string The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.
# --config-data string The configuration data to use instead of reading prototool.yaml or prototool.json files.
# This will act as if there is a configuration file with the given data in the current directory, and no other configuration files recursively.
# This is an advanced feature and is not recommended to be generally used.
# --dry-run Print the protoc commands that would have been run without actually running them.
# --error-format string The colon-separated fields to print out on error. Valid values are "filename:line:column:id:message". (default "filename:line:column:message")
# -h, --help help for compile
# --json Output as JSON.
# --protoc-bin-path string The path to the protoc binary. Setting this option will ignore the config protoc.version setting.
# This flag must be used with protoc-wkt-path and must not be used with the protoc-url flag.
# This setting can also be controlled using the $PROTOTOOL_PROTOC_BIN_PATH environment variable, however this flag takes precedence.
# --protoc-url string The url to use to download the protoc zip file, otherwise uses GitHub Releases. Setting this option will ignore the config protoc.version setting.
# --protoc-wkt-path string The path to the well-known types. Setting this option will ignore the config protoc.version setting.
# This flag must be used with protoc-bin-path and must not be used with the protoc-url flag.
# This setting can also be controlled using the $PROTOTOOL_PROTOC_WKT_PATH environment variable, however this flag takes precedence.
#
# -----------------------------------------------------------------------------
#
# Global Flags:
# --debug Run in debug mode, which will print out debug logging.
#
# Interact with configuration files.
#
# Usage:
# prototool config [command]
#
# Available Commands:
# init Generate an initial config file in the current or given directory.
#
# Flags:
# -h, --help help for config
#
# Global Flags:
# --debug Run in debug mode, which will print out debug logging.
#
# Use "prototool config [command] --help" for more information about a command.
#
# -----------------------------------------------------------------------------
#
# Generate an initial config file in the current or given directory.
#
# All available options will be generated and commented out except for
# "protoc.version". Pass the "--uncomment" flag to uncomment all options.
#
# Usage:
# prototool config init [dirPath] [flags]
#
# Flags:
# -h, --help help for init
# --uncomment Uncomment the example config settings.
#
# Global Flags:
# --debug Run in debug mode, which will print out debug logging.
#
# -----------------------------------------------------------------------------
#
# Create the given Protobuf files according to a template that passes default
# prototool lint.
#
# Assuming the filename "example_create_file.proto", the file will look like the
# following:
#
# syntax = "proto3";
#
# package SOME.PKG;
#
# option go_package = "PKGpb";
# option java_multiple_files = true;
# option java_outer_classname = "ExampleCreateFileProto";
# option java_package = "com.SOME.PKG.pb";
#
# This matches what the linter expects. "SOME.PKG" will be computed as follows:
#
# - If "--package" is specified, "SOME.PKG" will be the value passed to
# "--package".
# - Otherwise, if there is no "prototool.yaml" or "prototool.json" that would
# apply to the new file, use "uber.prototool.generated".
# - Otherwise, if there is a "prototool.yaml" or "prototool.json" file, check if
# it has a "packages" setting under the "create" section. If it does, this
# package, concatenated with the relative path from the directory with the
# "prototool.yaml" or "prototool.json" will be used.
# - Otherwise, if there is no "packages" directive, just use the
# relative path from the directory with the "prototool.yaml" or
# "prototool.json" file. If the file is in the same directory as the
# "prototool.yaml" or "prototool.json" file, use "uber.prototool.generated".
#
# For example, assume you have the following file at "repo/prototool.yaml":
#
# create:
# packages:
# - directory: idl
# name: uber
# - directory: idl/baz
# name: special
#
# - "prototool create repo/idl/foo/bar/bar.proto" will have the package
# "uber.foo.bar".
# - "prototool create repo/idl/bar.proto" will have the package "uber".
# - "prototool create repo/idl/baz/baz.proto" will have the package "special".
# - "prototool create repo/idl/baz/bat/bat.proto" will have the package
# "special.bat".
# - "prototool create repo/another/dir/bar.proto" will have the package
# "another.dir".
# - "prototool create repo/bar.proto" will have the package
# "uber.prototool.generated".
#
# This is meant to mimic what you generally want - a base package for your idl
# directory, followed by packages matching the directory structure.
#
# Note you can override the directory that the "prototool.yaml" or
# "prototool.json" file is in as well. If we update our file at
# "repo/prototool.yaml" to this:
#
# create:
# packages:
# - directory: .
# name: foo.bar
#
# Then "prototool create repo/bar.proto" will have the package "foo.bar", and
# "prototool create repo/another/dir/bar.proto" will have the package
# "foo.bar.another.dir".
#
# If Vim integration is set up, files will be generated when you open a new
# Protobuf file.
#
# Usage:
# prototool create files... [flags]
#
# Flags:
# --config-data string The configuration data to use instead of reading prototool.yaml or prototool.json files.
# This will act as if there is a configuration file with the given data in the current directory, and no other configuration files recursively.
# This is an advanced feature and is not recommended to be generally used.
# -h, --help help for create
# --package string The Protobuf package to use in the created file.
#
# Global Flags:
# --debug Run in debug mode, which will print out debug logging.
#
# -----------------------------------------------------------------------------
#
# Print all files that match the input arguments.
#
# Usage:
# prototool files [dirOrFile] [flags]
#
# Flags:
# --config-data string The configuration data to use instead of reading prototool.yaml or prototool.json files.
# This will act as if there is a configuration file with the given data in the current directory, and no other configuration files recursively.
# This is an advanced feature and is not recommended to be generally used.
# -h, --help help for files
#
# Global Flags:
# --debug Run in debug mode, which will print out debug logging.
#
# -----------------------------------------------------------------------------
#
# Format a proto file and compile with protoc to check for failures.
#
# Usage:
# prototool format [dirOrFile] [flags]
#
# Flags:
# --cache-path string The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.
# --config-data string The configuration data to use instead of reading prototool.yaml or prototool.json files.
# This will act as if there is a configuration file with the given data in the current directory, and no other configuration files recursively.
# This is an advanced feature and is not recommended to be generally used.
# -d, --diff Write a diff instead of writing the formatted file to stdout.
# --error-format string The colon-separated fields to print out on error. Valid values are "filename:line:column:id:message". (default "filename:line:column:message")
# -f, --fix Fix the file according to the Style Guide.
# -h, --help help for format
# --json Output as JSON.
# -l, --lint Write a lint error saying that the file is not formatted instead of writing the formatted file to stdout.
# -w, --overwrite Overwrite the existing file instead of writing the formatted file to stdout.
# --protoc-bin-path string The path to the protoc binary. Setting this option will ignore the config protoc.version setting.
# This flag must be used with protoc-wkt-path and must not be used with the protoc-url flag.
# This setting can also be controlled using the $PROTOTOOL_PROTOC_BIN_PATH environment variable, however this flag takes precedence.
# --protoc-url string The url to use to download the protoc zip file, otherwise uses GitHub Releases. Setting this option will ignore the config protoc.version setting.
# --protoc-wkt-path string The path to the well-known types. Setting this option will ignore the config protoc.version setting.
# This flag must be used with protoc-bin-path and must not be used with the protoc-url flag.
# This setting can also be controlled using the $PROTOTOOL_PROTOC_WKT_PATH environment variable, however this flag takes precedence.
#
# Global Flags:
# --debug Run in debug mode, which will print out debug logging.
#
# -----------------------------------------------------------------------------
#
# Generate with protoc.
#
# Usage:
# prototool generate [dirOrFile] [flags]
#
# Flags:
# --cache-path string The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.
# --config-data string The configuration data to use instead of reading prototool.yaml or prototool.json files.
# This will act as if there is a configuration file with the given data in the current directory, and no other configuration files recursively.
# This is an advanced feature and is not recommended to be generally used.
# --dry-run Print the protoc commands that would have been run without actually running them.
# --error-format string The colon-separated fields to print out on error. Valid values are "filename:line:column:id:message". (default "filename:line:column:message")
# -h, --help help for generate
# --json Output as JSON.
# --protoc-bin-path string The path to the protoc binary. Setting this option will ignore the config protoc.version setting.
# This flag must be used with protoc-wkt-path and must not be used with the protoc-url flag.
# This setting can also be controlled using the $PROTOTOOL_PROTOC_BIN_PATH environment variable, however this flag takes precedence.
# --protoc-url string The url to use to download the protoc zip file, otherwise uses GitHub Releases. Setting this option will ignore the config protoc.version setting.
# --protoc-wkt-path string The path to the well-known types. Setting this option will ignore the config protoc.version setting.
# This flag must be used with protoc-bin-path and must not be used with the protoc-url flag.
# This setting can also be controlled using the $PROTOTOOL_PROTOC_WKT_PATH environment variable, however this flag takes precedence.
#
# Global Flags:
# --debug Run in debug mode, which will print out debug logging.
#
# -----------------------------------------------------------------------------
#
# Call a gRPC endpoint. Be sure to set the required flags address, method, and
# either data or stdin.
#
# This command compiles your proto files with "protoc", converts JSON input to
# binary and converts the result from binary to JSON. All these steps take on the
# order of milliseconds. For example, the overhead for a file with four
# dependencies is about 30ms, so there is little overhead for CLI calls to gRPC.
#
# There is a full example for gRPC in the example directory of Prototool. Run
# "make init example" to make sure everything is installed and generated.
#
# Start the example server in a separate terminal by doing "go run
# example/cmd/excited/main.go".
#
# prototool grpc [dirOrFile] \
# --address serverAddress \
# --method package.service/Method \
# --data 'requestData'
#
# Either use "--data 'requestData'" as the the JSON data to input, or "--stdin"
# which will result in the input being read from stdin as JSON.
#
# $ make init example # make sure everything is built just in case
#
# $ prototool grpc example \
# --address 0.0.0.0:8080 \
# --method foo.ExcitedService/Exclamation \
# --data '{"value":"hello"}'
# {
# "value": "hello!"
# }
#
# $ prototool grpc example \
# --address 0.0.0.0:8080 \
# --method foo.ExcitedService/ExclamationServerStream \
# --data '{"value":"hello"}'
# {
# "value": "h"
# }
# {
# "value": "e"
# }
# {
# "value": "l"
# }
# {
# "value": "l"
# }
# {
# "value": "o"
# }
# {
# "value": "!"
# }
#
# $ cat input.json
# {"value":"hello"}
# {"value":"salutations"}
#
# $ cat input.json | prototool grpc example \
# --address 0.0.0.0:8080 \
# --method foo.ExcitedService/ExclamationClientStream \
# --stdin
# {
# "value": "hellosalutations!"
# }
#
# $ cat input.json | prototool grpc example \
# --address 0.0.0.0:8080 \
# --method foo.ExcitedService/ExclamationBidiStream \
# --stdin
# {
# "value": "hello!"
# }
# {
# "value": "salutations!"
# }
#
# Usage:
# prototool grpc [dirOrFile] [flags]
#
# Flags:
# --address string The GRPC endpoint to connect to. This is required.
# --cache-path string The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.
# --call-timeout string The maximum time to for all calls to be completed. (default "60s")
# --config-data string The configuration data to use instead of reading prototool.yaml or prototool.json files.
# This will act as if there is a configuration file with the given data in the current directory, and no other configuration files recursively.
# This is an advanced feature and is not recommended to be generally used.
# --connect-timeout string The maximum time to wait for the connection to be established. (default "10s")
# --data string The GRPC request data in JSON format. Either this or --stdin is required.
# --error-format string The colon-separated fields to print out on error. Valid values are "filename:line:column:id:message". (default "filename:line:column:message")
# -H, --header strings Additional request headers in 'name:value' format.
# -h, --help help for grpc
# --keepalive-time string The maximum idle time after which a keepalive probe is sent.
# --method string The GRPC method to call in the form package.Service/Method. This is required.
# --protoc-bin-path string The path to the protoc binary. Setting this option will ignore the config protoc.version setting.
# This flag must be used with protoc-wkt-path and must not be used with the protoc-url flag.
# This setting can also be controlled using the $PROTOTOOL_PROTOC_BIN_PATH environment variable, however this flag takes precedence.
# --protoc-url string The url to use to download the protoc zip file, otherwise uses GitHub Releases. Setting this option will ignore the config protoc.version setting.
# --protoc-wkt-path string The path to the well-known types. Setting this option will ignore the config protoc.version setting.
# This flag must be used with protoc-bin-path and must not be used with the protoc-url flag.
# This setting can also be controlled using the $PROTOTOOL_PROTOC_WKT_PATH environment variable, however this flag takes precedence.
# --stdin Read the GRPC request data from stdin in JSON format. Either this or --data is required.
#
# Global Flags:
# --debug Run in debug mode, which will print out debug logging.
#
# -----------------------------------------------------------------------------
#
# Top-level command for inspection commands.
#
# Usage:
# prototool inspect [command]
#
# Available Commands:
# package-deps Print the given package dependencies. Be sure to set the required flag name.
# package-importers Print the given package importers. Be sure to set the required flag name.
# packages List all packages.
#
# Flags:
# -h, --help help for inspect
#
# Global Flags:
# --debug Run in debug mode, which will print out debug logging.
#
# Use "prototool inspect [command] --help" for more information about a command.
#
# -----------------------------------------------------------------------------
#
# Print the given package dependencies. Be sure to set the required flag name.
#
# Usage:
# prototool inspect package-deps [dirOrFile] [flags]
#
# Flags:
# --cache-path string The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.
# --config-data string The configuration data to use instead of reading prototool.yaml or prototool.json files.
# This will act as if there is a configuration file with the given data in the current directory, and no other configuration files recursively.
# This is an advanced feature and is not recommended to be generally used.
# --error-format string The colon-separated fields to print out on error. Valid values are "filename:line:column:id:message". (default "filename:line:column:message")
# -h, --help help for package-deps
# --name string The package name. This is required.
# --protoc-bin-path string The path to the protoc binary. Setting this option will ignore the config protoc.version setting.
# This flag must be used with protoc-wkt-path and must not be used with the protoc-url flag.
# This setting can also be controlled using the $PROTOTOOL_PROTOC_BIN_PATH environment variable, however this flag takes precedence.
# --protoc-url string The url to use to download the protoc zip file, otherwise uses GitHub Releases. Setting this option will ignore the config protoc.version setting.
# --protoc-wkt-path string The path to the well-known types. Setting this option will ignore the config protoc.version setting.
# This flag must be used with protoc-bin-path and must not be used with the protoc-url flag.
# This setting can also be controlled using the $PROTOTOOL_PROTOC_WKT_PATH environment variable, however this flag takes precedence.
#
# Global Flags:
# --debug Run in debug mode, which will print out debug logging.
#
# -----------------------------------------------------------------------------
#
# Print the given package importers. Be sure to set the required flag name.
#
# Usage:
# prototool inspect package-importers [dirOrFile] [flags]
#
# Flags:
# --cache-path string The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.
# --config-data string The configuration data to use instead of reading prototool.yaml or prototool.json files.
# This will act as if there is a configuration file with the given data in the current directory, and no other configuration files recursively.
# This is an advanced feature and is not recommended to be generally used.
# --error-format string The colon-separated fields to print out on error. Valid values are "filename:line:column:id:message". (default "filename:line:column:message")
# -h, --help help for package-importers
# --name string The package name. This is required.
# --protoc-bin-path string The path to the protoc binary. Setting this option will ignore the config protoc.version setting.
# This flag must be used with protoc-wkt-path and must not be used with the protoc-url flag.
# This setting can also be controlled using the $PROTOTOOL_PROTOC_BIN_PATH environment variable, however this flag takes precedence.
# --protoc-url string The url to use to download the protoc zip file, otherwise uses GitHub Releases. Setting this option will ignore the config protoc.version setting.
# --protoc-wkt-path string The path to the well-known types. Setting this option will ignore the config protoc.version setting.
# This flag must be used with protoc-bin-path and must not be used with the protoc-url flag.
# This setting can also be controlled using the $PROTOTOOL_PROTOC_WKT_PATH environment variable, however this flag takes precedence.
#
# Global Flags:
# --debug Run in debug mode, which will print out debug logging.
#
# -----------------------------------------------------------------------------
#
# List all packages.
#
# Usage:
# prototool inspect packages [dirOrFile] [flags]
#
# Flags:
# --cache-path string The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.
# --config-data string The configuration data to use instead of reading prototool.yaml or prototool.json files.
# This will act as if there is a configuration file with the given data in the current directory, and no other configuration files recursively.
# This is an advanced feature and is not recommended to be generally used.
# --error-format string The colon-separated fields to print out on error. Valid values are "filename:line:column:id:message". (default "filename:line:column:message")
# -h, --help help for packages
# --protoc-bin-path string The path to the protoc binary. Setting this option will ignore the config protoc.version setting.
# This flag must be used with protoc-wkt-path and must not be used with the protoc-url flag.
# This setting can also be controlled using the $PROTOTOOL_PROTOC_BIN_PATH environment variable, however this flag takes precedence.
# --protoc-url string The url to use to download the protoc zip file, otherwise uses GitHub Releases. Setting this option will ignore the config protoc.version setting.
# --protoc-wkt-path string The path to the well-known types. Setting this option will ignore the config protoc.version setting.
# This flag must be used with protoc-bin-path and must not be used with the protoc-url flag.
# This setting can also be controlled using the $PROTOTOOL_PROTOC_WKT_PATH environment variable, however this flag takes precedence.
#
# Global Flags:
# --debug Run in debug mode, which will print out debug logging.
#
# -----------------------------------------------------------------------------
#
# Lint proto files and compile with protoc to check for failures.
#
# Lint rules can be set using the configuration file. See the configuration at
# https://github.com/uber/prototool/blob/dev/etc/config/example/prototool.yaml for
# all available options. There are two pre-configured groups of rules:
#
# google: This lint group follows the Style Guide at
# https://developers.google.com/protocol-buffers/docs/style. This is a small group
# of rules meant to enforce basic naming, and is widely followed.
#
# uber1: This lint group follows the Style Guide at
# https://github.com/uber/prototool/blob/master/etc/style/uber1/uber1.proto. This
# is a very strict rule group and is meant to enforce consistent development
# patterns.
#
# Configuration of your group can be done by setting the "lint.group" option in
# your "prototool.yaml" file:
#
# lint:
# group: google
#
# The "uber1" lint group represents the default lint group, and will be used if no
# lint group is configured.
#
# Files must be valid Protobuf that can be compiled with protoc, so prior to
# linting, prototool lint will compile your using protoc.
# Note, however, this is very fast - for two files, compiling and linting only
# takes approximately
# 3/100ths of a second:
#
# $ time prototool lint etc/style/uber1
#
# real 0m0.037s
# user 0m0.026s
# sys 0m0.017s
#
# For all 694 Protobuf files currently in
# https://github.com/googleapis/googleapis, this takes approximately 3/4ths of a
# second:
#
# $ cat prototool.yaml
# protoc:
# allow_unused_imports: true
# lint:
# group: google
#
# $ time prototool lint .
#
# real 0m0.734s
# user 0m3.835s
# sys 0m0.924s
#
# Usage:
# prototool lint [dirOrFile] [flags]
#
# Flags:
# --cache-path string The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.
# --config-data string The configuration data to use instead of reading prototool.yaml or prototool.json files.
# This will act as if there is a configuration file with the given data in the current directory, and no other configuration files recursively.
# This is an advanced feature and is not recommended to be generally used.
# --diff-lint-groups string Diff the two lint groups separated by '.', for example google,uber2.
# --error-format string The colon-separated fields to print out on error. Valid values are "filename:line:column:id:message". (default "filename:line:column:message")
# -h, --help help for lint
# --json Output as JSON.
# --list-all-lint-groups List all available lint groups instead of running lint.
# --list-all-linters List all available linters instead of running lint.
# --list-lint-group string List the linters in the given lint group instead of running lint.
# --list-linters List the configured linters instead of running lint.
# --protoc-bin-path string The path to the protoc binary. Setting this option will ignore the config protoc.version setting.
# This flag must be used with protoc-wkt-path and must not be used with the protoc-url flag.
# This setting can also be controlled using the $PROTOTOOL_PROTOC_BIN_PATH environment variable, however this flag takes precedence.
# --protoc-url string The url to use to download the protoc zip file, otherwise uses GitHub Releases. Setting this option will ignore the config protoc.version setting.
# --protoc-wkt-path string The path to the well-known types. Setting this option will ignore the config protoc.version setting.
# This flag must be used with protoc-bin-path and must not be used with the protoc-url flag.
# This setting can also be controlled using the $PROTOTOOL_PROTOC_WKT_PATH environment variable, however this flag takes precedence.
#
# Global Flags:
# --debug Run in debug mode, which will print out debug logging.
#
# -----------------------------------------------------------------------------
#
# Print the version.
#
# Usage:
# prototool version [flags]
#
# Flags:
# -h, --help help for version
# --json Output as JSON.
#
# Global Flags:
# --debug Run in debug mode, which will print out debug logging.
#
# -----------------------------------------------------------------------------
function _prototool() {
local context curcontext=$curcontext state line ret=1
declare -A opt_args
local -a commands
commands=(
'all:Compile, then format and overwrite, then re-compile and generate, then lint, stopping if any step fails.'
'break:Top-level command for breaking change commands.'
'cache:Interact with the cache.'
'compile:Compile with protoc to check for failures.'
'config:Interact with configuration files.'
'create:Create the given Protobuf files according to a template that passes default prototool lint.'
'files:Print all files that match the input arguments.'
'format:Format a proto file and compile with protoc to check for failures.'
'generate:Generate with protoc.'
'grpc:Call a gRPC endpoint. Be sure to set the required flags address, method, and either data or stdin.'
'help:Help about any command'
'inspect:Top-level command for inspection commands.'
'lint:Lint proto files and compile with protoc to check for failures.'
'version:Print the version.'
)
local -a _global_flags
_global_flags=(
'--debug[Run in debug mode, which will print out debug logging.]'
{-h,--help}'[show help]'
)
_arguments -C \
"1: :{_describe 'prototool command' commands}" \
'*:: :->args' \
&& ret=0
case $words[1] in
all)
_arguments \
'--cache-path[The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.]:cache path:_directories' \
'--config-data[The configuration data to use instead of reading prototool.yaml or prototool.json files.]:config data:_files' \
'--disable-format[Do not run formatting.]' \
'--disable-lint[Do not run linting.]' \
'--error-format[The colon-separated fields to print out on error. Valid values are "filename:line:column:id:message". \(default "filename:line:column:message"\)]:error foramt' \
'--fix[Fix the file according to the Style Guide.]' \
'--json[Output as JSON.]' \
'--protoc-bin-path[The path to the protoc binary. Setting this option will ignore the config protoc.version setting. This flag must be used with protoc-wkt-path and must not be used with the protoc-url flag.]:proto binary:_files' \
'--protoc-url[The url to use to download the protoc zip file, otherwise uses GitHub Releases. Setting this option will ignore the config protoc.version setting.]:url:_urls' \
'--protoc-wkt-path[The path to the well-known types. Setting this option will ignore the config protoc.version setting. This flag must be used with protoc-bin-path and must not be used with the protoc-url flag.]:well-known types path:_files' \
${_global_flags[@]} \
'*:proto files or directory:_files'
;;
break)
local -a break_cmd
break_cmd=(
'check:Check for breaking changes.'
)
_arguments \
"1: :{_describe 'break command' break_cmd}" \
'*:: :->args'
case $words[1] in
check)
_arguments \
'--allow-beta-deps[Allow stable packages to depend on beta packages. This is implicitly set if --include-beta is set.]' \
'--cache-path[The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.]:cache path:_directories' \
'--config-data[The configuration data to use instead of reading prototool.yaml or prototool.json files.]:config data:_files' \
'--git-branch[The git branch to check against. The default is the default branch.]:git brach' \
'--git-tag[The git tag to check against. The default is to not use tags and use the default branch.]:git tag' \
'--include-beta[Include beta packages in breaking change detection.]' \
'--json[Output as JSON.]' \
'--protoc-bin-path[The path to the protoc binary. Setting this option will ignore the config protoc.version setting. This flag must be used with protoc-wkt-path and must not be used with the protoc-url flag.]:proto binary:_files' \
'--protoc-url[The url to use to download the protoc zip file, otherwise uses GitHub Releases. Setting this option will ignore the config protoc.version setting.]:url:_urls' \
'--protoc-wkt-path[The path to the well-known types. Setting this option will ignore the config protoc.version setting. This flag must be used with protoc-bin-path and must not be used with the protoc-url flag.]:well-known types path:_files' \
${_global_flags[@]} \
'1:check breaking changes target directory:_directories'
;;
esac
;;
cache)
local -a cache_cmd
cache_cmd=(
'delete:Delete all artifacts in the default cache.'
'update:Update the cache by downloading all artifacts.'
)
_arguments \
"1: :{_describe 'cache command' cache_cmd}" \
'*:: :->args'
case $words[1] in
delete)
_arguments \
${_global_flags[@]}
;;
update)
_arguments \
'--cache-path[The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.]:cache path:_directories' \
'--config-data[The configuration data to use instead of reading prototool.yaml or prototool.json files.]:config data:_files' \
${_global_flags[@]} \
'1:files or directory:_files'
;;
esac
;;
compile)
_arguments \
'--cache-path[The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.]:cache path:_directories' \
'--config-data[The configuration data to use instead of reading prototool.yaml or prototool.json files.]:config data:_files' \
'--dry-run[Print the protoc commands that would have been run without actually running them.]' \
'--error-format[The colon-separated fields to print out on error. Valid values are "filename:line:column:id:message". \(default "filename:line:column:message"\)]:error foramt' \
'--json[Output as JSON.]' \
'--protoc-bin-path[The path to the protoc binary. Setting this option will ignore the config protoc.version setting. This flag must be used with protoc-wkt-path and must not be used with the protoc-url flag.]:proto binary:_files' \
'--protoc-url[The url to use to download the protoc zip file, otherwise uses GitHub Releases. Setting this option will ignore the config protoc.version setting.]:url:_urls' \
'--protoc-wkt-path[The path to the well-known types. Setting this option will ignore the config protoc.version setting. This flag must be used with protoc-bin-path and must not be used with the protoc-url flag.]:well-known types path:_files' \
${_global_flags[@]} \
'1:proto files or directory:_files'
;;
config)
local -a config_cmd
config_cmd=(
'init:Generate an initial config file in the current or given directory.'
)
_arguments \
"1: :{_describe 'config command' config_cmd}" \
'*:: :->args'
case $words[1] in
init)
_arguments \
'--uncomment[Uncomment the example config settings.]' \
${_global_flags[@]} \
'1:directory:_directories'
;;
esac
;;
create)
_arguments \
'--config-data[The configuration data to use instead of reading prototool.yaml or prototool.json files.]' \
'--package[The Protobuf package to use in the created file.]:protobuf package' \
${_global_flags[@]} \
'*:files:_files'
;;
files)
_arguments \
'--cache-path[The path to use for the cache, otherwise uses the default behavior.]:cache path:_files' \
${_global_flags[@]} \
'1:proto files or directory:_files'
;;
format)
_arguments \
'--cache-path[The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.]:cache path:_directories' \
'--config-data[The configuration data to use instead of reading prototool.yaml or prototool.json files.]:config data:_files' \
{-d,--diff}'[Write a diff instead of writing the formatted file to stdout.'] \
'--error-format[The colon-separated fields to print out on error. Valid values are "filename:line:column:id:message". \(default "filename:line:column:message"\)]:error foramt' \
{-f,--fix'[Fix the file according to the Style Guide.]' \
'--json[Output as JSON.]' \
{-l,--lint'[Write a lint error saying that the file is not formatted instead of writing the formatted file to stdout.]' \
{-w,--overwrite'[Overwrite the existing file instead of writing the formatted file to stdout.]' \
'--protoc-bin-path[The path to the protoc binary. Setting this option will ignore the config protoc.version setting. This flag must be used with protoc-wkt-path and must not be used with the protoc-url flag.]:proto binary:_files' \
'--protoc-url[The url to use to download the protoc zip file, otherwise uses GitHub Releases. Setting this option will ignore the config protoc.version setting.]:url:_urls' \
'--protoc-wkt-path[The path to the well-known types. Setting this option will ignore the config protoc.version setting. This flag must be used with protoc-bin-path and must not be used with the protoc-url flag.]:well-known types path:_files' \
${_global_flags[@]} \
'1:proto files or directory:_files'
;;
generate)
_arguments \
'--cache-path[The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.]:cache path:_directories' \
'--config-data[The configuration data to use instead of reading prototool.yaml or prototool.json files.]:config data:_files' \
'--dry-run[Print the protoc commands that would have been run without actually running them.]' \
'--error-format[The colon-separated fields to print out on error. Valid values are "filename:line:column:id:message". \(default "filename:line:column:message"\)]:error foramt' \
'--json[Output as JSON.]' \
'--protoc-bin-path[The path to the protoc binary. Setting this option will ignore the config protoc.version setting. This flag must be used with protoc-wkt-path and must not be used with the protoc-url flag.]:proto binary:_files' \
'--protoc-url[The url to use to download the protoc zip file, otherwise uses GitHub Releases. Setting this option will ignore the config protoc.version setting.]:url:_urls' \
'--protoc-wkt-path[The path to the well-known types. Setting this option will ignore the config protoc.version setting. This flag must be used with protoc-bin-path and must not be used with the protoc-url flag.]:well-known types path:_files' \
${_global_flags[@]} \
'1:proto files or directory:_files'
;;
grpc)
_arguments \
'--address[The GRPC endpoint to connect to. This is required.]:address:_urls' \
'--cache-path[The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.]:cache path:_directories' \
'--call-timeout[The maximum time to for all calls to be completed. \(default "60s"\)]:call timeout' \
'--config-data[The configuration data to use instead of reading prototool.yaml or prototool.json files.]:config data:_files' \
'--connect-timeout[The maximum time to wait for the connection to be established. \(default "10s"\)]:connect timout' \
'--data[The GRPC request data in JSON format. Either this or --stdin is required.]:data:_files' \
'--error-format[The colon-separated fields to print out on error. Valid values are "filename:line:column:id:message". \(default "filename:line:column:message"\)]:error foramt' \
{-H,--header}"[Additional request headers in 'name:value' format.]:headers" \
'--keepalive-time[The maximum idle time after which a keepalive probe is sent.]' \
'--method[The GRPC method to call in the form package.Service/Method. This is required.]:method' \
'--protoc-bin-path[The path to the protoc binary. Setting this option will ignore the config protoc.version setting. This flag must be used with protoc-wkt-path and must not be used with the protoc-url flag.]:proto binary:_files' \
'--protoc-url[The url to use to download the protoc zip file, otherwise uses GitHub Releases. Setting this option will ignore the config protoc.version setting.]:url:_urls' \
'--protoc-wkt-path[The path to the well-known types. Setting this option will ignore the config protoc.version setting. This flag must be used with protoc-bin-path and must not be used with the protoc-url flag.]:well-known types path:_files' \
'--stdin[Read the GRPC request data from stdin in JSON format. Either this or --data is required.]' \
${_global_flags[@]} \
'1:proto files or directory:_files'
;;
inspect)
local -a inspect_cmd
inspect_cmd=(
'package-deps:Print the given package dependencies. Be sure to set the required flag name.'
'package-importers:Print the given package importers. Be sure to set the required flag name.'
'packages:List all packages.'
)
_arguments \
"1: :{_describe 'inspect command' inspect_cmd}" \
'*:: :->args'
case $words[1] in
package-deps|package-importers|packages)
_arguments \
'--cache-path[The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.]:cache path:_directories' \
'--config-data[The configuration data to use instead of reading prototool.yaml or prototool.json files.]:config data:_files' \
'--error-format[The colon-separated fields to print out on error. Valid values are "filename:line:column:id:message". \(default "filename:line:column:message"\)]:error foramt' \
'--name[The package name. This is required.]:package name' \
'--protoc-bin-path[The path to the protoc binary. Setting this option will ignore the config protoc.version setting. This flag must be used with protoc-wkt-path and must not be used with the protoc-url flag.]:proto binary:_files' \
'--protoc-url[The url to use to download the protoc zip file, otherwise uses GitHub Releases. Setting this option will ignore the config protoc.version setting.]:url:_urls' \
'--protoc-wkt-path[The path to the well-known types. Setting this option will ignore the config protoc.version setting. This flag must be used with protoc-bin-path and must not be used with the protoc-url flag.]:well-known types path:_files' \
${_global_flags[@]} \
'1:proto files or directory:_files'
;;
esac
;;
lint)
_arguments \
'--cache-path[The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.]:cache path:_directories' \
'--config-data[The configuration data to use instead of reading prototool.yaml or prototool.json files.]:config data:_files' \
"--diff-lint-groups[Diff the two lint groups separated by '.', for example google,uber2.]:lint groups" # TODO(zchee): support command separated
'--error-format[The colon-separated fields to print out on error. Valid values are "filename:line:column:id:message". \(default "filename:line:column:message"\)]:error foramt' \
'--json[Output as JSON.]' \
'--list-all-lint-groups[List all available lint groups instead of running lint.]' \
'--list-all-linters[List all available linters instead of running lint.]' \
'--list-lint-group[List the linters in the given lint group instead of running lint.]:group' \
'--list-linters[List the configured linters instead of running lint.]' \
'--protoc-bin-path[The path to the protoc binary. Setting this option will ignore the config protoc.version setting. This flag must be used with protoc-wkt-path and must not be used with the protoc-url flag.]:proto binary:_files' \
'--protoc-url[The url to use to download the protoc zip file, otherwise uses GitHub Releases. Setting this option will ignore the config protoc.version setting.]:url:_urls' \
'--protoc-wkt-path[The path to the well-known types. Setting this option will ignore the config protoc.version setting. This flag must be used with protoc-bin-path and must not be used with the protoc-url flag.]:well-known types path:_files' \
${_global_flags[@]} \
'1:proto files or directory:_files'
;;
version)
_arguments \
'--json[Output as JSON.]' \
${_global_flags[@]}
;;
help)
_arguments \
${_global_flags[@]} \
"1: :{_describe 'command' commands}"
;;
esac
return ret
}
_prototool "$*"
# vim:ft=zsh:et:sts=2:sw=2