forked from JiaChen-Zeng/WSL-CMD
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmd
More file actions
28 lines (23 loc) · 645 Bytes
/
cmd
File metadata and controls
28 lines (23 loc) · 645 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
CMD='/mnt/c/Windows/System32/cmd.exe'
HELP_STRING='Usage: cmd [COMMAND]...
If COMMAND is provided, run that COMMAND then exit.
If COMNAND is not provided, run cmd interactively.
Options:
--help Show this help.
--version Show the version number.'
VERSION_NUMBER='0.0.2'
VERSION_STRING="WSL-CMD version $VERSION_NUMBER"
if [[ $# -eq 0 ]] ; then
"$CMD"
echo
else
if [[ "$1" = '--help' ]] ; then
echo "$HELP_STRING"
elif [[ "$1" = '--version' ]] ; then
echo "$VERSION_STRING"
else
COMMAND="${@:1}"
echo "$($CMD /c $COMMAND)"
fi
fi