Skip to content

Instantly share code, notes, and snippets.

@jack126guy
Created October 12, 2015 02:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jack126guy/21e180938afae26e47d5 to your computer and use it in GitHub Desktop.
Save jack126guy/21e180938afae26e47d5 to your computer and use it in GitHub Desktop.
"dosoption" Debian package contents
Package: dosoption
Version: 1.1
Section: misc
Priority: optional
Architecture: all
Installed-Size: 2
Maintainer: Jack126Guy <someanon126@gmail.com>
Description: Execute programs using DOS-style options
This package contains a script that converts DOS-style
options into Unix-style options.
.
It should be used by a wrapper script that calls dosoption
to provide a seamless DOS-like interface to a command.
#!/bin/sh
if [ "$#" -lt 1 ]; then
echo 'No command specified'
exit 1
fi
COMMAND="'$1'"
shift
ARGS=''
for ARG; do
ARG=`echo "$ARG" | sed \
-e 's/^\//-/' \
-e 's/^C\:\//\//' \
`
ARGS="$ARGS '$ARG'"
done
eval "$COMMAND $ARGS"
.TH DOSOPTION 1 "Version 1.1"
.SH NAME
dosoption - execute commands with DOS-style options
.SH SYNOPSIS
.B dosoption
command
.RI [ options ]
.SH DESCRIPTION
This script converts options from DOS-style options beginning with a slash
("/") to Unix-style options beginning with a hyphen ("-").
This should be used in conjunction with a wrapper script to provide a
seamless DOS-style interface to a command. A sample wrapper script is
included as the
.I /usr/share/dosoption/wrapper.sh
file.
.SH OPTIONS
All options are passed verbatim to the command.
The initial slash is replaced by a hyphen. This means that long options
beginning with a double hyphen ("--") must be entered beginning with "/-".
To enter a filename or any other argument beginning with a literal slash,
enter "C:" before the arguments. So, for example, "/usr/bin/dosoption" becomes
"C:/usr/bin/dosoption".
.SH BUGS
In DOS, spaces can often be omitted between options and between the command
and the first option. This is not allowed with
.BR dospause.
Backslash ("\\") path separators in filenames are not converted to slashes.
.SH AUTHOR
Jack126Guy <someanon126@gmail.com>
.SH COPYRIGHT
The program and this manual are released into the public domain under
Creative Commons CC0 1.0 Universal:
<http://creativecommons.org/publicdomain/zero/1.0/>
#!/bin/sh
#Example wrapper script for dosoption
COMMAND='ls'
dosoption "$COMMAND" "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment