From a7197d6083e0190d6ce19892e1e93aa738a655a5 Mon Sep 17 00:00:00 2001 From: Valerie Wolfe Date: Tue, 25 Jun 2024 12:34:40 -0400 Subject: [PATCH] man: added pages for mkwin and path-convert --- justfile | 1 + man/justfile | 6 +++++ man/mkwin.1 | 61 ++++++++++++++++++++++++++++++++++++++++++++++ man/path-convert.1 | 32 ++++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 man/justfile create mode 100644 man/mkwin.1 create mode 100644 man/path-convert.1 diff --git a/justfile b/justfile index bf06d62..27d9a9e 100644 --- a/justfile +++ b/justfile @@ -12,6 +12,7 @@ install TARGET='all' DIR="~/.bin/": just install mkwin {{DIR}} just install path-convert {{DIR}} just install qdls {{DIR}} + just install man else just {{TARGET}}/install `realpath {{DIR}}` fi diff --git a/man/justfile b/man/justfile new file mode 100644 index 0000000..cf40480 --- /dev/null +++ b/man/justfile @@ -0,0 +1,6 @@ + +alias i := install + +install DIR="(unused)": + sudo cp ./*.1 /usr/share/man/man1/ + diff --git a/man/mkwin.1 b/man/mkwin.1 new file mode 100644 index 0000000..b07ada2 --- /dev/null +++ b/man/mkwin.1 @@ -0,0 +1,61 @@ +.Dd $Mdocdate$ +.Dt MKWIN 1 +.Os +.Sh NAME +.Nm mkwin +.Nd generate bash scripts for running Windows programs from WSL +.Sh SYNOPSIS +.Nm mkwin +.Op Fl hq +.Op Fl empty +.Op Fl -find Ar root +.Op Fl -pc Ar flags +.Op Fl -quiet +.Ar target +.Op Ar --\ args +.Sh DESCRIPTION +The +.Nm +utility generates bash scripts for executing Windows executables from WSL, and prints them to the standard output. The options are as follows: +.Bl -tag -width Ds +.It Ar --\ args +The resulting sript will forward the provided arguments. +.It Fl -empty +The resulting script will not pass arguments to the target binary. +.It Fl -find Ar root +The resulting script will locate the target binary in the given directory using +.Xr find 1 . +.It Fl h , Fl -help +Print a short help message. +.It Fl -pc Ar flags +The resulting script will pass the arguments converted with +.Xr path-convert 1 . path-convert will be invoked with the provided flags forwarded (use 'x' to forward no flags). +.It Fl q , Fl -quiet +The resulting script will redirect output to /dev/null and send the target to the background. +.El +.Sh EXIT STATUS +.Bl -tag -width Ds +.It 1 +No +.Ar target +was provided. +.It 2 +Path canonicalization failed; this typically indicates the +.Ar target +points to a file or directory that does not exist. +.El +.Sh EXAMPLES +Windows Explorer does not accept paths with spaces when executed from WSL. To generate a script to launch Windows Explorer: +.Pp +.Dl $ mkwin --pc=sqq /mnt/c/Windows/System32/explorer.exe > explorer.sh +.Pp +Windows Terminal's executable moves when updated. To generate a script to launch Windows Terminal: +.Pp +.Dl $ mkwin --empty --find='/mnt/c/Program Files/WindowsApps/Microsoft.WindowsTerminal*' WindowsTerminal.exe > terminal.sh +.Pp +.Sh SEE ALSO +.Xr find 1 , +.Xr path-convert 1 +.Sh AUTHORS +.An -nosplit +.An Valerie Wolfe Aq Mt sleeplessval@gmail.com . diff --git a/man/path-convert.1 b/man/path-convert.1 new file mode 100644 index 0000000..4401e7b --- /dev/null +++ b/man/path-convert.1 @@ -0,0 +1,32 @@ +.Dd $Mdocdate$ +.Dt PATH-CONVERT 1 +.Os +.Sh NAME +.Nm path-convert +.Nd canonicalize and convert Unix for DOS programs +.Sh SYNOPSIS +.Nm path-convert +.Op Fl hnqs +.Ar +.Sh DESCRIPTION +The +.Nm +utility converts UNIX paths to DOS, for command substituting paths when invoking Windows executables from the terminal in WSL. Its options are as follows: +.Bl -tag -width Ds +.It Fl h , Fl -help +Displays a short help text. +.It Fl n , Fl -network +Adds the WSL network path where appropriate. +.It Fl q , Fl -quotes +Surrounds each converted path with single quotes (-q) or double quotes (-qq). +.It Fl s , Fl -no-space +Uses DOS shortening for directories in the path whose name contains spaces. +.El +.Sh ENVIRONMENT +.Bl -tag -width Ds +.It Ev WSL_DISTRO_NAME +This should be auto-set by WSL, and contains the name of the current distribution. +.El +.Sh AUTHORS +.An -nosplit +.An Valerie Wolfe Aq Mt sleeplessval@gmail.com .