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
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 bugs, have suggestions, or face issues:
- Open an Issue in the Issues Tab to discuss them.
- Submit a Pull Request to propose fixes or improvements.
- Review Pull Requests from other contributors to help maintain the project's quality and progress.
This project thrives on community collaboration! Members are encouraged to take the initiative, support one another, and actively engage in all aspects of the project. Whether it’s debugging, fixing issues, or brainstorming new ideas, your contributions are what keep this project moving forward.
With modern AI tools like ChatGPT, solving challenges and contributing effectively is easier than ever. Let’s work together to make this project the best it can be! 🚀
Copyright (c) 2018-present, harismuneer
Hey there, I'm Haris Muneer 👨🏻💻
-
🕸️ Founder of Cyfy Labs: At Cyfy Labs, we provide advanced social media scraping tools that enable businesses, researchers, and marketers to extract actionable insights from platforms like Facebook, Instagram, and X (formerly Twitter). Our tools are designed for use cases such as lead generation, market research, social listening, and more. Learn more at www.cyfylabs.com
-
🌟 Open Source Advocate: Passionate about making technology accessible, I’ve developed and open-sourced several software projects for web, mobile, desktop, and AI on my GitHub profile. These projects have been used by thousands of learners worldwide to enhance their skills and knowledge.
-
📫 How to Reach Me: To learn more about my skills and work, visit my LinkedIn profile. For collaboration or inquiries, feel free to reach out via email. For Cyfy Labs related queries, please contact us through our company website.