Skip to content

Command interface

mhtvsSFrpHdE edited this page Jun 13, 2023 · 21 revisions

Command interface

Start from 2.2, you can type command to stdin to affect software behavior,
without have to restart or close.

Start from 2.5, the os native console replaced by a Qt window.
There is no runtime option to show os native console.
However, you can still compile with console and set start to tray to emulate early version behavior.
In this case, the stdin interface is available.
See Source\Define\define.h\CONSOLE_ENABLED for more details.

You can crash the program if a command is misused.

Basic - TrayMenu

All command name are case-sensitive. Also available in tray menu.

stop

Stop running prefetch.

start

Start prefetch if idle or stopped, awaiting prefetch interval will be ignored.

For example, prefetch in idle status and interval timer is 65/90 seconds,
after start requested, the rest of 90-65=25 seconds will discard,
and start a new round of prefetch immediately.

Should be safe to use this command at any time, even prefetch is already running.

traydc

"tray-double-click", show or hide console window, or called "minimize to tray".

exit

Destroy any running status and exit, should be same as click on close window button.

Basic - Advanced

These command are hard to use, have higher risk to crash the program,
so not provided in tray menu.

expiresc

Send stop command and wait to idle, delete scan cache, restart prefetch process.

This command is designed to run on idle.
Even by coincidence, it's allow to run during prefetch,
but GUI will freeze until queued prefetch task complete.
There's a delay between "pause request" and "wait all done".

You can either type pause and wait prefetch enter Idle status before do expiresc
to prevent GUI hang. But just don't do it during prefetch instead of try fancy stuff.

When it comes to GUI wrapper development,
restart process may unfriendly if you are attaching stdin interface.
You can also stop, exit, manually delete *.cache.ini use your code,
then start prefetch and attach to it again.

Parameter

These command name are case-sensitive, parameter are not case-sensitive.
Command name and parameter often split by space.

run

Open third party exe.

Example:

run explorer Firefox.lnk

lang

Switch to another translate file.
Use language name as parameter.
See prefetch.ini\Language for more details

Example:

lang en_US
lang zh_CN

Deprecated

startup

Run startup item again. Replaced by user macro (CustomTrayMenu) start from 5.0.