Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use Python3 and help so these commands can be used on a terminal Tasks: Command line arguments allow a command to execute enhanced features

Please use Python3 and help so these commands can be used on a terminal

image text in transcribed

Tasks: Command line arguments allow a command to execute enhanced features and options without directly prompting the user for any additional input. This also allows the command to be ran unattended and/or in a batch mode. In this lab you are required to write a program that simply lists the contents of a directory. The directory contents will either be listed to the console or, if present on the command line, to the log file specified. The directory, the content of which is to be listed, should be the current directory, unless, otherwise specified on the command line. Keep in mind, the directory path specified on the command line needs to be validated that it is in fact an actual directory. If not, display an error message (either to console or to log file) and exit application. If an invalid option was entered in, use exception handling to print out the message and exit application. When listing the contents of the directory to either console or log file, do not list the "." and ".." entries. Use the following format: Name You will have your script accept the following command line arguments: Options Short Long -h --help Mandatory argument Description Displays "USAGE:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Joe Celkos Data And Databases Concepts In Practice

Authors: Joe Celko

1st Edition

1558604324, 978-1558604322

Students also viewed these Databases questions