Book Review: Programming Rust: Fast, Safe Systems Development 2nd Edition

Since Amazon (suspiciously) won’t let me review this book that I purchased, I will review it here. I would have been kinder on amazon, but blocking reviews is a dirty tactic for a publisher.

This book has a great deal of useful information in it, *BUT*. I have 40 years programming experience from VAX assembly through C# and .NET 6. I have read dozens of programming books and rarely find so many segments that are close to incomprehensible to me after the first or even second pass, both in code and in text. Part of this is rust itself, which seems to use every possible special character in some strange new way, even in combinations (but does not implement the ++ operator, just to offend C++ programmers I think) and has constructs that are likely unfamiliar to a majority of modern programmers. You need to make some investment to understand these things, and that really needs to come before anything else. Other rust books are certainly easier to grok and therefore likely better starting points for anyone not seasoned in C/C++, which are also irrelevant to me, but which the book mentions often, and for which it even provides out-of-context code samples that I cannot understand without additional research.

The authors are clearly trying to demonstrate their individual experience and intelligence rather than educating their audience completely or properly. These are exactly the kind of programmers that make bad development team members – their code may be efficient, but only they can follow and maintain it, and given the level of documentation for the code samples in the book…

Most programmers have nothing to do with complex numbers and fractals, so these problem domains are confusing and irrelevant. Here’s a very closely-guarded secret: for the last 30 years, most programmers have *not* been mathematicians. Honestly, I might fail trig if I tried it again, not because it is hard, but because it is completely irrelevant and not interesting to me and serves me no purpose, and the computer is there to answer those questions anyway. That’s how we build knowledge scaffolding, by focusing on the concepts and leveraging what already exists rather than re-inventing everything. Doesn’t mean I don’t understand trig; it means I don’t do the calculations by hand or with code, as someone wrote trusted libraries for that decades ago.

Nowadays, we are mostly web developers, and there is almost no mention of anything web in this book – barely touches on JSON, HTTP server, HTTP client, or anything else likely to be relevant to a majority of programmers (though rust includes none of this in its standard libraries anyway). It’s almost like a theory book. If you want to target the majority of developers, you have to know who they are and meet them where they are. Trying to convince C/C++ programmers (many of whom know the Linux kernel cannot be rewritten in safe rust and are just waiting for rust to have a huge public security problem, whether from the compiler or the risky tooling combined with critical unregulated third-party library diaspora disaster and such, or otherwise) to switch to rust seems like a non-starter.

At the same time, the authors and their editors were *not* smart enough to find several errors in the text and the code, some of which seem to be failures to update from a previous edition. The result is that, unless you are 100% going into rust and plan to read this book a few times and notate the authors’ errors and omissions, many of the explanations for code examples will seem incomplete and leave out critical details that would help you to understand them. You will almost certainly need to supplant this book with additional books and other resources, which are a better place to start with rust. Definitely not written by educators.

This is not the kind of book that you pick up when you need an answer without having read the entire thing first, at least once. It’s not a beginner book, it’s not a reference…it’s the authors showing off.

So in summary, this book is useful, but it is also insulting, frustrating, and confusing. Additionally, much of its content is likely irrelevant to the majority of its readers. At least for the section on modules, they didn’t use the front of restaurant/back of restaurant paradigm from the real rust book, which also has no relation to any problem domain that I have ever seen. That is about the only section of the default rust book that I found worse than this one.

BTW, I am in no way implying that my book was any better; I admit that it was far worse. I have some understanding of how hard it is to publish a technical book like this, so I forgive the authors somewhat (not for the arrogant and intentionally confusing bits). Relevant examples and a little more explanation of the code is what the readers were likely after, and would have greatly increased the value of this book, which missed the mark for me.

Update: This popped up on amazon the next day, immediately after I had tagged one of the authors on LinkedIn with this review. Most of the reviews of the previous edition are positive, but I don’t know how much we can trust amazon reviews anyway. I found one review that seemed to agree with some of my perspectives. Maybe I am just not smart enough for rust or this book.

Rustsources

This blog post links to some primary resources for learning the rust programming language. If you know of anything that should be in this list, please comment on this blog post.

The primary rust book to which everyone in the community refers

Rust operators and symbols

The primary book for learning about cargo

Rust learning site

Rust programming language forum

Blog by rust engineers

Lots of code examples from Programming Rust by O’Reilly, but… (Book Review: Programming Rust: Fast, Safe Systems Development 2nd Edition – rustapopoulos.com)

A book that I have not read.

Code samples from The Rust Programming Language by nostarch

Code samples from The Complete Rust Programming Reference Guide by Packt

Additional rust blogs

Rust: What the &()::||_’*+! is this?

While many of the symbols used in rust source code are like those used in other languages, some languages do not use those symbols or use them differently. This blog post provides short explanations for rust programming symbols that may not be used or may be used differently in other languages. Again, I am just learning rust, and although this might not be completely technically accurate or use perfect terminology, it could assist casual rust readers. Real developers should of course consult the documentation for a more thorough explanation and greater understanding of not only the symbols, but the concepts that they represent.

What follows are simplified explanations of my understanding of some common symbols in rust source code.

  • &
    Borrows a reference, which has to do with managing the lifetime of its data, often when passing things to functions.

  • Designates lifetime requirements explicitly, typically to help the compiler validate arguments to functions.
  • !
    In addition to being the negation (not) operator, following what appears to be a function name, ! indicates a macro, such as println!(), which works something like a function defined with the fn token. This can be particularly confusing in statements such as the following, which, especially considering that rust conditionals do not require parentheses, one might assume negates the condition check: pub fn is_windows() -> bool { cfg!(target_os = “windows”)}.
  • _
    Catchall condition for match expressions, which are something like big switch statements, but much better.
  • *
    Dereference or raw pointer. I try not to do this.
  • ::
    This is typically a scope resolution operator in rust paths, such as such as std::io, which are similar to namespaces and typically correspond to file paths, often in external packages.
  • ||
    With contents, this can indicate a closure.
  • ()
    Without a name and with contents, these characters () symbol generally seems to indicate a tuple. After a name, they can indicate an enumeration, which in rust is a construct that can contain a value within those parentheses. An empty pair of parentheses can also basically indicate a null set, which seems similar to the Some() and None enumeration pattern.
  • ?
    Following certain statements, this can propagate an error up the calls stack. This allows exception management at a higher level without try/catch blocks and for local code to proceed as if no error had occurred.
  • +
    Used to indicate constraints in type conditions.

Note that there appears to be no ++ operator in rust.

Comparing Rust and C#

This blog post contains perspectives on similarities and differences between the rust programming language and the C# programming language for .NET. This post focusses on command line and background processes and does not consider native user interface technologies for Windows or Linux, although for now at least, C# is almost certainly more appropriate for Windows developers and rust may be more appropriate for Linux UI developers. I am not a professional programmer; this post provides my opinions based on about 20 years of experience with C# and a few weeks with rust.

This post is actually on a different blog of mine about .NET.

Danger: Cargo Clean Removes Everything from the /tmp Directory

This blog post describes what could be an extremely dangerous issue with the default configuration of cargo, the build tool for rust programs. Apparently, the cargo clean command tries to remove everything from its build directory, which defaults to /tmp.

[2021-06-25 13:59:12]:jw@HAL9000-6WQ9TQ2:/mnt/c/temp/cscdprox
$ cargo clean
error: could not remove build directory

Caused by:
  failed to remove file `/tmp/rider/jetbrains-toolbox-1.20.8804/jetbrains-toolbox`

Caused by:
  Permission denied (os error 13)

Luckily, I use /tmp for things that are truly temporary, generally on an instantaneous basis, and some things in /tmp were somehow owned by root, which raised the alert. I do not know what damage this may have done to my system, but honestly I subsequently had issues with WSL that a reboot (luckily) resolved. And Linux programmers chuckle at Windows…

One solution is to specify the target directory on every command path. A safer backup would be to update the target-dir setting in the ~/.cargo/config file from /tmp to something like /tmp/thatsbad A double-failsafe could be to set the CARGO_TARGET_DIR environment variable to something like /tmp/isthatworse.

[2021-06-25 22:21:43]:jw@HAL9000-6WQ9TQ2:~/.cargo
$ grep /tmp ./config
target-dir = "/tmp"

This is obviously not something I had configured.

Rust Warning: The rustfmt Command Formats Referenced Source Code Files

I figured out why my the rustfmt commands in the build script for my rust program were reformatting certain .rs source code files repeatedly, including one that I was explicitly excluding from the command line. I was trying to pass each file to the rustfmt command individually, excluding the one that I need to format differently because it contains long lines of code.

As it turns out, the rustfmt command formats the file(s) specified on the command line as well as any files that those files reference, so it is not necessary to call rustfmt repeatedly or to pass all of the file paths on the command line. I do not think it is possible to exclude referenced files from formatting, but you can reformat those files afterwards.

To format all the files in a project requires a single short command.

cmd="time rustfmt -l -v ./src/main.rs ./src/lib.rs"

To reformat a specific file that has very long lines:

cmd="rustfmt -l -v --config max_width=2500 ./src/wsl/inv/invocablecategory.rs"

Anatomy of a Rust Program, Part VIII: Anatomy of a Cargo Build Script

This blog post is the eighth in a series that describes the structure of the wink command line program that I have written in rust and that I use to invoke other Windows and Linux programs from bash and Windows shells under Windows Subsystem for Linux. This post describes the wince Unix sh shell script that I use to build, test, and install the wink program.

#!/bin/sh -x

Use the /bin/sh interpreter and echo invoked commands.

clear

Clear the screen to make it easier to fine the latest output from this wince command.

export RUST_BACKTRACE=full # or 1

Setting the RUST_BACKTRACE environment variable to 1 or full causes rust executables to generate more output.

rustup update

Update the rust tools.

projdir=/mnt/c/temp/wink    # directory containing cargo.toml
winbld='C:\temp\wink.build' # Windows path to directory for building Windows binary
linstall=~/bin              # WSL binary install path
cd $projdir                 # avoid specifying project path for all commands

Specify some paths. It would probably be appropriate to specify $projdir on all command lines, but most command lines are long enough already, and it is redundant.

cmd="cargo check -v --workspace --all-features"
result=$( $cmd 3>&1 1>&2 2>&3 | tee /dev/fd/2 )

The cargo check command is faster than compiling, so a quick way to identify errors before continuing. For unknown reasons, sometimes it fails even though the code is good, but generally works the first or second time. The redirects and tee allow capturing stdout from the command into the result variable.

result=$( find . -type f \( -iname "*.rs" -not -iname "invocablecategory.rs" \) -exec rustfmt -l -v {} \; 3>&1 1>&2 2>&3 | tee /dev/fd/2 )

The rustfmt command applies rust formatting conventions, rewriting the files in place.

rustfmt -l -v --config max_width=2500 ./src/wsl/inv/invocablecategory.rs

The invocablecategory.rs works better with long code lines.

set +x

Do not echo shell commands.

for f in "$(find . -iname \*.rs -print)"; do
    ls -l $f
    wc -clw $f
done

List file sizes and character/line/word counts.

set -x

Echo shell commands.

cargo update -v

Update package dependencies.

cmd='cargo-clippy -v'

The cargo-clippy command suggests code improvements.

cmd="cargo test -v --workspace --all-features --target-dir $linbld -- --nocapture -- -epdv word a b c"

The cargo test command builds a binary with main not defined in /main.rs to invoke tests in /main.rs and code referenced from /main.rs and /lib.rs.

#cargo clean --target-dir /tmp/wink.build       # kills build performance

Cargo clean removes artifacts from prior builds that improve performance for subsequent builds.

cmd="cargo build -v --target-dir $linbld --release"

Cargo build builds any required binaries for the package. I do not use debug build features; I build releases and test in production, which is my desktop.

cargo doc -v --target-dir $linbld               # --open to open in browser

The cargo doc command builds HTML documentation from comments in the code.

ls -l ${linbld}/release/wink            # show WSL binary file size and build date

The binary seems huge relative to the code volume, and not much different from the debug binary, but performs well.

rm ${linstall}/wink                     # remove installed WSL binary
cp ${linbld}/release/wink $linstall     # install new WSL binary

Install the Linux binary. To be honest, WSL could call the Windows binary from a bash shell, or wink could call the Windows binary from a bash shell, or a Windows shell could call bash.exe to invoke the Linux binary of wink, which would be best for putting a finger in Microsoft’s eye for not having migrated Windows to a Linux kernel after Windows NT. It is always better to invoke a binary, or even call wsl.exe or bash.exe, or when needed even wt.exe, rather than cmd.exe or explorer.exe.

cargo.exe build --release --target-dir "$winbld" # --release affects binary path below

Use the Windows version of cargo to build the Windows executable.

`wslpath ${winbld}`/release/wink.exe -ep > ${linbld}/doc/wink/wink.json # export JSON
cp ${linbld}/doc/wink/wink.json .       # copy JSON to project root for github

Use the Windows executable to export JSON, partly as a test, but also for github.

ls -l ${linbld}/doc/wink/wink.json      # show JSON file size and touch time

Show JSON file size and touch time.

path=`cmd.exe /c echo %USERPROFILE% | sed -e 's/\r//g'` # install Windows binary to this directory in %PATH%
path=`wslpath $path | sed -e 's/\r//g'`/AppData/Local/Microsoft/WindowsApps
cp ${lwinbld}/release/wink.exe $path # install Windows binary

Install the Windows binary for cmd.exe and powershell.exe, which I only use for testing.

set +x

Do not echo shell commands.

${linstall}/wink $@ # run Linux build with parameters supplied on command line

Run the Linux binary.

cp /mnt/c/temp/wink/wince $linstall # install any updates to this wince shell script

Install any updates to this script (this line can result in error messages that are usually irrelevant).

cd - > /dev/null # revert to the previous directory
exit 0

Then you just run a command like this and enter the matrix for about 20 seconds.

time wince -vepd word ; time wink -vepd word
output from wince
output from running time wince -vepd word ; time wink -vepd word
+ export RUST_BACKTRACE=full
+ rustup update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: checking for self-updates

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.53.0 (53cb7b09b 2021-06-17)

info: cleaning up downloads & tmp directories
+ projdir=/mnt/c/temp/wink
+ linbld=/tmp/wink.build
+ winbld=C:\temp\wink.build
+ wslpath C:\temp\wink.build
+ lwinbld=/mnt/c/temp/wink.build
+ linstall=/home/jw/bin
+ cd /mnt/c/temp/wink
+ cmd=time cargo check -v --workspace --all-features
+ time cargo check -v --workspace --all-features
+ tee /dev/fd/2
       Fresh unicode-xid v0.2.2
       Fresh cfg-if v1.0.0
       Fresh itoa v0.4.7
       Fresh regex-syntax v0.6.25
       Fresh proc-macro2 v1.0.27
       Fresh quote v1.0.9
       Fresh libc v0.2.97
       Fresh memchr v2.4.0
       Fresh ryu v1.0.5
       Fresh syn v1.0.73
       Fresh dirs-sys-next v0.1.2
       Fresh aho-corasick v0.7.18
       Fresh serde_derive v1.0.126
       Fresh dirs-next v2.0.0
       Fresh regex v1.5.4
       Fresh derive-new v0.5.9
       Fresh serde v1.0.126
       Fresh term v0.7.0
       Fresh serde_json v1.0.64
    Checking wink v0.1.0 (/mnt/c/temp/wink)
     Running `rustc --crate-name wink --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 -C metadata=d401c06dfe575890 -C extra-filename=-d401c06dfe575890 --out-dir /tmp/debug/deps -C incremental=/tmp/debug/incremental -L dependency=/tmp/debug/deps --extern derive_new=/tmp/debug/deps/libderive_new-f4a32d1b166a72c0.so --extern regex=/tmp/debug/deps/libregex-ce229bf00f1a9055.rmeta --extern serde=/tmp/debug/deps/libserde-5e0466a5ac1608e4.rmeta --extern serde_json=/tmp/debug/deps/libserde_json-0895eb5a0ecbdb48.rmeta --extern term=/tmp/debug/deps/libterm-b1d31558e3368d28.rmeta`
     Running `rustc --crate-name wink --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 -C metadata=186c7c3475d472ea -C extra-filename=-186c7c3475d472ea --out-dir /tmp/debug/deps -C incremental=/tmp/debug/incremental -L dependency=/tmp/debug/deps --extern derive_new=/tmp/debug/deps/libderive_new-f4a32d1b166a72c0.so --extern regex=/tmp/debug/deps/libregex-ce229bf00f1a9055.rmeta --extern serde=/tmp/debug/deps/libserde-5e0466a5ac1608e4.rmeta --extern serde_json=/tmp/debug/deps/libserde_json-0895eb5a0ecbdb48.rmeta --extern term=/tmp/debug/deps/libterm-b1d31558e3368d28.rmeta --extern wink=/tmp/debug/deps/libwink-d401c06dfe575890.rmeta`
    Finished dev [unoptimized + debuginfo] target(s) in 0.94s
0.77user 0.11system 0:01.06elapsed 83%CPU (0avgtext+0avgdata 184256maxresident)k
0inputs+672outputs (0major+46673minor)pagefaults 0swaps
+ result=       Fresh unicode-xid v0.2.2
       Fresh cfg-if v1.0.0
       Fresh itoa v0.4.7
       Fresh regex-syntax v0.6.25
       Fresh proc-macro2 v1.0.27
       Fresh quote v1.0.9
       Fresh libc v0.2.97
       Fresh memchr v2.4.0
       Fresh ryu v1.0.5
       Fresh syn v1.0.73
       Fresh dirs-sys-next v0.1.2
       Fresh aho-corasick v0.7.18
       Fresh serde_derive v1.0.126
       Fresh dirs-next v2.0.0
       Fresh regex v1.5.4
       Fresh derive-new v0.5.9
       Fresh serde v1.0.126
       Fresh term v0.7.0
       Fresh serde_json v1.0.64
    Checking wink v0.1.0 (/mnt/c/temp/wink)
     Running `rustc --crate-name wink --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 -C metadata=d401c06dfe575890 -C extra-filename=-d401c06dfe575890 --out-dir /tmp/debug/deps -C incremental=/tmp/debug/incremental -L dependency=/tmp/debug/deps --extern derive_new=/tmp/debug/deps/libderive_new-f4a32d1b166a72c0.so --extern regex=/tmp/debug/deps/libregex-ce229bf00f1a9055.rmeta --extern serde=/tmp/debug/deps/libserde-5e0466a5ac1608e4.rmeta --extern serde_json=/tmp/debug/deps/libserde_json-0895eb5a0ecbdb48.rmeta --extern term=/tmp/debug/deps/libterm-b1d31558e3368d28.rmeta`
     Running `rustc --crate-name wink --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 -C metadata=186c7c3475d472ea -C extra-filename=-186c7c3475d472ea --out-dir /tmp/debug/deps -C incremental=/tmp/debug/incremental -L dependency=/tmp/debug/deps --extern derive_new=/tmp/debug/deps/libderive_new-f4a32d1b166a72c0.so --extern regex=/tmp/debug/deps/libregex-ce229bf00f1a9055.rmeta --extern serde=/tmp/debug/deps/libserde-5e0466a5ac1608e4.rmeta --extern serde_json=/tmp/debug/deps/libserde_json-0895eb5a0ecbdb48.rmeta --extern term=/tmp/debug/deps/libterm-b1d31558e3368d28.rmeta --extern wink=/tmp/debug/deps/libwink-d401c06dfe575890.rmeta`
    Finished dev [unoptimized + debuginfo] target(s) in 0.94s
0.77user 0.11system 0:01.06elapsed 83%CPU (0avgtext+0avgdata 184256maxresident)k
0inputs+672outputs (0major+46673minor)pagefaults 0swaps
+ [ 0 -ne 0 ]
+ echo Fresh unicode-xid v0.2.2 Fresh cfg-if v1.0.0 Fresh itoa v0.4.7 Fresh regex-syntax v0.6.25 Fresh proc-macro2 v1.0.27 Fresh quote v1.0.9 Fresh libc v0.2.97 Fresh memchr v2.4.0 Fresh ryu v1.0.5 Fresh syn v1.0.73 Fresh dirs-sys-next v0.1.2 Fresh aho-corasick v0.7.18 Fresh serde_derive+  v1.0.126 Fresh dirs-next v2.0.0 Fresh regex v1.5.4 Fresh derive-new v0.5.9 Fresh serde v1.0.126 Fresh termegrep v0.7.0 Fresh -qi serde_json v1.0.64 error|warning Checking
 wink v0.1.0 (/mnt/c/temp/wink) Running `rustc --crate-name wink --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 -C metadata=d401c06dfe575890 -C extra-filename=-d401c06dfe575890 --out-dir /tmp/debug/deps -C incremental=/tmp/debug/incremental -L dependency=/tmp/debug/deps --extern derive_new=/tmp/debug/deps/libderive_new-f4a32d1b166a72c0.so --extern regex=/tmp/debug/deps/libregex-ce229bf00f1a9055.rmeta --extern serde=/tmp/debug/deps/libserde-5e0466a5ac1608e4.rmeta --extern serde_json=/tmp/debug/deps/libserde_json-0895eb5a0ecbdb48.rmeta --extern term=/tmp/debug/deps/libterm-b1d31558e3368d28.rmeta` Running `rustc --crate-name wink --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 -C metadata=186c7c3475d472ea -C extra-filename=-186c7c3475d472ea --out-dir /tmp/debug/deps -C incremental=/tmp/debug/incremental -L dependency=/tmp/debug/deps --extern derive_new=/tmp/debug/deps/libderive_new-f4a32d1b166a72c0.so --extern regex=/tmp/debug/deps/libregex-ce229bf00f1a9055.rmeta --extern serde=/tmp/debug/deps/libserde-5e0466a5ac1608e4.rmeta --extern serde_json=/tmp/debug/deps/libserde_json-0895eb5a0ecbdb48.rmeta --extern term=/tmp/debug/deps/libterm-b1d31558e3368d28.rmeta --extern wink=/tmp/debug/deps/libwink-d401c06dfe575890.rmeta` Finished dev [unoptimized + debuginfo] target(s) in 0.94s 0.77user 0.11system 0:01.06elapsed 83%CPU (0avgtext+0avgdata 184256maxresident)k 0inputs+672outputs (0major+46673minor)pagefaults 0swaps
+ time time cargo check -v --workspace --all-features
+ tee /dev/fd/2
       Fresh unicode-xid v0.2.2
       Fresh cfg-if v1.0.0
       Fresh itoa v0.4.7
       Fresh regex-syntax v0.6.25
       Fresh proc-macro2 v1.0.27
       Fresh quote v1.0.9
       Fresh libc v0.2.97
       Fresh memchr v2.4.0
       Fresh ryu v1.0.5
       Fresh syn v1.0.73
       Fresh dirs-sys-next v0.1.2
       Fresh aho-corasick v0.7.18
       Fresh serde_derive v1.0.126
       Fresh dirs-next v2.0.0
       Fresh derive-new v0.5.9
       Fresh regex v1.5.4
       Fresh serde v1.0.126
       Fresh term v0.7.0
       Fresh serde_json v1.0.64
       Fresh wink v0.1.0 (/mnt/c/temp/wink)
    Finished dev [unoptimized + debuginfo] target(s) in 0.06s
0.08user 0.00system 0:00.13elapsed 68%CPU (0avgtext+0avgdata 18676maxresident)k
0inputs+0outputs (0major+4848minor)pagefaults 0swaps
0.08user 0.00system 0:00.13elapsed 69%CPU (0avgtext+0avgdata 18676maxresident)k
0inputs+0outputs (0major+4933minor)pagefaults 0swaps
+ result=       Fresh unicode-xid v0.2.2
       Fresh cfg-if v1.0.0
       Fresh itoa v0.4.7
       Fresh regex-syntax v0.6.25
       Fresh proc-macro2 v1.0.27
       Fresh quote v1.0.9
       Fresh libc v0.2.97
       Fresh memchr v2.4.0
       Fresh ryu v1.0.5
       Fresh syn v1.0.73
       Fresh dirs-sys-next v0.1.2
       Fresh aho-corasick v0.7.18
       Fresh serde_derive v1.0.126
       Fresh dirs-next v2.0.0
       Fresh derive-new v0.5.9
       Fresh regex v1.5.4
       Fresh serde v1.0.126
       Fresh term v0.7.0
       Fresh serde_json v1.0.64
       Fresh wink v0.1.0 (/mnt/c/temp/wink)
    Finished dev [unoptimized + debuginfo] target(s) in 0.06s
0.08user 0.00system 0:00.13elapsed 68%CPU (0avgtext+0avgdata 18676maxresident)k
0inputs+0outputs (0major+4848minor)pagefaults 0swaps
0.08user 0.00system 0:00.13elapsed 69%CPU (0avgtext+0avgdata 18676maxresident)k
0inputs+0outputs (0major+4933minor)pagefaults 0swaps
+ [ 0 -ne 0 ]
+ + echoegrep Fresh unicode-xid -qi v0.2.2 error|warning Fresh
 cfg-if v1.0.0 Fresh itoa v0.4.7 Fresh regex-syntax v0.6.25 Fresh proc-macro2 v1.0.27 Fresh quote v1.0.9 Fresh libc v0.2.97 Fresh memchr v2.4.0 Fresh ryu v1.0.5 Fresh syn v1.0.73 Fresh dirs-sys-next v0.1.2 Fresh aho-corasick v0.7.18 Fresh serde_derive v1.0.126 Fresh dirs-next v2.0.0 Fresh derive-new v0.5.9 Fresh regex v1.5.4 Fresh serde v1.0.126 Fresh term v0.7.0 Fresh serde_json v1.0.64 Fresh wink v0.1.0 (/mnt/c/temp/wink) Finished dev [unoptimized + debuginfo] target(s) in 0.06s 0.08user 0.00system 0:00.13elapsed 68%CPU (0avgtext+0avgdata 18676maxresident)k 0inputs+0outputs (0major+4848minor)pagefaults 0swaps 0.08user 0.00system 0:00.13elapsed 69%CPU (0avgtext+0avgdata 18676maxresident)k 0inputs+0outputs (0major+4933minor)pagefaults 0swaps
+ time find . -type f ( -iname *.rs -not -iname invocablecategory.rs ) -exec rustfmt -l -v {} ;
+ tee /dev/fd/2
Formatting /mnt/c/temp/wink/src/helperror.rs
Spent 0.003 secs in the parsing phase, and 0.000 secs in the formatting phase
Formatting /mnt/c/temp/wink/src/helperror.rs
Formatting /mnt/c/temp/wink/src/lib.rs
Formatting /mnt/c/temp/wink/src/winkconfig.rs
Formatting /mnt/c/temp/wink/src/wsl/inv/invocable.rs
Formatting /mnt/c/temp/wink/src/wsl/inv/invocablecategory.rs
/mnt/c/temp/wink/src/wsl/inv/invocablecategory.rs
Formatting /mnt/c/temp/wink/src/wsl/inv/invocablecategorylist.rs
Formatting /mnt/c/temp/wink/src/wsl/inv/invoker.rs
Formatting /mnt/c/temp/wink/src/wsl/inv.rs
Formatting /mnt/c/temp/wink/src/wsl.rs
Spent 0.058 secs in the parsing phase, and 0.025 secs in the formatting phase
Formatting /mnt/c/temp/wink/src/main.rs
Spent 0.004 secs in the parsing phase, and 0.000 secs in the formatting phase
Formatting /mnt/c/temp/wink/src/winkconfig.rs
Spent 0.004 secs in the parsing phase, and 0.002 secs in the formatting phase
Formatting /mnt/c/temp/wink/src/wsl/inv/invocable.rs
Spent 0.003 secs in the parsing phase, and 0.001 secs in the formatting phase
Formatting /mnt/c/temp/wink/src/wsl/inv/invocablecategorylist.rs
Spent 0.002 secs in the parsing phase, and 0.001 secs in the formatting phase
Formatting /mnt/c/temp/wink/src/wsl/inv/invoker.rs
Spent 0.003 secs in the parsing phase, and 0.001 secs in the formatting phase
Formatting /mnt/c/temp/wink/src/wsl/inv/invocable.rs
Formatting /mnt/c/temp/wink/src/wsl/inv/invocablecategory.rs
Formatting /mnt/c/temp/wink/src/wsl/inv/invocablecategorylist.rs
Formatting /mnt/c/temp/wink/src/wsl/inv/invoker.rs
Formatting /mnt/c/temp/wink/src/wsl/inv.rs
Spent 0.025 secs in the parsing phase, and 0.010 secs in the formatting phase
Formatting /mnt/c/temp/wink/src/wsl/inv/invocable.rs
Formatting /mnt/c/temp/wink/src/wsl/inv/invocablecategory.rs
Formatting /mnt/c/temp/wink/src/wsl/inv/invocablecategorylist.rs
Formatting /mnt/c/temp/wink/src/wsl/inv/invoker.rs
Formatting /mnt/c/temp/wink/src/wsl/inv.rs
Formatting /mnt/c/temp/wink/src/wsl.rs
Spent 0.038 secs in the parsing phase, and 0.011 secs in the formatting phase
0.75user 0.22system 0:01.79elapsed 54%CPU (0avgtext+0avgdata 18880maxresident)k
0inputs+0outputs (0major+36887minor)pagefaults 0swaps
+ result=0.75user 0.22system 0:01.79elapsed 54%CPU (0avgtext+0avgdata 18880maxresident)k
0inputs+0outputs (0major+36887minor)pagefaults 0swaps
+ [ 0 -ne 0 ]
+ echo 0.75user 0.22system 0:01.79elapsed 54%CPU (0avgtext+0avgdata+  18880maxresident)k 0inputs+0outputs (0major+36887minor)pagefaults 0swaps
egrep -qi error|warning
+ rustfmt -l -v --config max_width=2500 ./src/wsl/inv/invocablecategory.rs
Formatting /mnt/c/temp/wink/src/wsl/inv/invocablecategory.rs
/mnt/c/temp/wink/src/wsl/inv/invocablecategory.rs
Spent 0.007 secs in the parsing phase, and 0.013 secs in the formatting phase
+ set +x
-rwxrwxrwx 1 jw jw   432 Jun 24 17:01 ./src/helperror.rs
-rwxrwxrwx 1 jw jw  7302 Jun 24 16:17 ./src/lib.rs
-rwxrwxrwx 1 jw jw  1612 Jun 24 16:15 ./src/main.rs
-rwxrwxrwx 1 jw jw  6375 Jun 24 16:32 ./src/winkconfig.rs
-rwxrwxrwx 1 jw jw  3735 Jun 24 17:01 ./src/wsl.rs
-rwxrwxrwx 1 jw jw    94 Jun 21 06:40 ./src/wsl/inv.rs
-rwxrwxrwx 1 jw jw  7081 Jun 23 10:48 ./src/wsl/inv/invocable.rs
-rwxrwxrwx 1 jw jw 53405 Jun 24 20:37 ./src/wsl/inv/invocablecategory.rs
-rwxrwxrwx 1 jw jw  6725 Jun 23 16:30 ./src/wsl/inv/invocablecategorylist.rs
-rwxrwxrwx 1 jw jw  8054 Jun 23 11:05 ./src/wsl/inv/invoker.rs
   22    57   432 ./src/helperror.rs
  218   611  7302 ./src/lib.rs
   26   214  1612 ./src/main.rs
  176   684  6375 ./src/winkconfig.rs
  199   850  7081 ./src/wsl/inv/invocable.rs
  611  3319 53405 ./src/wsl/inv/invocablecategory.rs
  157   490  6725 ./src/wsl/inv/invocablecategorylist.rs
  219   711  8054 ./src/wsl/inv/invoker.rs
    4    12    94 ./src/wsl/inv.rs
  142   403  3735 ./src/wsl.rs
 1774  7351 94815 total
+ cargo update -v
    Updating crates.io index
+ cmd=time cargo-clippy -v
+ time cargo-clippy -v
+ tee /dev/fd/2
    Checking wink v0.1.0 (/mnt/c/temp/wink)
    Finished dev [unoptimized + debuginfo] target(s) in 0.77s
0.64user 0.09system 0:00.89elapsed 82%CPU (0avgtext+0avgdata 174072maxresident)k
0inputs+672outputs (0major+42528minor)pagefaults 0swaps
+ result=    Checking wink v0.1.0 (/mnt/c/temp/wink)
    Finished dev [unoptimized + debuginfo] target(s) in 0.77s
0.64user 0.09system 0:00.89elapsed 82%CPU (0avgtext+0avgdata 174072maxresident)k
0inputs+672outputs (0major+42528minor)pagefaults 0swaps
+ [ 0 -ne 0 ]
+ echo Checking+  wink v0.1.0 (/mnt/c/temp/wink) Finished dev [unoptimized + debuginfo]egrep target(s) -qi in error|warning 0.77s
 0.64user 0.09system 0:00.89elapsed 82%CPU (0avgtext+0avgdata 174072maxresident)k 0inputs+672outputs (0major+42528minor)pagefaults 0swaps
+ cmd=time cargo test -v --workspace --all-features --target-dir /tmp/wink.build -- --nocapture -- -epdv word a b c
+ time cargo test -v --workspace --all-features --target-dir /tmp/wink.build -- --nocapture -- -epdv word a b c
+ tee /dev/fd/2
       Fresh unicode-xid v0.2.2
       Fresh cfg-if v1.0.0
       Fresh itoa v0.4.7
       Fresh regex-syntax v0.6.25
       Fresh proc-macro2 v1.0.27
       Fresh quote v1.0.9
       Fresh libc v0.2.97
       Fresh memchr v2.4.0
       Fresh ryu v1.0.5
       Fresh syn v1.0.73
       Fresh dirs-sys-next v0.1.2
       Fresh aho-corasick v0.7.18
       Fresh serde_derive v1.0.126
       Fresh dirs-next v2.0.0
       Fresh derive-new v0.5.9
       Fresh regex v1.5.4
       Fresh serde v1.0.126
       Fresh term v0.7.0
       Fresh serde_json v1.0.64
   Compiling wink v0.1.0 (/mnt/c/temp/wink)
     Running `rustc --crate-name wink --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --test -C metadata=2c659bbd243ff8ff -C extra-filename=-2c659bbd243ff8ff --out-dir /tmp/wink.build/debug/deps -C incremental=/tmp/wink.build/debug/incremental -L dependency=/tmp/wink.build/debug/deps --extern derive_new=/tmp/wink.build/debug/deps/libderive_new-f4a32d1b166a72c0.so --extern regex=/tmp/wink.build/debug/deps/libregex-b3cf7363a6486908.rlib --extern serde=/tmp/wink.build/debug/deps/libserde-914d23fcdc0943b9.rlib --extern serde_json=/tmp/wink.build/debug/deps/libserde_json-00a0ad80c3255f73.rlib --extern term=/tmp/wink.build/debug/deps/libterm-7bf2457214a941c6.rlib`
     Running `rustc --crate-name wink --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=8ce63657ac21f2ba -C extra-filename=-8ce63657ac21f2ba --out-dir /tmp/wink.build/debug/deps -C incremental=/tmp/wink.build/debug/incremental -L dependency=/tmp/wink.build/debug/deps --extern derive_new=/tmp/wink.build/debug/deps/libderive_new-f4a32d1b166a72c0.so --extern regex=/tmp/wink.build/debug/deps/libregex-b3cf7363a6486908.rmeta --extern serde=/tmp/wink.build/debug/deps/libserde-914d23fcdc0943b9.rmeta --extern serde_json=/tmp/wink.build/debug/deps/libserde_json-00a0ad80c3255f73.rmeta --extern term=/tmp/wink.build/debug/deps/libterm-7bf2457214a941c6.rmeta`
     Running `rustc --crate-name wink --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --test -C metadata=442d9986badfd864 -C extra-filename=-442d9986badfd864 --out-dir /tmp/wink.build/debug/deps -C incremental=/tmp/wink.build/debug/incremental -L dependency=/tmp/wink.build/debug/deps --extern derive_new=/tmp/wink.build/debug/deps/libderive_new-f4a32d1b166a72c0.so --extern regex=/tmp/wink.build/debug/deps/libregex-b3cf7363a6486908.rlib --extern serde=/tmp/wink.build/debug/deps/libserde-914d23fcdc0943b9.rlib --extern serde_json=/tmp/wink.build/debug/deps/libserde_json-00a0ad80c3255f73.rlib --extern term=/tmp/wink.build/debug/deps/libterm-7bf2457214a941c6.rlib --extern wink=/tmp/wink.build/debug/deps/libwink-8ce63657ac21f2ba.rlib`
    Finished test [unoptimized + debuginfo] target(s) in 1.82s
     Running `/tmp/wink.build/debug/deps/wink-2c659bbd243ff8ff --nocapture -- -epdv word a b c`

running 6 tests
thread 'tests::it_has_a_path' panicked at 'it_has_a_path intentional panic to render path to parent of this tests module.', src/lib.rs:216:9
thread 'stack backtrace:
winkconfig::tests::it_has_a_path' panicked at 'it_has_a_path intentional panic to render path to parent of this tests module.', src/winkconfig.rs:wsl::tests::fail()
174:9
wsl::tests::get_user_home_default()
thread 'wsl::tests::fail' panicked at 'wsl::tests::fail()', src/wsl.rs:89:9
test wsl::tests::get_user_home_default ... ok
it_gets_from_command_line_args: {
  "cmd_name": "wink-2c659bbd243ff8ff",
  "verbose": true,
  "dry_run": true,
  "command_code": "word",
  "export": true,
  "pretty_print": true,
  "all_args": [
    "/tmp/wink.build/debug/deps/wink-2c659bbd243ff8ff",
    "--",
    "-epdv",
    "word",
    "a",
    "b",
    "c"
  ],
  "cmd_args": [
    "a",
    "b",
    "c"
  ]
}
     Running `/tmp/wink.build/debug/deps/wink-442d9986badfd864 --nocapture -- -epdv word a b c`

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests wink
     Running `rustdoc --edition=2018 --crate-type lib --crate-name wink --test /mnt/c/temp/wink/src/lib.rs -L dependency=/tmp/wink.build/debug/deps -L dependency=/tmp/wink.build/debug/deps --test-args --nocapture --test-args -- --test-args -epdv --test-args word --test-args a --test-args b --test-args c --extern derive_new=/tmp/wink.build/debug/deps/libderive_new-f4a32d1b166a72c0.so --extern regex=/tmp/wink.build/debug/deps/libregex-b3cf7363a6486908.rlib --extern serde=/tmp/wink.build/debug/deps/libserde-914d23fcdc0943b9.rlib --extern serde_json=/tmp/wink.build/debug/deps/libserde_json-00a0ad80c3255f73.rlib --extern term=/tmp/wink.build/debug/deps/libterm-7bf2457214a941c6.rlib --extern wink=/tmp/wink.build/debug/deps/libwink-8ce63657ac21f2ba.rlib -C embed-bitcode=no --error-format human`

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

4.17user 0.65system 0:02.10elapsed 229%CPU (0avgtext+0avgdata 247328maxresident)k
0inputs+69696outputs (0major+104425minor)pagefaults 0swaps
+ result=       Fresh unicode-xid v0.2.2
       Fresh cfg-if v1.0.0
       Fresh itoa v0.4.7
       Fresh regex-syntax v0.6.25
       Fresh proc-macro2 v1.0.27
       Fresh quote v1.0.9
       Fresh libc v0.2.97
       Fresh memchr v2.4.0
       Fresh ryu v1.0.5
       Fresh syn v1.0.73
       Fresh dirs-sys-next v0.1.2
       Fresh aho-corasick v0.7.18
       Fresh serde_derive v1.0.126
       Fresh dirs-next v2.0.0
       Fresh derive-new v0.5.9
       Fresh regex v1.5.4
       Fresh serde v1.0.126
       Fresh term v0.7.0
       Fresh serde_json v1.0.64
   Compiling wink v0.1.0 (/mnt/c/temp/wink)
     Running `rustc --crate-name wink --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --test -C metadata=2c659bbd243ff8ff -C extra-filename=-2c659bbd243ff8ff --out-dir /tmp/wink.build/debug/deps -C incremental=/tmp/wink.build/debug/incremental -L dependency=/tmp/wink.build/debug/deps --extern derive_new=/tmp/wink.build/debug/deps/libderive_new-f4a32d1b166a72c0.so --extern regex=/tmp/wink.build/debug/deps/libregex-b3cf7363a6486908.rlib --extern serde=/tmp/wink.build/debug/deps/libserde-914d23fcdc0943b9.rlib --extern serde_json=/tmp/wink.build/debug/deps/libserde_json-00a0ad80c3255f73.rlib --extern term=/tmp/wink.build/debug/deps/libterm-7bf2457214a941c6.rlib`
     Running `rustc --crate-name wink --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=8ce63657ac21f2ba -C extra-filename=-8ce63657ac21f2ba --out-dir /tmp/wink.build/debug/deps -C incremental=/tmp/wink.build/debug/incremental -L dependency=/tmp/wink.build/debug/deps --extern derive_new=/tmp/wink.build/debug/deps/libderive_new-f4a32d1b166a72c0.so --extern regex=/tmp/wink.build/debug/deps/libregex-b3cf7363a6486908.rmeta --extern serde=/tmp/wink.build/debug/deps/libserde-914d23fcdc0943b9.rmeta --extern serde_json=/tmp/wink.build/debug/deps/libserde_json-00a0ad80c3255f73.rmeta --extern term=/tmp/wink.build/debug/deps/libterm-7bf2457214a941c6.rmeta`
     Running `rustc --crate-name wink --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --test -C metadata=442d9986badfd864 -C extra-filename=-442d9986badfd864 --out-dir /tmp/wink.build/debug/deps -C incremental=/tmp/wink.build/debug/incremental -L dependency=/tmp/wink.build/debug/deps --extern derive_new=/tmp/wink.build/debug/deps/libderive_new-f4a32d1b166a72c0.so --extern regex=/tmp/wink.build/debug/deps/libregex-b3cf7363a6486908.rlib --extern serde=/tmp/wink.build/debug/deps/libserde-914d23fcdc0943b9.rlib --extern serde_json=/tmp/wink.build/debug/deps/libserde_json-00a0ad80c3255f73.rlib --extern term=/tmp/wink.build/debug/deps/libterm-7bf2457214a941c6.rlib --extern wink=/tmp/wink.build/debug/deps/libwink-8ce63657ac21f2ba.rlib`
    Finished test [unoptimized + debuginfo] target(s) in 1.82s
     Running `/tmp/wink.build/debug/deps/wink-2c659bbd243ff8ff --nocapture -- -epdv word a b c`
thread 'tests::it_has_a_path' panicked at 'it_has_a_path intentional panic to render path to parent of this tests module.', src/lib.rs:216:9
thread 'stack backtrace:
winkconfig::tests::it_has_a_path' panicked at 'it_has_a_path intentional panic to render path to parent of this tests module.', src/winkconfig.rs:174:9
thread 'wsl::tests::fail' panicked at 'wsl::tests::fail()', src/wsl.rs:89:9
     Running `/tmp/wink.build/debug/deps/wink-442d9986badfd864 --nocapture -- -epdv word a b c`
   Doc-tests wink
     Running `rustdoc --edition=2018 --crate-type lib --crate-name wink --test /mnt/c/temp/wink/src/lib.rs -L dependency=/tmp/wink.build/debug/deps -L dependency=/tmp/wink.build/debug/deps --test-args --nocapture --test-args -- --test-args -epdv --test-args word --test-args a --test-args b --test-args c --extern derive_new=/tmp/wink.build/debug/deps/libderive_new-f4a32d1b166a72c0.so --extern regex=/tmp/wink.build/debug/deps/libregex-b3cf7363a6486908.rlib --extern serde=/tmp/wink.build/debug/deps/libserde-914d23fcdc0943b9.rlib --extern serde_json=/tmp/wink.build/debug/deps/libserde_json-00a0ad80c3255f73.rlib --extern term=/tmp/wink.build/debug/deps/libterm-7bf2457214a941c6.rlib --extern wink=/tmp/wink.build/debug/deps/libwink-8ce63657ac21f2ba.rlib -C embed-bitcode=no --error-format human`
4.17user 0.65system 0:02.10elapsed 229%CPU (0avgtext+0avgdata 247328maxresident)k
0inputs+69696outputs (0major+104425minor)pagefaults 0swaps
+ [ 0 -ne 0 ]
+ egrep -qi could not compile|warning|test result. FAILED|error. test failed
+ echo Fresh unicode-xid v0.2.2 Fresh cfg-if v1.0.0 Fresh itoa v0.4.7 Fresh regex-syntax v0.6.25 Fresh proc-macro2 v1.0.27 Fresh quote v1.0.9 Fresh libc v0.2.97 Fresh memchr v2.4.0 Fresh ryu v1.0.5 Fresh syn v1.0.73 Fresh dirs-sys-next v0.1.2 Fresh aho-corasick v0.7.18 Fresh serde_derive v1.0.126 Fresh dirs-next v2.0.0 Fresh derive-new v0.5.9 Fresh regex v1.5.4 Fresh serde v1.0.126 Fresh term v0.7.0 Fresh serde_json v1.0.64 Compiling wink v0.1.0 (/mnt/c/temp/wink) Running `rustc --crate-name wink --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --test -C metadata=2c659bbd243ff8ff -C extra-filename=-2c659bbd243ff8ff --out-dir /tmp/wink.build/debug/deps -C incremental=/tmp/wink.build/debug/incremental -L dependency=/tmp/wink.build/debug/deps --extern derive_new=/tmp/wink.build/debug/deps/libderive_new-f4a32d1b166a72c0.so --extern regex=/tmp/wink.build/debug/deps/libregex-b3cf7363a6486908.rlib --extern serde=/tmp/wink.build/debug/deps/libserde-914d23fcdc0943b9.rlib --extern serde_json=/tmp/wink.build/debug/deps/libserde_json-00a0ad80c3255f73.rlib --extern term=/tmp/wink.build/debug/deps/libterm-7bf2457214a941c6.rlib` Running `rustc --crate-name wink --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=8ce63657ac21f2ba -C extra-filename=-8ce63657ac21f2ba --out-dir /tmp/wink.build/debug/deps -C incremental=/tmp/wink.build/debug/incremental -L dependency=/tmp/wink.build/debug/deps --extern derive_new=/tmp/wink.build/debug/deps/libderive_new-f4a32d1b166a72c0.so --extern regex=/tmp/wink.build/debug/deps/libregex-b3cf7363a6486908.rmeta --extern serde=/tmp/wink.build/debug/deps/libserde-914d23fcdc0943b9.rmeta --extern serde_json=/tmp/wink.build/debug/deps/libserde_json-00a0ad80c3255f73.rmeta --extern term=/tmp/wink.build/debug/deps/libterm-7bf2457214a941c6.rmeta` Running `rustc --crate-name wink --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --test -C metadata=442d9986badfd864 -C extra-filename=-442d9986badfd864 --out-dir /tmp/wink.build/debug/deps -C incremental=/tmp/wink.build/debug/incremental -L dependency=/tmp/wink.build/debug/deps --extern derive_new=/tmp/wink.build/debug/deps/libderive_new-f4a32d1b166a72c0.so --extern regex=/tmp/wink.build/debug/deps/libregex-b3cf7363a6486908.rlib --extern serde=/tmp/wink.build/debug/deps/libserde-914d23fcdc0943b9.rlib --extern serde_json=/tmp/wink.build/debug/deps/libserde_json-00a0ad80c3255f73.rlib --extern term=/tmp/wink.build/debug/deps/libterm-7bf2457214a941c6.rlib --extern wink=/tmp/wink.build/debug/deps/libwink-8ce63657ac21f2ba.rlib` Finished test [unoptimized + debuginfo] target(s) in 1.82s Running `/tmp/wink.build/debug/deps/wink-2c659bbd243ff8ff --nocapture -- -epdv word a b c` thread 'tests::it_has_a_path' panicked at 'it_has_a_path intentional panic to render path to parent of this tests module.', src/lib.rs:216:9 thread 'stack backtrace: winkconfig::tests::it_has_a_path' panicked at 'it_has_a_path intentional panic to render path to parent of this tests module.', src/winkconfig.rs:174:9 thread 'wsl::tests::fail' panicked at 'wsl::tests::fail()', src/wsl.rs:89:9 Running `/tmp/wink.build/debug/deps/wink-442d9986badfd864 --nocapture -- -epdv word a b c` Doc-tests wink Running `rustdoc --edition=2018 --crate-type lib --crate-name wink --test /mnt/c/temp/wink/src/lib.rs -L dependency=/tmp/wink.build/debug/deps -L dependency=/tmp/wink.build/debug/deps --test-args --nocapture --test-args -- --test-args -epdv --test-args word --test-args a --test-args b --test-args c --extern derive_new=/tmp/wink.build/debug/deps/libderive_new-f4a32d1b166a72c0.so --extern regex=/tmp/wink.build/debug/deps/libregex-b3cf7363a6486908.rlib --extern serde=/tmp/wink.build/debug/deps/libserde-914d23fcdc0943b9.rlib --extern serde_json=/tmp/wink.build/debug/deps/libserde_json-00a0ad80c3255f73.rlib --extern term=/tmp/wink.build/debug/deps/libterm-7bf2457214a941c6.rlib --extern wink=/tmp/wink.build/debug/deps/libwink-8ce63657ac21f2ba.rlib -C embed-bitcode=no --error-format human` 4.17user 0.65system 0:02.10elapsed 229%CPU (0avgtext+0avgdata 247328maxresident)k 0inputs+69696outputs (0major+104425minor)pagefaults 0swaps
+ cmd=time cargo build -v --target-dir /tmp/wink.build --release
+ time cargo build -v --target-dir /tmp/wink.build --release
+ tee /dev/fd/2
       Fresh unicode-xid v0.2.2
       Fresh cfg-if v1.0.0
       Fresh regex-syntax v0.6.25
       Fresh itoa v0.4.7
       Fresh proc-macro2 v1.0.27
       Fresh quote v1.0.9
       Fresh libc v0.2.97
       Fresh memchr v2.4.0
       Fresh ryu v1.0.5
       Fresh syn v1.0.73
       Fresh dirs-sys-next v0.1.2
       Fresh aho-corasick v0.7.18
       Fresh serde_derive v1.0.126
       Fresh dirs-next v2.0.0
       Fresh regex v1.5.4
       Fresh derive-new v0.5.9
       Fresh serde v1.0.126
       Fresh term v0.7.0
       Fresh serde_json v1.0.64
   Compiling wink v0.1.0 (/mnt/c/temp/wink)
     Running `rustc --crate-name wink --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=4cb40f2fac1cd51f -C extra-filename=-4cb40f2fac1cd51f --out-dir /tmp/wink.build/release/deps -L dependency=/tmp/wink.build/release/deps --extern derive_new=/tmp/wink.build/release/deps/libderive_new-590e687adc52fd7b.so --extern regex=/tmp/wink.build/release/deps/libregex-d77a181d4ffe1a8f.rmeta --extern serde=/tmp/wink.build/release/deps/libserde-2032a7dd4fa55574.rmeta --extern serde_json=/tmp/wink.build/release/deps/libserde_json-a846dacdde46c89d.rmeta --extern term=/tmp/wink.build/release/deps/libterm-b564b897c8d84976.rmeta`
     Running `rustc --crate-name wink --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C metadata=64fa342bc94534f1 -C extra-filename=-64fa342bc94534f1 --out-dir /tmp/wink.build/release/deps -L dependency=/tmp/wink.build/release/deps --extern derive_new=/tmp/wink.build/release/deps/libderive_new-590e687adc52fd7b.so --extern regex=/tmp/wink.build/release/deps/libregex-d77a181d4ffe1a8f.rlib --extern serde=/tmp/wink.build/release/deps/libserde-2032a7dd4fa55574.rlib --extern serde_json=/tmp/wink.build/release/deps/libserde_json-a846dacdde46c89d.rlib --extern term=/tmp/wink.build/release/deps/libterm-b564b897c8d84976.rlib --extern wink=/tmp/wink.build/release/deps/libwink-4cb40f2fac1cd51f.rlib`
    Finished release [optimized] target(s) in 2.72s
9.52user 0.28system 0:02.79elapsed 350%CPU (0avgtext+0avgdata 285136maxresident)k
0inputs+16944outputs (0major+71278minor)pagefaults 0swaps
+ result=       Fresh unicode-xid v0.2.2
       Fresh cfg-if v1.0.0
       Fresh regex-syntax v0.6.25
       Fresh itoa v0.4.7
       Fresh proc-macro2 v1.0.27
       Fresh quote v1.0.9
       Fresh libc v0.2.97
       Fresh memchr v2.4.0
       Fresh ryu v1.0.5
       Fresh syn v1.0.73
       Fresh dirs-sys-next v0.1.2
       Fresh aho-corasick v0.7.18
       Fresh serde_derive v1.0.126
       Fresh dirs-next v2.0.0
       Fresh regex v1.5.4
       Fresh derive-new v0.5.9
       Fresh serde v1.0.126
       Fresh term v0.7.0
       Fresh serde_json v1.0.64
   Compiling wink v0.1.0 (/mnt/c/temp/wink)
     Running `rustc --crate-name wink --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=4cb40f2fac1cd51f -C extra-filename=-4cb40f2fac1cd51f --out-dir /tmp/wink.build/release/deps -L dependency=/tmp/wink.build/release/deps --extern derive_new=/tmp/wink.build/release/deps/libderive_new-590e687adc52fd7b.so --extern regex=/tmp/wink.build/release/deps/libregex-d77a181d4ffe1a8f.rmeta --extern serde=/tmp/wink.build/release/deps/libserde-2032a7dd4fa55574.rmeta --extern serde_json=/tmp/wink.build/release/deps/libserde_json-a846dacdde46c89d.rmeta --extern term=/tmp/wink.build/release/deps/libterm-b564b897c8d84976.rmeta`
     Running `rustc --crate-name wink --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C metadata=64fa342bc94534f1 -C extra-filename=-64fa342bc94534f1 --out-dir /tmp/wink.build/release/deps -L dependency=/tmp/wink.build/release/deps --extern derive_new=/tmp/wink.build/release/deps/libderive_new-590e687adc52fd7b.so --extern regex=/tmp/wink.build/release/deps/libregex-d77a181d4ffe1a8f.rlib --extern serde=/tmp/wink.build/release/deps/libserde-2032a7dd4fa55574.rlib --extern serde_json=/tmp/wink.build/release/deps/libserde_json-a846dacdde46c89d.rlib --extern term=/tmp/wink.build/release/deps/libterm-b564b897c8d84976.rlib --extern wink=/tmp/wink.build/release/deps/libwink-4cb40f2fac1cd51f.rlib`
    Finished release [optimized] target(s) in 2.72s
9.52user 0.28system 0:02.79elapsed 350%CPU (0avgtext+0avgdata 285136maxresident)k
0inputs+16944outputs (0major+71278minor)pagefaults 0swaps
+ [ 0 -ne 0 ]
+ sed -e s/error.format/3rror.format/g
+ egrep -qi error|warning
+ echo Fresh unicode-xid v0.2.2 Fresh cfg-if v1.0.0 Fresh regex-syntax v0.6.25 Fresh itoa v0.4.7 Fresh proc-macro2 v1.0.27 Fresh quote v1.0.9 Fresh libc v0.2.97 Fresh memchr v2.4.0 Fresh ryu v1.0.5 Fresh syn v1.0.73 Fresh dirs-sys-next v0.1.2 Fresh aho-corasick v0.7.18 Fresh serde_derive v1.0.126 Fresh dirs-next v2.0.0 Fresh regex v1.5.4 Fresh derive-new v0.5.9 Fresh serde v1.0.126 Fresh term v0.7.0 Fresh serde_json v1.0.64 Compiling wink v0.1.0 (/mnt/c/temp/wink) Running `rustc --crate-name wink --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=4cb40f2fac1cd51f -C extra-filename=-4cb40f2fac1cd51f --out-dir /tmp/wink.build/release/deps -L dependency=/tmp/wink.build/release/deps --extern derive_new=/tmp/wink.build/release/deps/libderive_new-590e687adc52fd7b.so --extern regex=/tmp/wink.build/release/deps/libregex-d77a181d4ffe1a8f.rmeta --extern serde=/tmp/wink.build/release/deps/libserde-2032a7dd4fa55574.rmeta --extern serde_json=/tmp/wink.build/release/deps/libserde_json-a846dacdde46c89d.rmeta --extern term=/tmp/wink.build/release/deps/libterm-b564b897c8d84976.rmeta` Running `rustc --crate-name wink --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C metadata=64fa342bc94534f1 -C extra-filename=-64fa342bc94534f1 --out-dir /tmp/wink.build/release/deps -L dependency=/tmp/wink.build/release/deps --extern derive_new=/tmp/wink.build/release/deps/libderive_new-590e687adc52fd7b.so --extern regex=/tmp/wink.build/release/deps/libregex-d77a181d4ffe1a8f.rlib --extern serde=/tmp/wink.build/release/deps/libserde-2032a7dd4fa55574.rlib --extern serde_json=/tmp/wink.build/release/deps/libserde_json-a846dacdde46c89d.rlib --extern term=/tmp/wink.build/release/deps/libterm-b564b897c8d84976.rlib --extern wink=/tmp/wink.build/release/deps/libwink-4cb40f2fac1cd51f.rlib` Finished release [optimized] target(s) in 2.72s 9.52user 0.28system 0:02.79elapsed 350%CPU (0avgtext+0avgdata 285136maxresident)k 0inputs+16944outputs (0major+71278minor)pagefaults 0swaps
+ time cargo doc -v --target-dir /tmp/wink.build
       Fresh unicode-xid v0.2.2
       Fresh cfg-if v1.0.0
       Fresh regex-syntax v0.6.25
       Fresh itoa v0.4.7
       Fresh proc-macro2 v1.0.27
       Fresh quote v1.0.9
       Fresh libc v0.2.97
       Fresh memchr v2.4.0
       Fresh ryu v1.0.5
       Fresh syn v1.0.73
       Fresh dirs-sys-next v0.1.2
       Fresh aho-corasick v0.7.18
       Fresh serde_derive v1.0.126
       Fresh dirs-next v2.0.0
       Fresh regex v1.5.4
       Fresh derive-new v0.5.9
       Fresh serde v1.0.126
       Fresh term v0.7.0
       Fresh serde_json v1.0.64
 Documenting wink v0.1.0 (/mnt/c/temp/wink)
     Running `rustdoc --edition=2018 --crate-type lib --crate-name wink src/lib.rs -o /tmp/wink.build/doc --error-format=json --json=diagnostic-rendered-ansi -L dependency=/tmp/wink.build/debug/deps --extern derive_new=/tmp/wink.build/debug/deps/libderive_new-f4a32d1b166a72c0.so --extern regex=/tmp/wink.build/debug/deps/libregex-ce229bf00f1a9055.rmeta --extern serde=/tmp/wink.build/debug/deps/libserde-5e0466a5ac1608e4.rmeta --extern serde_json=/tmp/wink.build/debug/deps/libserde_json-0895eb5a0ecbdb48.rmeta --extern term=/tmp/wink.build/debug/deps/libterm-b1d31558e3368d28.rmeta --crate-version 0.1.0`
    Finished dev [unoptimized + debuginfo] target(s) in 4.59s
0.89user 0.61system 0:04.68elapsed 32%CPU (0avgtext+0avgdata 319932maxresident)k
0inputs+8608outputs (0major+19940minor)pagefaults 0swaps
+ ls -l /tmp/wink.build/release/wink
-rwxr-xr-x 2 jw jw 5564440 Jun 24 20:37 /tmp/wink.build/release/wink
+ rm /home/jw/bin/wink
+ cp /tmp/wink.build/release/wink /home/jw/bin
+ time cargo.exe build --release --target-dir C:\temp\wink.build
   Compiling wink v0.1.0 (C:\temp\wink)
    Finished release [optimized] target(s) in 4.16s
0.00user 0.02system 0:04.43elapsed 0%CPU (0avgtext+0avgdata 1012maxresident)k
0inputs+0outputs (0major+85minor)pagefaults 0swaps
+ wslpath C:\temp\wink.build
+ /mnt/c/temp/wink.build/release/wink.exe -ep
+ ls -l /tmp/wink.build/doc/wink/wink.json
-rw-r--r-- 1 jw jw 168719 Jun 24 20:37 /tmp/wink.build/doc/wink/wink.json
+ cp /tmp/wink.build/doc/wink/wink.json .
+ cmd.exe /c echo %USERPROFILE%
+ sed -e s/\r//g
+ path=C:\Users\ms
+ wslpath C:\Users\ms
+ sed -e s/\r//g
+ path=/mnt/c/Users/ms/AppData/Local/Microsoft/WindowsApps
+ cp /mnt/c/temp/wink.build/release/wink.exe /mnt/c/Users/ms/AppData/Local/Microsoft/WindowsApps
+ time /home/jw/bin/wink -vepd word
{
  "command_code": "word",
  "description": "Microsoft Word",
  "command": "$pf64/Microsoft Office/root/Office16/WINWORD.EXE",
  "use_cmd": false,
  "use_start": false,
  "background": false,
  "use_call": false,
  "use_explorer": false,
  "use_bash": false,
  "arguments": []
}
/mnt/c/Program Files/Microsoft Office/root/Office16/WINWORD.EXE
0.03user 0.00system 0:00.16elapsed 25%CPU (0avgtext+0avgdata 3492maxresident)k
3816inputs+0outputs (20major+497minor)pagefaults 0swaps
+ cp /mnt/c/temp/wink/wince /home/jw/bin
+ cd -
+ exit 0

real    0m19.822s
user    0m17.165s
sys     0m2.292s
{
  "command_code": "word",
  "description": "Microsoft Word",
  "command": "$pf64/Microsoft Office/root/Office16/WINWORD.EXE",
  "use_cmd": false,
  "use_start": false,
  "background": false,
  "use_call": false,
  "use_explorer": false,
  "use_bash": false,
  "arguments": []
}
/mnt/c/Program Files/Microsoft Office/root/Office16/WINWORD.EXE

real    0m0.108s
user    0m0.010s
sys     0m0.009s

Or with no command line arguments, just wince.

output from wince

Here is the current complete output from wink help. Yes, I see many typos in all of this too.

[2021-06-24 22:08:37]:jw@HAL9000-6WQ9TQ2:/mnt/c/temp/wink
$ wink -help

-----------------------------------------------------------------------------
        wink : access  Windows and WSL features : Help requested by -help
-----------------------------------------------------------------------------
        wink : invoked as : wink -help
-----------------------------------------------------------------------------
        wink EXP                explorer.exe
-----------------------------------------------------------------------------
        wink EXP <file.ext>     Set/open default application for extension
        wink EXP <shell:sendto> Invoke command code (replace <shell:sendto>)
-----------------------------------------------------------------------------

-----------------------------------------------------------------------------
        wink CMD                cmd.exe /c
-----------------------------------------------------------------------------
        wink CMD <cmd> [args]   Invoke Windows console command line
        wink CMD echo %PATH%    Display Windows environment variable
-----------------------------------------------------------------------------

-----------------------------------------------------------------------------
        wink BASH               bash.exe -c
-----------------------------------------------------------------------------
        wink BASH /path [args]  Invoke shell command line
        wink BASH echo '$USER'  Display WSL environment variable
-----------------------------------------------------------------------------

-----------------------------------------------------------------------------
        wink CODE [args]        See command code tables below
-----------------------------------------------------------------------------

Applications
-----------------------------------------------------------------------------
                             7Z 7-Zip compressed file manager
                       AUDACITY Audacity audio file editor
                       DESKPINS DeskPins
                        DOTPEEK JetBrains dotPeek .NET disassembler
                           EDGE Microsoft Edge
                          EMAIL Default email program
                        FIREFOX Mozilla Firefox browser
                            FLP Agent Ransack file search tool
                         FOOBAR Foobar2000 music player
                          IRFAN IfranView Media Viewer
                       KILLSLAK Kill Zoom
                       KILLZOOM Kill Zoom
                        LINQPAD LINQPad for C#
                            MDP MarkdownPad2
                        POSTMAN Postman
                        RANSACK Mozilla Thunderbird email client
                          RIDER JetBrains Rider IDE
                          SKYPE Skype
                          SLACK Slack
                        SPOTIFY Spotify
                            SUB Sublime Text Editor
                             TB Mozilla Thunderbird email client
                          TEAMS Microsoft Teams
                        TRACKME Microsoft Edge
                            VLC VLC Media Player
                             VS Microsoft Visual Studio
                         VSCODE Microsoft Visual Studio Code
                       WINMERGE WinMerge file and directory comparison tool
                           ZOOM Zoom

Ease of Access
-----------------------------------------------------------------------------
                       CAPTIONS Ease of Access closed captioning settings
                        EAAUDIO Ease of Access audio settings
                       EACOLFLT Ease of Access color filter
                         EADISP Ease of Access display settings
                         EAEYEC Ease of Access eye control
                        EAHIGHC Ease of Access high contrast
                         EAKEYB Ease of Access keyboard settings
                          EAMAG Ease of Access magnifier
                        EAMOUSE Ease of Access mouse settings
                          EANAR Ease of Access narrator settings
                           EASE Ease of Access Settings
                       EASPEECH Ease of Access speech recognition settings
                         EATCUR Ease of Access text cursor settings

Features
-----------------------------------------------------------------------------
                       DEFAULTS Default Programs
                       DELIVOPT Microsoft Updates Delivery Optimization Settings
                       FEATURES Optional Apps and Features Settings
                       OPTIONAL Optional Features Settings
                       PROGRAMS Uninstall or Change a Program
                         UPDATE Windows Update
                       UPDATEAH Windows Update Active Hours Settings
                        UPDATEH Windows Update History
                        UPDATEO Windows Update Advanced Option Settingss
                        UPDATER Windows Update Restart Options Settings

Linux
-----------------------------------------------------------------------------
                           BASH Run the Unix command specified on the command line
                          GEDIT gedit (graphical editor)
                           GIMP gimp (image manipulation)
                  GOOGLE-CHROME google-chrome (browser)
                       GOWINDOW GoWindow (God Mode)
                           LVLC Linux VLC (media player)
                 MICROSOFT-EDGE microsoft-edge (brower)
                       NAUTILUS nautilus (file browser)
                          WINCE Run the shell script that recompiles this program
                          XCALC xcalc (calculator)
                         XCLOCK xclock (visual clock)
                          XEYES xeyes (visual eyeballs)
                            XGC xgc (graphics demo)
                          XLOGO xlogo (visual X logo)
                           XMAN xman (man pages)
                          XMORE xmore (read-only text UI)

Locations
-----------------------------------------------------------------------------
                       ACCTPICT shell:AccountPictures
                       ADDNPROG shell:AddNewProgramsFolder
                       ADMTOOLS shell:Common Administrative Tools
                       ALLSTART Common Startup Folder
                        APPDATA shell:AppData
                           APPS Applications folder
                           BURN shell:CD Burning
                       CHNGPROG shell:ChangeRemoveProgramsFolder
                       COMMONPL Common Places
                       CONTACTS shell:Contacts
                        COOKIES shell:Cookies
                          CREDS shell:CredentialManager
                       CRYPKEYS shell:Cryptokeys
                        DESKTOP User desktop folder
                         DOCLIB shell:DocumentsLibrary
                       DOWNLOAD shell:Downloads
                       DPAPIKEY shell:DpAPIKeys
                        EXPSRCH shell:SearchHomeFolder
                           FAVS Favorites folder
                       FONTSDIR shell:Fonts
                           FREQ Frequently accessed folders
                         FSMGMT Shared Folders
                         GAMEXP shell:PublicGameTasks
                        HISTORY shell:History
                        HOMEGRP Home Group folder
                       IMPAPPSC shell:ImplicitAppShortcuts
                       INETCACH shell:cache
                           LIBS shell:Libraries
                          LINKS shell:Links
                           MAIL outlookmail:
                       MEDIASRV Media Servers
                        MSVIDEO microsoftvideo:
                         MYDOCS My Documents
                        MYVIDEO shell:My Video
                             PC This Computer
                        PICTLIB shell:PicturesLibrary
                       PLAYLIST shell:playlists
                        PORTDEV Portable Devices folder
                      PRINTHOOD shell:PrintHood
                       PRINTRSF shell:PrintersFolder
                       PROFILEF shell:Profile
                          PROGF C:\Program Files
                        PROGF86 C:\Program Files (x86)
                         PROGFC C:\Program Files\Common Files
                       PROGFC86 C:\Program Files (x86)\Common Files
                       PROGRAMF shell:Programs
                      PROGRAMSC Shared programs folder
                        PUBDESK Common desktop folder
                        PUBDOCS shell:Common Documents
                        PUBDOWN shell:CommonDownloads
                         PUBLIC shell:Public
                       PUBVIDEO shell:CommonVideo
                          QUICK shell:Quick Launch
                         RECENT shell:recent
                          RECYC Recycle bin folder
                       REMOVABL Removable Devices folder
                       RESOURCE shell:ResourceDir
                       RINGTONC shell:CommonRingtones
                       RINGTONE shell:Ringtones
                       ROAMTILE %USERPROFILE%\AppData\Local\Microsoft\Windows\RoamingTiles
                       SAVEGAME shell:SavedGames
                        SAVELOC Change where new content is saved
                       SEARCHES shell:Searches
                         SENDTO shell:sendto
                       STARTALL shell:Common Start Menu
                        STARTME shell:Start Menu
                        STARTUP User Startup Folder
                          SYS32 shell:System
                          SYS86 shell:Systemx86
                      TEMPLATES shell:templates
                        THISDEV This Device folder
                       UNUPDATE Installed Updates/Uninstall an Update
                       USERPINS shell:User Pinned
                         VIDLIB shell:VideosLibrary
                       WINDOWSF shell:Windows

Microsoft Office
-----------------------------------------------------------------------------
                          EXCEL Microsoft Excel
                             OA Microsoft Outlook Attach File <path>
                             OC Microsoft Outlook Compose
                             OD Microsoft OneDrive
                             OM Microsoft Outlook Compose To <email>
                        ONENOTE Microsoft OneNote
                        OUTLOOK Microsoft Outlook
                            PPT Microsoft PowerPoint
                           WORD Microsoft Word

Miscelaneous
-----------------------------------------------------------------------------
                        INSIDER Microsoft Windows Insider Program
                       QUICKASS Windows Quick Assist
                          SHOWD Show Windows desktop
                        TROUBLE Troubleshooting Windows
                         WINTAB Switch windows (Windows+Tab)
                        WUPDATE Update WSL

Networking
-----------------------------------------------------------------------------
                        ADDNETP Add Network Place
                       ADDPHONE Mobile Devices/Add Phone
                        BLUETOO Bluetooth settings
                         DIALUP Dialup Networking settings
                       ETHERNET Ethernet LAN Cable networking settings
                       FLUSHDNS Flush DNS Cache
                        HOTSPOT Mobile Hotspot Wi-Fi network settings
                       NETAVAIL Available networks
                         NETCON Network Connections folder
                        NETHOOD Network Shortcuts
                       NETSHARE Network and Sharing Center
                        NETSTAT Network status settings
                          PROXY Network Proxy settings
                      REMOTEAPP RemoteApp and Desktop Connections
                            VPN Virtual Private Network settings
                       WHEELSUP Airplane Mode settingse
                       WIFINETS Wi-Fi Network settings
                       WIFISETS Wi-Fi Network settings
                       YURPHONE Mobile Devices/Your Phone

Privacy
-----------------------------------------------------------------------------
                       MICCHECK Microphone privacy settings
                       PAPPDIAG App Diagnostics privacy settings
                       PAUTODWN Automatic File Downloads privacy settings
                       PBACKAPP Background Apps privacy settings
                         PCALLH Call History privacy settings
                         PCALLS Phone Calls privacy settings
                          PCALS Calendar privacy settings
                           PCAM ms-settings:privacy-webcam
                       PCONTACT ms-settings:privacy-contacts
                           PDEV Custom/Other Devices privacy settings
                           PDOC Documents privacy settings
                          PDOCS ms-settings:privacy-documents
                         PEMAIL Email privacy settings
                          PFEED ms-settings:privacy-feedback
                            PFS File system access privacy settings
                          PHIST ms-settings:privacy-activityhistory
                           PMSG Messaging privacy settings
                        PMYINFO Accoung Information privacy settings
                          PNAGS Notifications privacy settings
                          PPICS ms-settings:privacy-pictures
                        PRADIOS ms-settings:privacy-radios
                        PRIVACY Privacy settings control panel
                        PSPEECH ms-settings:privacy-speech
                         PTASKS ms-settings:privacy-tasks
                          PTYPE ms-settings:privacy-speechtyping
                        PVOICEA ms-settings:privacy-voiceactivation
                        SRCHPRM Permissions and History
                        STALKME Location privacy settings

Screen Savers
-----------------------------------------------------------------------------
                          3DTSS 3D Text Screen Saver
                         3DTSSS 3D Text Screen Saver settings
                         3DTSSW 3D Text Screen Saver window
                          BLANK Blank Screen Saver
                        BUBBLES Bubbles Screen Saver
                       BUBBLESS Bubbles Screen Saver settings
                       BUBBLESW Bubbles Screen Saver window
                      DEFAULTSS Default Screen Saver
                        MYSTIFY Mystify Screen Saver
                       MYSTIFYW Mystify Screen Saver window
                        PHOTOSS Photos Screen Saver
                       PHOTOSSS Photos Screen Saver settings
                       PHOTOSSW Photos Screen Saver window
                        RIBBONS Ribbons Screen Saver
                       RIBBONSS Ribbons Screen Saver settings
                       RIBBONSW Ribbons Screen Saver window
                            SSS Screen Saver Settings

Security
-----------------------------------------------------------------------------
                         ADVSEC Advanced firewall security settings
                        AUTHMAN Security Authorization Manager
                        BITLOCK Bitlocker Drive Encryption
                         CERTLM Security Certificate Manager - Local Machine
                        CERTMGR Security Certificate Manager - Current User
                        CREDWIZ Stored Usernames and Passwords
                            EUP Edit User Profiles
                       FACESIGN Face recognition security settings
                       FINGSIGN Fingerprint recognition security settings
                       FIREWALL Firewall security settings
                         GPEDIT Local Group Policy Editor
                        KEYSIGN Security key (USB) security settings
                        LUSRMGR Local Users and Groups
                            PSR Steps Recorder
                       REKEYWIZ Encrypt Filesystem with Certificate
                        SECCNTR Windows Security Center/Security at a Glance
                         SECMAN Security and Maintenance control panel
                         SECPOL Security Policy
                         SIGNIN Security sign-in settings
                       SYSCERTS System Security Certificates
                            UAC UserAccountControlSettings.exe
                         UPSIGN Security dynamic lock settings
                           USER User Accounts
                       USERACTS Security User Accounts
                       USERPASS control.exe
                          USERS User Profiles
                         WINSEC Windows Security Settings

Settings
-----------------------------------------------------------------------------
                          ABOUT About settings
                       ACTIVATE Activate Windows
                       ACTIVATN Windows activation settings
                       AUTOPLAY Autoplay Settings (defaults)
                       AUTOPLYD Autoplay Settings by Device type
                     BACKGROUND Desktop background settings
                         BACKUP Backup settings
                        BATTERY Battery settings
                       CAPTURES Screen capture settings
                            CLP Clipboard settings
                         COLORS Windows Colors settings
                         CONDEV Connected devices (bluetooth and other devices) settings
                        CONTROL Control Panel (small icons)
                         CPCATS Control Panel (categories)
                       CROSSDEV Shared experiences accross devices settings
                        DATAUSE Data usage settings
                       DATETIME Date and time settings
                        DEFAULT Choose default applications settings
                            DEV Developer settings
                        DEVDISC Connectable device discovery settings
                        DEVICES Devices and Printers
                         DEVMAN Device Manager control pane
                        DISPLAY Display settings
                       FILEHIST File History
                        FILEOPT File Explorer settings
                       FINDMYDV Find my device settings
                          FOCUS Quiet hours/focus assist settungs
                       FONTVIEW Font Viewer
                        GAMEBAR Game bar settings
                       GAMEMODE Game mode settings
                       GRAPHICS Advanced graphics settings
                           INET Internet control panel
                           INTL Region
                       ISCSICPL iSCSI
                            JOY Game Controllers control panel
                       KEYBOARD Keyboard settings
                       LANGUAGE Regional language settings
                            LOC Location Information control panel
                           LOCK Lock screen settings
                           MAPS Map settings
                       MORFONTS More Font settings
                          MOUSE Mouse control panel
                       MOUSESET Mouse settings
                       MULTITSK Multitasking settings
                           NAGS Notification settings
                          NIGHT Night light settings
                       OFFLMAPS Offline map settings
                       OLDFONTS Legacy fonts control panel
                       OTHERUSR Other users settings
                            PEN Pen input settings
                        PERFOPT Performance Options
                       PERSONAL Personalization settings
                          POWER Power control panel
                           POWS Power and Sleep settings
                       PRNTSCAN Printer and Scanner settings
                        PROJECT Project (dark gray sidebar at right of screen)
                      PROJECTME Projecting to this PC
                          RDSET ms-settings:remotedesktop
                        RECOVER Recovery settings
                         REGION Regional formatting settings
                        SCALING ms-settings:display-advanced
                       SETEMAIL Email and Accounts settings
                        SETSPCH ms-settings:speech
                       SETSTART ms-settings:startupapps
                       SETTINGS Settings control panel
                       SETVIDEO ms-settings:videoplayback
                       SIGVERIF File Signature Verification
                          SOUND Sound control panel
                       SOUNDDEV ms-settings:sound-devices
                         SOUNDS Sound settings
                         SPEECH Configure your speech recognition experience
                       SRCHSETS Windows Search (Cortana) Settings
                          START Start Menu personalization settings
                       STARTFOL Personalize/choose which folders appear on the start menu
                        STORPOL Storage Policies
                       STORSENS Storage Sense
                         STORSP Manage Storage Spaces
                        SYNCSET Sync Settings...settings
                        SYSPROP Sound Properties control panel
                         TABLET Tablet Mode settings
                        TASKBAR Taskbar settings
                         THEMES Windows Themes settings
                       TIMEDATE Date and Time control panel
                       TOUCHPAD Touchpad settings
                         TYPING Typing settings
                            USB USB settings
                        UTILMAN Utility Manager (display)
                            VOL Volume settings
                        WEBAPPS ms-settings:appsforwebsites
                        WORKPLC Workplace or school settings
                       YOURINFO Your Information

Shutdown
-----------------------------------------------------------------------------
                           BOOT Reboot
                        BOOTOPT Reboot to boot options
                           DOWN Shut down
                       FIRMWARE Reboot to firmware
                            HYB Hybernate
                         LOGOFF Log off
                         SHUTUI Shutdown UI

Sysinternals.com
-----------------------------------------------------------------------------
                       AUTORUNS Identify and control startup processes
                         BGINFO Set desktop background to system information
                       DISKVIEW Disk space usage visualizer
                             DU Disk usage
                         HANDLE List open file handles
                       LISTDLLS List processes and their DLLs
                        PROCEXP Process Explorer
                        PROCMON Process Monitor
                         PSKILL Process killer
                         PSLIST Process lister
                         ZOOMIT crash it, change it, mail – upgrade it, Charge it, point it, zoom it, press it, Snap it, work it, quick – erase it...Technologic

Utilities
-----------------------------------------------------------------------------
                         ALARMS Alarmns & Clock
                        BACKUP7 Windows 7 backup
                       BINGMAPS Bing Maps
                       BINGNEWS Bing News
                            CAL Calendar
                           CALC Calculator
                            CAM Camera
                         CDINFO Crystal Disk Info
                        CHARMAP Character Map
                         CHKDSK Check hard disk for errors and issues
                       CLEANMGR Disk Cleanup
                       CLICONFG SQL Server Client Network Utility
                          CLOCK Clock
                            CMD cmd.exe (see above)
                       COLORCPL Color Management
                       COMPMGMT Computer Management
                        COMSERV Component Services Configuration
                         CTTUNE Clear Type Text Tuner
                        DEVMODE DevModeRunAsUserConfig.msc
                         DFRGUI Optimize Hard Drives
                         DIALER Phone Dialer
                        DISKMAN Disk Management
                       DISKPART Disk partitioner
                       DPAPIMIG Protected Content Migration
                        DVDPLAY DVD player (Windows Media Player)
                         DXDIAG DirectX Diagnostics Tool
                        EDITENV Edit environment variables
                            ENV Show Windows environment
                       EUDCEDIT Private Character Editor
                       EVENTVWR Windows Event Viewer
                            EXP explorer.exe (see above)
                            FAM Ask for permission (family)
                        FAXSCAN Windows Fax and Scan
                        FSQUIRT Bluetooth File Transfer
                       FXSCOVER Fax Cover Page Editor
                         GROOVE Microsoft Groove Music
                         HDWWIZ Add Hardware Wizard
                       IEXPLORE Internet Explorer
                       IEXPRESS Create a Self-Extracting Executable
                        ISOBURN ISO disk burner
                          KIOSK Set up a Kiosk
                       LPKSETUP Language Pack Setup
                        MAGNIFY Screen magnifier
                        MDSCHED Windows Memory Diagnostics
                            MMC Microsoft Management Console
                       MOBILITY Windows Mobility Center
                         MOVIES Microsoft Windows Video (Movies and TV)
                             MP Windows Media Player
                            MRT Malicious Software Removal Tool
                          MSACT Windows Action Center (right dark gray sidebar)
                       MSCONFIG Microsoft Configuration tool
                           MSDT Microsoft Support Diagnostics Tool
                       MSINFO32 System Information
                        NOTEPAD Windows Notepad
                       ODBCCONF odbcconf.exe
                            OSK On-screen keyboard
                          PAINT Windows Paint
                        PAINT3D Paint3D
                         PEOPLE People
                        PERFMON Performance Monitor
                         PHOTOS Photos and Video Editor
                        PRESSET Presentation Settings
                       PRINTMAN Print Management
                       PRINTMIG Printer Migration
                        PRINTUI Print User Interface
                          PSISE PowerShell Integrated Scripting Environment (ISE)
                           PWRD keymgr.dll,PRShowSaveWizardExW
                       RASPHONE Remove Access Phonebook
                             RD Remote Desktop Client
                        RECDISC Create a system repair disk
                       REGEDT32 Windows Registry Editor
                       REMOTEAS Windows Remote Assistance
                         RESMON Windows Resource Monitor
                        RESTORE Restore system files and settings
                           RSOP Resultant Set of Policy
                            RUN Windows Run Dialog
                           SCAN Scan
                          SCLIP Screen capture (Windows+Shift+S)
                       SERVICES Windows Services
                        SHRPUBW Create Shared Folder Wiard
                         SNDVOL Sound and Volume
                       SNIPTOOL SnippingTool
                            SOL Solitare
                       SOUNDREC Sound Recorder
                        SSKETCH Snip and sketch
                       STIKYNOT Sticky Notes
                          STORE Microsoft store
                        SUPPORT Microsoft support
                           SYNC Sync Center
                         TABCAL Digitizer Calibration Tool
                        TASKMGR Windows Task Manager
                       TASKSCHD Windows Task Scheduler
                           TIPS Windows tips / getting started
                            TPM Trusted Platform Module
                        TPM.MSC Trusted Platform Module Management on Local Computer
                       VERIFIER Driver Verifier Manager
                       WINTOOLS Windows Tools
                         WINVER Windows Version
                        WMIMGMT WMI Management
                        WORDPAD Windows Wordpad
                           WUSA Windows Update Standalone Installer

        wink : 459 known command codes

        wink : access Windows features : Help requested by -help

        wink [opts] <CODE> [arguments]
            -d dry (do not execute)
            -e export (configuraiton JSON)
            -p pretty-print (for use with -e)
            -v verbose (print command line)

wink HELP :                  display command usage information
wink HELP | grep -i "text" # identify command code matching text

Anatomy of a Rust Program, Part VII: /src/wsl/inv.rs and /src/wsl/inv/*.rs

This blog post is the seventh in a series that describes the structure of the wink command line program that I have written in rust and that I use to invoke other Windows and Linux programs from bash and Windows shells under Windows Subsystem for Linux. This post describes several types used by the wink program to contain metadata about commands that Windows can invoke and to invoke such commands. This blog post describes several files that appear as the crate::wsl::inv path and its child paths such as crate::wsl::inv::invocable.

In no particular order, this is one of the files.

An Invocable represents metadata about a command that Windows can invoke as an executable, with cmd.exe, with explorer.exe, or with WSL bash.exe, where cmd.exe supports child commands such as call and start, neither of which seems to work reliability as intended, such as to start a Windows binary as a background process.

#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]

Invocables can be serialized to and deserialized from JSON, and support some cloning and debugging features.

The implementation includes the cmp(), partial(), and eq() functions required for sorting Invocables by their command codes.

The base() function returns an Invocable with default values applied. The bin_with(), bin(), exp_with(), exp(), bkg_with(), bkg(), cmd_with(), cmd(), sh_with(), and sh() functions create Invokers with different properties to invoke commands in various ways allowed by Windows, which may use (named _with) or not use command line parameters.

 use crate::wsl::inv::invocable::Invocable; 

InvocableCategory depends on Invocable.

#[derive(Clone, serde::Serialize, serde::Deserialize, Debug)]

InvocableCategories can be serialized to and deserialized from JSON, and support some cloning and debugging features.

The implementation includes the cmp(), partial(), and eq() functions required for sorting InvocableCategories by their names.

The new() function works as a constructor.

The add() function adds an Invocable to an InvocableCategory.

The remaining functions add a number of Invocables to an InvocableCategory.

use crate::wsl::get_config_file_path;
use crate::wsl::inv::invocable::Invocable;
use crate::wsl::inv::invocablecategory::InvocableCategory;

InvocableCategoryList has some dependencies.

#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]

InvocableCategoryList supports some features.

The get() function constructs the default CategoryList by creating a number of InvocableCategories with hard-coded names and calling corresponding methods before adding them to this InvocableCategoryList. I intend to refactor this to use delegates. This includes some logic to add additional InvocableCategories and Invocables from a JSON file to this InvocableCategoryList, which likely needs some corrections to resolve potential conflicts in category and command code names.

The get_invocable function uses some rust constructs to avoid nested for loops. For each category, in its list of Invocables, find the Invocable with the command_code value that matches the command_code argument. The pipes indicate delegates.

impl InvocableCategoryList {
    pub fn get_invocable(&self, command_code: &str) -> Option<&Invocable> {
        self.categories
            .iter()
            .flat_map(|c| c.invocables.iter())
            .find(|i| i.command_code == command_code)
    }
}

This fragment is interesting.

        if std::path::Path::new(&path).exists() {
            // if the path exists, then propagate all errors, so OK to unwrap from here
            let data = std::fs::read_to_string(&path)
                .unwrap_or_else(|_| panic!("Unable to read {0}", &path));
            let deserialized: InvocableCategoryList = serde_json::from_str(&data).unwrap();

If the file at the specified path exists, then panic if it cannot be read; otherwise, create an InvocableCategoryList from its contents. Underscore is a construct that is something like a default everything.

This is struct has no fields but defines the invoke() function that uses an Invocable and some parameters from the command line to invoke a process using std::process::Command. The code seems relatively self-explanatory.

  • /src/wsl/inv.rs: Groups the types defined in the files under the /src/wsl/inv directory under the wsl::inv path.
pub mod invocable;
pub mod invocablecategory;
pub mod invocablecategorylist;
pub mod invoker;

If I understand correctly, this makes the child paths available in this parent path, basically causing the compiler to include those files or allow other files to reference the types that they contain through the wsl::inv path.

Anatomy of a Rust Program, Part VI: /src/wsl.rs

This blog post is the sixth in a series that describes the structure of the wink command line program that I have written in rust and that I use to invoke other Windows and Linux programs from bash and Windows shells under Windows Subsystem for Linux. This post describes a library named wsl that the wink program defines for features specific to Windows Subsystem for Linux, defined by the /src/wsl.rs file and hence the crate::wsl path.

Because this logic is not specific to the wink program, it could appear in a separate crate or even a separate project.

The wsl_path_or_self() method accepts a string slice and a Boolean indicating whether to convert that slice to Unix or Windows, and returns the value as a String. It uses a std::Process::Command to invoke the wslpath command (not available from cmd.exe, although cmd.exe can call bash.exe which can call wslpath) with arguments that control its output. If any error occurs, then it this function returns the value passed to it, as it was unable to convert that path.

The is_windows_or_wsl() function is true if is_windows() or is_wsl() returns true. The is_windows() function returns true if the wink command is running directly under windows rather than under WSL within Windows. The is_wsl() function returns true if the wink command is running under WSL, typically in a bash shell. The get_user_home() function returns the value of the USERPROFILE environment variable under Windows or the HOME environment variable under WSL. The get_user_home_default() function calls get_user_home() and returns its value or an empty string if the environment variable was not defined. The get_config_file_path() function uses get_user_home_default to construct a path to a configuration file that the wink command may use.

The /src/wsl.rs file also contains a tests module.

mod tests {
    #[test]
    fn get_user_home_default() {
        println!("wsl::tests::get_user_home_default()");
        //TODO:
    }

    #[test]
    fn it_converts_c_drive() {
        assert_eq!(
            &crate::wsl::wsl_path_or_self("C:\\", true /*unix*/),
            "/mnt/c/"
        );

        // assert_eq!(&crate::wsl::wsl_path_or_self("C:", true /*unix*/), "/mnt/c"); wslpath unexpectedly returns C:
    }

    #[test]
    fn is_windows_or_wsl() {
        println!("wsl::tests::is_windows_or_wsl()");
        assert_eq!(
            super::is_windows_or_wsl(),
            true,
            "Run the tests against the Linux binary under WSL."
        );
    }

    #[test]
    fn is_windows() {
        println!("wsl::tests::is_windows()");
        assert_eq!(
            super::is_windows(),
            false,
            "Run the tests against the Linux binary under WSL."
        );
    }

    #[test]
    fn is_wsl() {
        println!("wsl::tests::is_wsl()");
        assert_eq!(
            super::is_wsl(),
            true,
            "Run the tests against the Linux binary under WSL."
        );
    }
}

Anatomy of a Rust Program, Part V: /src/winkconfig.rs

This blog post is the fifth in a series that describes the structure of the wink command line program that I have written in rust and that I use to invoke other Windows and Linux programs from bash and Windows shells under Windows Subsystem for Linux. This post describes the WinkConfig struct used to represent command line arguments to the program, defined in the /src/winkconfig.rs file and hence crate::winkconfig:WinkConfig.

The file /src/winkconfig.rs defines the WinkConfig struct and the implementation of its members (crate::winkconfig::WinkConfig). WinkConfig represents command line parameters passed to the wink command.

Before the definition of the WinkConfig struct, this line enables the serde library to serialize the fields in the struct as JSON. Compilations will fail if the struct does not meet requirements for serde. For my purposes, all fields are public.

#[derive(serde::Serialize)]

The fmt() function renders the WinkConfig as JSON for debugging purposes, repurposing the -p parameter used by the wink command itself to enable pretty-printing of JSON exports of its configuration.

Most of the logic is in the new() function, which accepts a vector (ordered list) of strings that the main() method in /src/main.rs determines from command line arguments and passes to new().

The first command line argument is the name of the command, such as wink or wink.exe or /path/to/wink. The new() function ignores that at first, iterating the command line arguments until it finds β€œhelp” or one that does not begin with a slash or a dash, which should be the command code that indicates which invocable to invoke. Any other command line options enable options or render help.

Note the use of to_owned. Rust enforces scope in a way that sometimes requires use of constructs to control which variables determine when the system frees memory.

The new() method then constructs a WinkConfig. Note that when field names match variable names, we can specify field names without the matching variable names.

If there is no reason to render usage information, then the new() method returns the WinkConfig in an Ok enumeration. Otherwise, it returns the WinkConfig and Box that contains a HelpError (/src/helperror.rs) that informs the caller to render usage information for the command.

To demonstrate testing, this class includes a mod named tests, which is a naming convention. When run with cargo run, a special main() method invokes tests attributed such as these.

The it_get_from_command_line_args() function removes some command line arguments that may appear when running under cargo test.

The it_has_a_path() test panics, which means crashing the program, but the #[should_panic] attribute interprets only a panic as a successful test. This is useful for determining absolute paths to things – run the tests for the thing and see its path.