man: added pages for mkwin and path-convert

This commit is contained in:
Valerie Wolfe 2024-06-25 12:34:40 -04:00
parent 5893a1fbfc
commit a7197d6083
4 changed files with 100 additions and 0 deletions

View file

@ -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

6
man/justfile Normal file
View file

@ -0,0 +1,6 @@
alias i := install
install DIR="(unused)":
sudo cp ./*.1 /usr/share/man/man1/

61
man/mkwin.1 Normal file
View file

@ -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 .

32
man/path-convert.1 Normal file
View file

@ -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 .