Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some tools still use getopts #48

Open
pfuntner opened this issue Oct 22, 2019 · 2 comments
Open

Some tools still use getopts #48

pfuntner opened this issue Oct 22, 2019 · 2 comments

Comments

@pfuntner
Copy link
Owner

pfuntner commented Oct 22, 2019

A lot of tools still use the getopts module so there are some inconsistencies regarding how options work between tools, some lack some features like the --help option or --foo bar and --foo=bar being synonymous, etc. A lot of tools are already using argparse but not all.

I used grep -lr getopt to get a list of the tools that use getopt and will sort them with the most desirable tools toward the top:

recentdownloads
git-extract
backup
capture.py
chainssh
cols.py
columns
comm2
datejuggle
daterep
datescope
elastic_elements
elements
elk
epochrep
feedElasticsearch
filecount
findgrep
findmetrics
getCloudant
getmetrics
gitdiff.py
gitstatus.py
grepgrep
gzsavings
headgrep
htmlize
incomingHost
ipactivity
isbinary
istext
jeval
json2table
jsonhunt
jsonjoin
manipulate
megadiff.old
megascp
megassh.py
megasum
newname
oldjson
oldjson.py
oldtable.py
procsort
pwc
pysub
qdiff
random
repeat.py
rows
sample
sanitize
seejson
sizer
table2json
tabular
tailgrep
timemachine
watcher
webwatch

Some of these I probably don't even use much anymore or have been replaced by other tools so I don't know if I'll ever hit them all. But I could get to a point where I consider the issue closed.

As I fix these, I'll remove them from the list.

This was also reported by #21 for fitwidth

@pfuntner pfuntner pinned this issue Nov 27, 2019
pfuntner added a commit that referenced this issue Oct 17, 2020
These changes specifically address:

- #21: I added use of argparse & logging (#48 also mentions fitwidth but it is more global and #22 is specific about fitwidth)
- #39: By makind use of argparse, this problem goes away!  No more lame command line parsing!
- #66: I had brushed this one off but I went ahead but there was a simple fix so I was able to address it easily.
@pfuntner
Copy link
Owner Author

pfuntner commented Oct 17, 2020

I went ahead and fixed this issue in fitwidth along with other issues in 79fd44c but I think there are still some tools that are a problem:

$ grep -lr getopt | sort | flow --width 120
backup            capture.py        chainssh          cols              cols.py           columns          
comm2             datejuggle        daterep           datescope         elastic_elements  elements         
elk               epochrep          feedElasticsearch filecount         findgrep          findmetrics      
flow              getCloudant       getmetrics        gitdiff.py        git-extract       git-files        
gitstatus.py      grepgrep          gzsavings         headgrep          htmlize           incomingHost     
ipactivity        isbinary          istext            jeval             json2table        jsonhunt         
jsonjoin          manipulate        megadiff.old      megascp           megassh.py        megasum          
newname           oldjson           oldjson.py        oldtable.py       procsort          pwc              
pysub             qdiff             random            recentdownloads   repeat.py         rows             
sample            sanitize          seejson           sizer             table2json        tabular          
tailgrep          timemachine       watcher           webwatch                                    
$ 

I don't even think I use all of these... flow surprises me and I want to hit that one. I still regularly use newname too.

@pfuntner
Copy link
Owner Author

I gave flow a facelift with 66c3c15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant