| // Copyright 2018 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| // This binary will test glob path passed to it as arg and write the path to |
| // stdout if found, else will write error to stderr and return 1. |
| int main(int argc, const char** argv) { |
| fprintf(stderr, "Usage: %s <glob_path>", argv[0]); |
| auto status = glob(glob_str, 0, nullptr, &globbuf); |
| fprintf(stderr, "glob failed: %d", status); |
| if (globbuf.gl_pathc == 0) { |
| fprintf(stderr, "no match found"); |
| for (size_t i = 0; i < globbuf.gl_pathc; i++) { |
| fprintf(stdout, "%s\n", globbuf.gl_pathv[i]); |