Skip to content

Commit

Permalink
Terminology change: wrapper -> shim
Browse files Browse the repository at this point in the history
  • Loading branch information
pfmoore committed Aug 4, 2014
1 parent 6aaaeab commit 20783df
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
Windows Executable Link Stubs
=============================
Windows Executable Shims
========================

This project allows the creation of Windows "executable stubs" - exe files
This project allows the creation of Windows "executable shims" - exe files
that when run, execute a defined command, passing the command line arguments
on to the subcommand.

They are similar to the shims used by the Python launcher for Windows, the
"pyzzer" Python wrapper project, and the "chocolatey" project.

Usage
-----

Create a stub wrapper as follows:
Create a shim as follows:

mkwrapper.py -f filename.exe -c "a command"
mkshim.py -f filename.exe -c "a command"

This will generate an executable, `filename.exe`, which when run, will execute
`a command`. So, for example:
Expand Down Expand Up @@ -38,7 +41,7 @@ The stub executable is built from the `stub.c` source. The compile command is
simply `cl /Festub.exe stub.c`. The script is built from `template.py` and the
stub exe using `build.py`.

If you want to use a different stub when building a link (for example, when
If you want to use a different stub when building a shim (for example, when
testing a change to the stub code) you can use the `--stub` argument to
specify the name of the sub exe directly.

Expand Down
2 changes: 1 addition & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def main():
with open('template.py') as template:
script = template.read()
script = script.replace('%%STUB%%', stub_txt)
with open('mkwrapper.py', 'w') as scriptfile:
with open('mkshim.py', 'w') as scriptfile:
scriptfile.write(script)

if __name__ == '__main__':
Expand Down
6 changes: 3 additions & 3 deletions mkwrapper.py → mkshim.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import argparse

def parse_args():
parser = argparse.ArgumentParser(description="Create exe wrapper links")
parser.add_argument("-f", "--filename", default="link.exe",
help="The filename of the generated link executable")
parser = argparse.ArgumentParser(description="Create executable shims")
parser.add_argument("-f", "--filename", default="shim.exe",
help="The filename of the generated shim")
parser.add_argument("-c", "--command",
help="The command to run (use %s for where the args should go)")
parser.add_argument("--stub",
Expand Down
6 changes: 3 additions & 3 deletions template.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import argparse

def parse_args():
parser = argparse.ArgumentParser(description="Create exe wrapper links")
parser.add_argument("-f", "--filename", default="link.exe",
help="The filename of the generated link executable")
parser = argparse.ArgumentParser(description="Create executable shims")
parser.add_argument("-f", "--filename", default="shim.exe",
help="The filename of the generated shim")
parser.add_argument("-c", "--command",
help="The command to run (use %s for where the args should go)")
parser.add_argument("--stub",
Expand Down

0 comments on commit 20783df

Please sign in to comment.