Skip to content

eng1234/cmd_utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Globber

Globber is a lightweight Windows command-line utility that expands wildcard arguments (like *.py) in commands that don't support globbing natively β€” such as git, mv, or custom scripts.

πŸš€ What It Does

With Globber, you can run:

globber git mv *.py src/

and it transforms that into:

git mv a.py b.py c.py src/

I like to rename it to $.exe and then you can write

$ git mv *.py src/

WHY ? - Because Windows CMD does NOT expand wildcards in arguments. So if you run:

git mv *.py src/

you get an error like:

fatal: bad source, source=.py, destination=src/.py

βœ… Features

  • Expands * and ? in any argument position
  • Keeps non-wildcard args untouched
  • Works via standard system() call
  • Supports filenames with spaces
  • Tiny executable: ideal for scripting or Git hooks

πŸ› οΈ Usage

globber <command> [args with wildcards]

Examples:

globber echo *.txt

globber git mv *.c src/

globber custom_script.exe "data set*/raw*.csv"

And if you rename globber.exe to %.exe

$ git mv *.c src/

πŸ’» Build Instructions

Using Tiny C Compiler:

tcc -o globber.exe globber.c

Link to Tiny C Compiler: https://bellard.org/tcc/

Or MSVC:

cl globber.c /Fe:globber.exe

πŸ“ File Structure

  • globber.c β€” the main source file
  • globber.exe β€” compiled binary
  • README.md β€” this documentation

πŸ“¦ License

MIT β€” free to use, hack, and share.

✨ Inspired By

Unix shells that just do this right.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages