Using file globs as arguments to a typer cli behaves differently on windows and linux #562
Unanswered
per11235813
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
I am frustrated about performance of find.exe that comes with git-scm, so I want to use python and typer instead.
I use the script above. I want to use globs on the command line, like
python find.py ~/AppData/**/*ditto*.db
. The attached scripts works and produces the desired output, eg (filename in the output is shorted a bit):When looking at sys.argv[1] printed out it is clear that the Windows does not expand the glob, but somehow
typer
or some other library identifies the arguments as a glob and expands it to a list of file names.I expected to get the argument glob from the command line as a string like
def find(glob: str)
, but then I get all the file names concatenated as a string.On linux the OS tries to expand the glob and if there are no matches it parses the glob string in a single entry list.
I understand the behavior on linux, but on Windows it seems a bit magical that that the string I provide as argument is identified as a glob and expanded.
I am sorry if I miss something obvious, but not understanding this drives me nuts :-)
Operating System
Linux, Windows
Operating System Details
Linux is WSL on windows 10
Typer Version
0.6.1
Python Version
Python 3.10.7
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions