Aug-24-2019, 07:16 PM
i am wanting to rewrite this C program into Python3. any suggestions for a module that can handle this kind of command line argument parsing?
Output:lt2a/forums /home/forums 1> rls -h
rls version 0.9.0
syntax:
rls [options] [names]
single letter options may be combined in a single command line token:
-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 maximum depth
-a append '/' to directory names
-b show blocks allocated
-d -D show date (-d for local, -D for UTC)
-g -G show group name (-G for group number)
-h -H show this help and quit
-i show inode
-l show long format
-L show number of links
-m show mode
-n append nanoseconds to time (if available)
-N append nanoseconds to time (if available)
-p show where link points to
-q output nothing
-s show size
-S show time/date as raw seconds
-t -T show time and date (-t for local, -T for UTC)
-u -U show user name (-U for number)
-V show version number and quit
+a select directories (ascending)
+b select block devices
+c select character devices
+d select directories (descending)
+h +H show this help and quit
+f select regular files
+l select symlinks
+p select pipes
+s select sockets
+V show version number and quit
assignment options must be in separate command line tokens:
cd=<directory> change to this directory (multiple)
maxdepth=<num> maximum recursion depth
lt2a/forums /home/forums 2>
i'm also thinking about extending the options so they can be changed in the middle of the command line and apply to the names that follow them.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.