Menu

20 | cimit Syntax and test cases

Test cases

% 
% # country directory
% 
% cimit list countries
% cimit add country France
% cimit add country 'Russian Federation'
% cimit list countries
France
Russian Federation
% cimit rename country 'Russian Federation' Russia
% cimit list countries
France
Russia
% cimit delete country France
% cimit list countries
Russia
% cimit add country France
% cimit add country France
cimit: France is already in the list
% cimit rename country France Russia
cimit: Russia is already in the list
% 
% # organization directory
% 
% cimit list org
% cimit add org UN
% cimit add org 'Section 1' France
% cimit add org CTC Russia
% cimit list org
UN
Section 1
CTC
% cimit list countries
Russia
France
% cimit list org -
UN
% cimit list org France
Section 1
% cimit rename 'Section 1' 'Section one'
% cimit add org 'Section one' USA
cimit: Section one is already in the list
% cimit rename org UN CTC
cimit: CTC is already in the list
% 
% # departments directory
% 
% cimit list departments
% cimit add department South
cimit: What organization would you wish to use as the head of the South department?
% cimit add department South CTC
% cimit list departments
cimit: Departments of which organization would you like to see?
% cimit list departments CTC
South
% cimit rename org CTC КТЦ
% cimit list departments КТЦ
South
% cimit add department South КТЦ
cimit: КТЦ already has got the South department
% cimit add department South 'Section one'
% cimit list departments 'Section one'
South
% cimit list departments КТЦ
South
% cimit rename department South Южный КТЦ
% cimit list departments КТЦ
Южный
% 
% # person directory
% 
% ls /var/games/cimit/people
% cimit add man 'Marcelo Raymond'
% cimit add woman 'Sarah Salvador'
% ls /var/games/cimit/people
1 2
% cat /var/games/cimit/people/1
name:Marcelo Raymond
gender:male
condition:alive
% cimit view person Sarah Salvador
Name      Sarah Salvador
Gender    female
Condition alive

Scripts structure

/usr/local/sbin/cimit (1030) % ls -RFl
total 12
-rwxr-xr-x  1 nostoc  wheel    0 17 ноя 08:35 cimit*
lrwxr-xr-x  1 nostoc  wheel    7 17 ноя 08:32 countries@ -> country
drwxr-xr-x  2 nostoc  wheel  512 17 ноя 08:31 country/
drwxr-xr-x  2 nostoc  wheel  512 17 ноя 08:34 department/
lrwxr-xr-x  1 nostoc  wheel   10 17 ноя 08:35 departments@ -> department
drwxr-xr-x  2 nostoc  wheel  512 17 ноя 08:33 org/
lrwxr-xr-x  1 nostoc  wheel    3 17 ноя 08:34 orgs@ -> org

./country:
total 0
-rwxr-xr-x  1 nostoc  wheel  0 17 ноя 08:30 add*
-rwxr-xr-x  1 nostoc  wheel  0 17 ноя 08:31 delete*
-rwxr-xr-x  1 nostoc  wheel  0 17 ноя 08:31 list*
-rwxr-xr-x  1 nostoc  wheel  0 17 ноя 08:31 rename*

./department:
total 0
-rwxr-xr-x  1 nostoc  wheel  0 17 ноя 08:34 add*
-rwxr-xr-x  1 nostoc  wheel  0 17 ноя 08:34 delete*
-rwxr-xr-x  1 nostoc  wheel  0 17 ноя 08:34 list*
-rwxr-xr-x  1 nostoc  wheel  0 17 ноя 08:34 rename*

./org:
total 0
-rwxr-xr-x  1 nostoc  wheel  0 17 ноя 08:33 add*
-rwxr-xr-x  1 nostoc  wheel  0 17 ноя 08:33 delete*
-rwxr-xr-x  1 nostoc  wheel  0 17 ноя 08:33 list*
-rwxr-xr-x  1 nostoc  wheel  0 17 ноя 08:33 rename*
/usr/local/sbin/cimit (1031) % 

Data structure

/var/cimit/

Posted by Ivan Bilimov 2015-11-17

Log in to post a comment.