Zhap Plan for version 1.0

Last updated: 24. Octomber 2003

Introduction

Idea is made free and DOS style console based shell for windows. Purpose this shell is help power users to maintain their computers.

Interface

Interface should be reduced ass much as possible. Printing trillions of lines of text don’t help users to find important information what they are looking for.

Features

This plan is limited to small. Making to big plan or not plan at all increase project  time and make unclear what should be done. The idea is make small and usable shell, that has good to develop more features.

The main features that should be done is:

Commands

Following command should be implanted.

Command
Description
?
Play internal commands or prompt for a command.
ALIAS
Create aliases for new or existing commands.
ATTRIB
Change or view file and directory attributes.
BEEP
Beep the speaker.
CALL
Execute one batch file from within another.
CANCEL
Terminate batch file processing.
CD
Display or change the current directory.
CHCP
Display or change the current system code page.
CLS
Clear the video display and optionally change colors.
COLOR
Change the default display colors.
COPY
Copy data between directories and files.
DATE
Display and optionally change the system date.
DEL
Delete one or more files.
DELAY
Pause for a specified length of time.
DIR
Display information about files and directories.
ECHO
Display a message, or control command echoing.
EXIT
Exit from ZHAP.
FOR
Repeat a command for several values of a variable.
GOTO
Branch inside the current batch file.
HELP
Display help for internal and external commands.
HISTORY
Display, add to, clear, or read the history list.
IF
Execute a command if specified conditions are true.
LOG
Save a log of commands to a disk file.
MD
Create a subdirectory.
PATH
Display or change the system search path.
PAUSE
Suspend batch file or alias execution.
PROMPT
Change the command-line prompt.
QUIT
Terminate the current batch file.
REBOOT
Do a warm or cold system reboot.
REM
Put a comment in a batch file.
RD
Remove one or more subdirectories.
SET
Display, create, modify, or delete environment variables.
START
Start a program in another session.
TEXT
Display a block of text in a batch file.
TIME
Display or set the current system time.
TYPE
Display the contents of the specified file(s).
VER
Display the current Zhap and Windows versions.

? (command)


Display a list of internal commands or prompt for a command.

? ["prompt" command"]

When using the ? command by itself, it display a list of internal commands. ? command also prompt (Y/N) question and wait for the user's responce. If user presses "Y" or "y", the line will be executed.

[C:\] ? "Backup now" call backup.bat
Backup now (Y/N)?
Implanting command should be easy. 4NT uses 6 row displays and it's good. Display partiotion of command is simple for loop, that loop command table and display filenames. Question part can be made of  easy loop too.

ALIAS

Create new command names that execute one or more commands or redefine default options for existing commands; display the list of defined alias names.

ALIAS [name=[value]]

Displaying

To display all defined aliases write alias command whitout arguments.

[C:\] ALIAS

To display specified alias write it name.
[C:\] ALIAS d

Creating

Define alias name and command for that.
[C:\] ALIAS D=DIR /1

Removing aliases

To remove alias write it name and = charter.
[C:\] ALIAS D=
Alias command  actually create and maintaince sorted linked list. To get alias command to work need to write 
expand function that expand alieses from user inputted command line. After that command proceessing continue to find user specified command.

There isin't are /R (read from file) option for definion. To some result can be gained to definenin alieses in bath file. There isin't are also keystrokes alies. Keystrokses alies required to handle in command line input processude. Becose i want keep to that proceduce first version as clean as possible.

Actually alias command work like SET command. The syntax is same.

ATTRIB

Change or view file and directory attributes.

ATTRIB {[+-]ADHRS /Q /S] files...

If you don't specify eny command letter ATTRIB display file attributes.

Attribute flags:

+A Set the archive attribute 
-A Clear the archive attribute 
+D Modify directory attributes
-D Modify directory attributes
+H Set the hidden attribute 
-H Clear the hidden attribute 
+R Set the read-only attribute 
-R Clear the read-only attribute 
+S Set the system attribute 
-S Clear the system attribute 

Options:

/Q (Quiet) This option turns off ATTRIB's normal screen output. It is most useful in batch files.
/S (Subdirectories) If you use the /S option, the ATTRIB command will be applied to all matching files in the current or named directory and all of its subdirectories.
 
Attrib command should display normal, tempeture and offline attributes but isin't are required to change them. Command should display current and changed attributes and fullpath and filenames
___A_________ -> ______N______  D:\sources\test\test.c

BEEP

Beep the speaker or play simple music. 

BEEP [frequency duration ...] 
 
Use Beep() function.

CALL


CALL allows batch files to call other batch files (batch file nesting). The calling batch file is suspended while the called (second) batch file runs. When the second batch file finishes, the original batch file resumes execution at the next command. If you execute a batch file from inside another batch file without using CALL, the first batch file is terminated before the second one starts.

CANCEL

CANCEL [value]

The CANCEL command ends all batch file processing, regardless of the batch file nesting level.

Cancel command should clear the batch stack and set errorlevel value.

CD


Display or change the current directory. 

CD [path | -]

Change current disk working directory. "CD -" change last visited directory.

szLastDir[MAX_PATH] definion should be ok.

CHCP

Display or change the current system code page.

CHCP [n]

[c:\] chcp  
Active code page: 437  
SetConsoleCP()

CLS

Clear the window and move the cursor to the upper left corner.

CLS

Color can be changed using color command so 4NT type color support isin't are nesesory. i don't have idea how to implanet /C (Clear buffer) switchs.

COLOR

Change the default display colors.

COLOR bf

B is hexadecimal digit that specifies the background color and f is hexadecimal digit

Color vales:

0 Black
1 Blue
2 Green
3 Aqua
4 Red
5 Purple
6 Yellow
7 White
8 Gray
9 Light blue
A Light green
B Light aqua
C Light red
D Light purple
E Light yellow
F Bright white

If the specified foreground and background values are the same, color returns ERRORLEVEL 1.

COPY

Copies one or more files to another location.

COPY source destination /S /A

/A Copy all files, don't skip hidden ja system attributes.
/S Subdirectories

DATE

Display and optionally change the system date.

DATE /T

/T (Display only)

DEL

Delete specified files.

DEL file... /S /N

/S Delete specified files from current directory and all subdirectories.
/N Nothing. Do everything except actually delete files(s).

DELAY

Pause for a specified lenght of time.

DELAY [seconds]

Default delay value is one second.

DIR

Display information about files and subdirectories.

DIR file /H /K /M /S /W

/H Hide dots
/K Suppress header (Disk and directory name) display.
/M Suppress footer (file and count totals) display.
/S Subdirectories
/W (Wide) Display filenames only.

ColorDIR enviroment variable should be implanted. Color names should be implanted like COLOR commands, not like 4NT use them. This will make color syntax in same in color command.

ECHO

Turns the command-echoing feature on or off, or displays a message.

echo [on | off] [message]

To display current echo settings, use echo command prompt whitout parameter.

EXIT

Exit the current command processor section.

EXIT [value]

FOR

Runs a specified command for each file in a set of files.

for %variable in (set) do command [command-parameters]

GOTO

Jump to specified line in a bath file.

GOTO label

HELP

Display help for internal commands.

HELP [topic]

Help command should be implanned using HTML help.

HISTORY

Display Add, Clear or read the history list.

HISTORY [/A command /F /R filename]

If no parameters are entered, history will display the current command history list.

/A (Add) a command to the history list.
/F  (Free)  Erase  all enteries  in the command  history list.
/R (Read) Read the command history from specified file.

IF

Performs conditional processin in batch files.

if [not] errorlevel number command [else expression]
if [not] string1==string2 command [else expression]
if [not] exist filename command [else expression]

LOG

Save a log of commands to a disk.

LOG [on | off | text]

MD

Create a subdirectory.

MD path

PATH

Sets a search path for executable files.

PATH [directory][;directory..]

PAUSE

suspend bath file execution.

PAUSE [text]

Command show "Press any key when ready...  " message if no custom text is provided.

PROMPT

Change the command-line prompt.

PROMPT [text]

If there isin't are prompt settings defined, the default prompt is [%p]. Prompt command actually set prompt enviroment variable. The prompt text can contains special commands in the form $?, where ? is one of the charters listed below.

a
The amphesis charter [&].
b The vertical bar charter [i].
c
The open parenthesis [(].
e
Ascii ASC charter.
f
The close parenthesis [)].
g
The greater-than sign [>].
h
Backspace over the previous charter.
k
Current working directory uppest  dir.
l
The less than sign [<].
p
The current drive and directory.
q
The equal sign (=).
s
Space charter.
$
The dollar sign
_
CR/LF

QUIT

Terminate the current batch file.

QUIT [value]

REBOOT

Shut down the system.

REBOOT /H | /L | /P | /R

/H Hibernate
/L Logoff
/P Poweroff
/R Restart

REM

Put a command in path file.

REM [comment]

RD

Remove directory.

RD path

SET

Display, create, modify or delete enviroment variables.

SET [variable=[string]]

Used whitout parameters, set display current enviroment settings.

START

Starts a separate window to run a specified program or command.

START program

TEXT

Display block of text in bath file.

TEXT
...
...
...
ENDTEXT

TIME

Display and optionally change system time.

TIME [hh:mm:ss | /T]

/T Display only.

TYPE

Display the contens of a text file.

TYPE [/H | /T][/Nn] file

/H (Head) Display first part of  file.
/T (Tail) Display last part of file.
/Nn Number of lines

VER

Display Zhap version number.

VER