This repository contains a Python implementation of the GNU shuf
command, named shuf.py
. The implementation prioritizes user-friendliness, compatibility, and efficient error handling.
- Implemented essential
shuf
options:--echo
,--input-range
,--head-count
, and--repeat
. - Utilized argparse for modern command-line parsing, enhancing extensibility.
To reproduce and run the shuf.py
script in your terminal, follow these steps:
-
Clone the Repository:
git clone https://github.com/your-username/Shuf.git
-
Navigate to the Repository:
cd Shuf
-
Run the Script:
- Ensure you have Python 3 installed on your system.
- Execute the script with the desired options. For example:
This command will shuffle and echo the input "Hello World."
python3 shuf.py --echo Hello World
-
Explore
shuf.py
Options:- Experiment with different options, such as
--input-range
or--head-count
, to observe varied outputs. - Refer to the help message for guidance:
python3 shuf.py --help
- Experiment with different options, such as
- Implemented robust error handling for invalid arguments and file-related issues.
- Ensured error reporting consistency with GNU
shuf
.
- Used Emacs for efficient code development.
- Restricted imports to essential modules, aligning with project specifications.