find on Windows: opt in to / as the path separator
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 15/100
Direzione di ricerca
A pull request (#907) is already open for this, so read it before anything else. The proposal reads the UUTILS_PATH_SEPARATOR variable on Windows only, next to UUTILS_DIAG, and affects path output in printing, -path/-regex, -printf and -exec. The docs go in docs/src/extensions.md. The name and shape are still open for maintainer decision, and the existing tests assert native separators through fix_up_slashes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
On Windows, find joins the paths it walks with \, so output mixes separators with whatever the start point used, and -path/-prune patterns written with / match nothing:
PS> find tree -not -path '*/.*'
tree
tree\.hidden
tree\.hidden\secret.txt
...
PS> find test_data/depth/1 -name f2
test_data/depth/1\2\f2
This is the expected native behavior (the tests assert it through fix_up_slashes), so I am not proposing to change the default. But MSYS2, Cygwin and Git Bash users, scripts written for POSIX shells, and tools that drive find from another program (our case: an agent shell whose paths are all /) need /. The same request exists for ls in uutils/coreutils#12742 and microsoft/coreutils#107, and ripgrep answers it with --path-separator.
Proposal: an environment variable, UUTILS_PATH_SEPARATOR=/, read only on Windows, in the same family as UUTILS_DIAG. With it set, every path a walk produces uses /: printing, -path/-wholename/-regex, -printf %p/%h/%P, and -exec {}. Any other value, or none, changes nothing. It should also accept slash: Git Bash and MSYS2 rewrite an environment value of a bare / into their install folder (C:/Program Files/Git/) before a native program sees it. A GNU-style option would collide with GNU's option space, which is why I lean to the variable. The same variable would serve uutils grep (uutils/grep, PR ready) and later ls.
I have a PR ready (about 40 lines plus tests and a section in docs/src/extensions.md), green on the Windows CI legs in my fork. Happy to change the name or the shape before opening it.
- Lingua principale
- Rust
- Stelle
- 651
- Fork
- 111
- Merge medio
- 1g 13h
- PR unite (30g)
- 21
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di uutils/findutils
-
-printf %m and -ls drop setuid/setgid/sticky bits and the file typeForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
uutils/findutils#692 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
xargs: -x runs a pending command before rejecting an oversized argumentForse già presa @SichenLiang l’ha presa 6 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 28/100
I maintainer di solito rispondono entro 1 giorno
-
find: -ls shows the time instead of the year for old filesForse già presa @SichenLiang l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 32/100
I maintainer di solito rispondono entro 1 giorno
-
xargs: empty items are dropped with -0 and -dForse già presa @SichenLiang l’ha presa 16 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di uutils/findutils
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue gpu serve
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
biomejs/biome#12475 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno
-
documentation E-easy good first issue help wanted
Difficoltà 1/5 1-3 ore Idoneità per principianti 91/100
I maintainer di solito rispondono entro 1 giorno