A Command Line Interpreter made in C++ which supports commands like quit, remove, rename, rmdir, echo, out, zip, unzip.
Making our own Command Line Interpreter In this problem you have to develop a small-scale command line interpreter. Your CLI should support the following commands:
-
quit: Exit your CLI
-
remove file_name: removes the given file name. (Hint: Use remove C/C++’s built-in function remove() ).
-
rename old_name new_name: rename the given file/folder. (Hint: Use C/C++’s built-in function rename() ).
-
rmdir directory_name: remove directory. Assume that the directory is always empty. You do not have to handle the deletion of a directory that is not empty.
-
echo “data” optional_file_name: Whatever data is given in the quotation marks is written to the given file. If the file name is not given, the data in string is simply printed on the screen.
-
out -l file_name_1 file_name2 file_name_3: The contents of given files are printed one by one on the screen. When the contents of one file are printed, user is asked to press some key to continue. User must enter at least 1 file name. (If the user has specified -l, then the file contents are printed line by line, and the user is asked to press some key to continue after each line.)
-
zip destination file_name: zips the given file/folder. (Hint: Use system() function. system(“tar cvf “+ destination+” “+ file_name) ).
-
unzip file_name: unzips the given zipped file. Use system() in this case, too.
You can only use system() in zip/unzip command. You must not use it for any other command.
Download the Code folder and using Ubuntu Bash or Windows or Linux Terminal, change current working directory to the Code folder. Then on the terminal, type
./cli.out
Hey there, I'm Haris - Maker of Things
Creator of Ultimate Facebook Scraper (one of the best software to collect Facebook data for research & analysis)
Stuck with some problem? Need help in solution development, guidance, training or capacity building? I am a Full Stack Engineer turned Project Manager with years of technical and leadership experience in a diverse range of technologies and domains. Let me know what problem you are facing at haris.muneer5@gmail.com and we can schedule a consultation meeting to help you get through it.
- Development of Web Applications, Mobile Applications, and Desktop Applications
- Development of Machine Learning/Deep Learning models, and deployment
- Web Scraping, Browser Automation, Python Scripting
If you or your company use any of my projects, like what I’m doing or have benefited from my projects in any way then kindly consider backing my efforts.
For donations, you can follow these simple steps:
1) Free signup at TransferWise using this link: https://transferwise.com/invite/u/harism95. (Signing up through this link will save you from any transcation fee on the donation)
2) Select the amount e.g (15$) and choose the receiving/recipient's currency to be PKR. It supports multiple payment options (credit card, debit card, wire transfer etc)
3) Then it will show my info as the recipient, select it. If my name isn't shown, then type my email haris.muneer5@gmail.com in recipients.
4) Choose the reason for transfer to the one that suits you the most (in this case it could be 'General expenses') and in the reference section, you can mention 'Support'
If you face any issue in sending donation then feel free to get in touch with me at haris.muneer5@gmail.com
Thank you for your contribution!
You can get in touch with me on my LinkedIn Profile:
You can also follow my GitHub Profile to stay updated about my latest projects:
If you liked the repo then kindly support it by giving it a star ⭐ and share in your circles so more people can benefit from the effort.
If you find any bug in the code or have any improvements in mind then feel free to generate a pull request.
If you face any issue, you can create a new issue in the Issues Tab and I will be glad to help you out.
Copyright (c) 2018-present, harismuneer