Command Line Interface (CLI)
1. Console Window
Wiimms ISO Tools is a set of command line tools.
The is no native graphical user interface (GUI).
The user have to type the commands in a text console.
The results are printed to the text console too if not redirected.
The advantage is that frequently needed commands can be stored into
shell scripts. The WIT tools terminate with different exit codes
that can be anlayzed in shell scripts.
1.1 Linux and other Unix derivates
With Linux and other Unix derivates you have the choice between many
shell programs like
sh,
bash,
csh,
tcsh,
ksh and many more.
If you want access to a USB drive (standard for tool wwt) you need
special rights; use one of the following methods:
- Work in a root shell.
- Use su or sudo to access the USB drive.
- Modify the access rights of the USB drive permanently.
1.1.1 Access a WBFS drive without root privileges
It's possible to work with already formatted WBFS partitions without root privileges.
-
Create the file /usr/local/bin/wbfs-chmod:
#!/bin/bash
/usr/local/bin/wwt find | while read dev
do
echo chmod 666 "$dev"
chmod 666 "$dev"
done
Do: chmod a+x /usr/local/bin/wbfs-chmod
-
Add the following line to /etc/sudoers:
ALL ALL=NOPASSWD: /usr/local/bin/wbfs-chmod
Each user can now call sudo wbfs-chmod to change the mode of every WBFS
partition to public read and write access.
The command must be entered every time when a WBFS drive is plugged in.
1.2 Windows
Windows knows the command prompt/window
cmd. It is sometime called
DOS Window,
but it has nothing to do with DOS.
There are several way to open a command window:
- Execute the program cmd.
- With installed powertoys right click and select "Command line here".
- Other ways, that I don't know.
I'm using always the
Total Commander
and just type
cmd to the command line if I want a command window.
And the working directory is always the correct one.
If you want access to a USB drive (standard for tool wwt) you need
special rights; use one of the following methods:
- Open a administration windows (don't ask me how to do this).
- Modify the access rights of the USB drive permanently.
(I don't know if this is really possible)
2. The command line
The command line is interpreted as a sequence of blank-separated words.
BLANK means in general SPACES and TABS, this depends on the used shell.
Each word is interpreted as option (if stating with a minus sign '-')
or as parameter else.
If the user want that a parameter contains blanks he have to enclose it with
single or double quotes: 'one word' or "one word".
This removes also the special meaning of certain characters or words to the shell.
Certain characters with special meaning are also different in the different
shells. Characters like semicolon (';'), exclamation point ('!'),
dollar sign ('$'), percent sign ('%'), number sign ('#'),
less sign ('<'), greater sign ('>')
and the quotes have very often a special meaning to the shell.
Read your shell documentation for details!
3. Options
The tools uses the
GNU C Library function
getopt()
to analyze the command line and find out the options.
The WIT tools support short and long options.
For example the tools know the options --verbose and --test
and the short versions -v and -t.
Some options need a parameter like »--source path« (short version: »-s path«).
As you see, short options are prefixed with a single minus sign ('-')
and long options are prefixed with a double minus sign ('--').
It is normal that every option and every parameter (needed by an option or global)
is written as exact one word, but short options can be combined in one word:
--verbose --test is the same as -v -t is the same as -vt.
If a short option takes a parameter it must be the last option of the option list:
-vs path same as -vspath, but -sv path is different.
Long options with parameters can be written in two forms:
--source path same as --source=path.
3.1 Multiple usage of options
If a option is used multiple times the meaning depends of the kind of option.
The WIT tools support three kinds of options:
-
Accumulative options are always options with parameters.
They collect all parameters internal to a list.
--source and --files are examples for accumulative options.
-
Counting options are always options without parameters.
The tool counts the number of appearance to compute a level.
--verbose and --logging are examples for counting options.
-
All other options are standard options.
For standard options only the appearance is registrated,
not the number of appearances.
If a standard options takes a parameter
only the parameter of last appearance is stored.
--overwrite and --dest are examples for standard options.
Some options cancel the effect of other option.
For example only the last appearance of
--wdf,
--iso,
--ciso and
--wfs
is used to force the output
file format.
4. Global Parameters
All words of the command line, that are not options and not parameters
for options, are
global parameters.
The order of global parameters is importand. They are analyzed after
the options. The tools wit and wwt use the first global parameter
as command. All other parameters are used as additional info.
If you want to insert a file, that begins with a minus sign like '-myfile',
prefix it with './', because './-myfile' is the same file.
5. Command Line Expansion
Global parameters and some
option parameters allow to read
it parameters from files. Just write
'@file'
instead of
'parameter'.
The cygwin (windows) version interprete '@file' by itself.
If using with an option you must prevent this
by quoting the option parameter.
6. Redirect output to a file
If you want to store the output of a comamnd in a file,
just append
'>path' at the end of the command line.
The standard output, but not the error output, is then redirect
to the file with the given path.
You can also pipe the output to other tools.
Append '| other_command' at the end of the command line.
If you append '| tee filename' the output is written to the console
and to the file with the given path.