|
1 | | -load("//bazel:tensorstore.bzl", "tensorstore_cc_binary", "tensorstore_cc_library", "tensorstore_cc_test") |
| 1 | +load( |
| 2 | + "//bazel:tensorstore.bzl", |
| 3 | + "tensorstore_cc_binary", |
| 4 | + "tensorstore_cc_library", |
| 5 | +) |
2 | 6 |
|
3 | 7 | package(default_visibility = ["//visibility:public"]) |
4 | 8 |
|
5 | 9 | licenses(["notice"]) |
6 | 10 |
|
7 | | -tensorstore_cc_test( |
8 | | - name = "args_test", |
9 | | - srcs = ["args_test.cc"], |
| 11 | +tensorstore_cc_binary( |
| 12 | + name = "tscli", |
| 13 | + srcs = [ |
| 14 | + "main.cc", |
| 15 | + ], |
10 | 16 | deps = [ |
11 | | - ":tsclilib", |
12 | | - "@com_google_googletest//:gtest_main", |
| 17 | + ":command", |
| 18 | + ":tscli_commands", |
| 19 | + "//tensorstore:context", |
| 20 | + "//tensorstore/internal/metrics:collect", |
| 21 | + "//tensorstore/internal/metrics:registry", |
| 22 | + "//tensorstore/util:json_absl_flag", |
| 23 | + "//tensorstore/util:span", |
| 24 | + "@com_google_absl//absl/base:log_severity", |
| 25 | + "@com_google_absl//absl/base:no_destructor", |
| 26 | + "@com_google_absl//absl/flags:flag", |
| 27 | + "@com_google_absl//absl/flags:parse", |
| 28 | + "@com_google_absl//absl/log:globals", |
| 29 | + "@com_google_absl//absl/log:initialize", |
| 30 | + "@com_google_absl//absl/status", |
13 | 31 | ], |
14 | 32 | ) |
15 | 33 |
|
16 | 34 | tensorstore_cc_library( |
17 | | - name = "tsclilib", |
| 35 | + name = "tscli_commands", |
18 | 36 | srcs = [ |
19 | | - "args.cc", |
20 | | - "kvstore_copy.cc", |
21 | | - "kvstore_list.cc", |
22 | | - "ts_print_spec.cc", |
23 | | - "ts_print_stats.cc", |
24 | | - "ts_search.cc", |
| 37 | + "copy_command.cc", |
| 38 | + "list_command.cc", |
| 39 | + "print_spec_command.cc", |
| 40 | + "print_stats_command.cc", |
| 41 | + "search_command.cc", |
25 | 42 | ], |
26 | 43 | hdrs = [ |
27 | | - "args.h", |
28 | | - "cli.h", |
| 44 | + "copy_command.h", |
| 45 | + "list_command.h", |
| 46 | + "print_spec_command.h", |
| 47 | + "print_stats_command.h", |
| 48 | + "search_command.h", |
29 | 49 | ], |
30 | 50 | deps = [ |
31 | | - "//tensorstore", |
32 | | - "//tensorstore:array_storage_statistics", |
| 51 | + ":command", |
33 | 52 | "//tensorstore:box", |
34 | 53 | "//tensorstore:context", |
35 | 54 | "//tensorstore:json_serialization_options_base", |
36 | | - "//tensorstore:open", |
37 | | - "//tensorstore:open_mode", |
38 | 55 | "//tensorstore:spec", |
39 | | - "//tensorstore/index_space:dim_expression", |
40 | | - "//tensorstore/internal:path", |
41 | 56 | "//tensorstore/internal/json_binding", |
42 | 57 | "//tensorstore/internal/json_binding:bindable", |
43 | 58 | "//tensorstore/kvstore", |
44 | | - "//tensorstore/kvstore:generation", |
45 | | - "//tensorstore/kvstore:key_range", |
46 | | - "//tensorstore/util:division", |
47 | | - "//tensorstore/util:executor", |
48 | | - "//tensorstore/util:future", |
49 | | - "//tensorstore/util:iterate", |
| 59 | + "//tensorstore/tscli/lib:kvstore_copy", |
| 60 | + "//tensorstore/tscli/lib:kvstore_list", |
| 61 | + "//tensorstore/tscli/lib:ts_print_spec", |
| 62 | + "//tensorstore/tscli/lib:ts_print_stats", |
| 63 | + "//tensorstore/tscli/lib:ts_search", |
50 | 64 | "//tensorstore/util:json_absl_flag", |
51 | | - "//tensorstore/util:quote_string", |
52 | | - "//tensorstore/util:result", |
53 | | - "//tensorstore/util:span", |
54 | | - "//tensorstore/util:status", |
55 | | - "@com_github_nlohmann_json//:json", |
56 | | - "@com_google_absl//absl/container:flat_hash_map", |
57 | | - "@com_google_absl//absl/container:flat_hash_set", |
58 | | - "@com_google_absl//absl/flags:parse", |
59 | | - "@com_google_absl//absl/functional:function_ref", |
60 | | - "@com_google_absl//absl/log", |
61 | 65 | "@com_google_absl//absl/status", |
62 | 66 | "@com_google_absl//absl/strings", |
63 | 67 | "@com_google_absl//absl/strings:str_format", |
64 | | - "@com_google_absl//absl/strings:string_view", |
65 | | - "@com_google_absl//absl/synchronization", |
66 | | - "@com_google_re2//:re2", |
67 | 68 | ], |
68 | 69 | ) |
69 | 70 |
|
70 | | -tensorstore_cc_binary( |
71 | | - name = "tscli", |
| 71 | +tensorstore_cc_library( |
| 72 | + name = "command", |
72 | 73 | srcs = [ |
73 | | - "main.cc", |
| 74 | + "command.cc", |
| 75 | + "command_parser.cc", |
| 76 | + ], |
| 77 | + hdrs = [ |
| 78 | + "command.h", |
| 79 | + "command_parser.h", |
74 | 80 | ], |
75 | 81 | deps = [ |
76 | | - ":tsclilib", |
77 | 82 | "//tensorstore:context", |
78 | | - "//tensorstore/driver:all_drivers", |
79 | | - "//tensorstore/internal/metrics:collect", |
80 | | - "//tensorstore/internal/metrics:registry", |
81 | | - "//tensorstore/kvstore:all_drivers", |
82 | | - "//tensorstore/util:json_absl_flag", |
83 | | - "@com_google_absl//absl/base:log_severity", |
84 | | - "@com_google_absl//absl/flags:flag", |
85 | | - "@com_google_absl//absl/flags:parse", |
86 | | - "@com_google_absl//absl/log:globals", |
87 | | - "@com_google_absl//absl/log:initialize", |
| 83 | + "//tensorstore/util:span", |
| 84 | + "//tensorstore/util:status", |
| 85 | + "@com_google_absl//absl/container:flat_hash_map", |
| 86 | + "@com_google_absl//absl/container:flat_hash_set", |
| 87 | + "@com_google_absl//absl/log:absl_check", |
88 | 88 | "@com_google_absl//absl/status", |
| 89 | + "@com_google_absl//absl/strings", |
| 90 | + "@com_google_absl//absl/strings:string_view", |
89 | 91 | ], |
90 | 92 | ) |
0 commit comments