Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear from fs/globdocs that it supports a :max-depth option #130

Closed
teodorlu opened this issue Jun 6, 2024 · 1 comment
Closed

Unclear from fs/globdocs that it supports a :max-depth option #130

teodorlu opened this issue Jun 6, 2024 · 1 comment

Comments

@teodorlu
Copy link
Contributor

teodorlu commented Jun 6, 2024

Problem

The docstring for fs/glob does not mention :max-depth, making it hard to find out that fs/glob supports :max-depth.

$ bb -e '(doc fs/glob)'
-------------------------
babashka.fs/glob
([root pattern] [root pattern opts])
  Given a file and glob pattern, returns matches as vector of
  paths. Patterns containing `**` or `/` will cause a recursive walk over
  path, unless overriden with :recursive. Similarly: :hidden will be enabled (when not set)
  when `pattern` starts with a dot.
  Glob interpretation is done using the rules described in
  https://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystem.html#getPathMatcher(java.lang.String).

  Options:

  * `:hidden` - match hidden paths. Implied when `pattern` starts with a dot. Note: on Windows files starting with a dot are not hidden, unless their hidden attribute is set.
  * `:follow-links` - follow symlinks.
  * `:recursive` - force recursive search. Implied when `pattern` contains `**` or `/`.

  Examples:
  `(fs/glob "." "**.clj")`

Proposed solution: mention :max-depth under "Options"

Proposed solution: refer to a different docstring to understand supported options

@borkdude
Copy link
Contributor

borkdude commented Jun 6, 2024

OK, let's go with first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants