aaronst / macholibre

Mach-O & Universal Binary Parser
Apache License 2.0
143 stars 32 forks source link

Use module ´argparse` for option handling #4

Closed htgoebel closed 7 years ago

htgoebel commented 7 years ago

The Readme says:

For single files, make sure you put the filename first, before any options.

Please use argparse and overcome this limitation.

In the same turn you could remove the very, very unusual handling of globs, wich is normaly revolded by the shell already.

aaronst commented 7 years ago

@htgoebel thanks for taking the time to provide feedback on macholibre.

I'll definitely look at implementing this. I'm curious though, is there any particular reason you're using it as a script vs a module? If I can better understand your use case I might be able to make better changes.

htgoebel commented 7 years ago

is there any particular reason you're using it as a script vs a module?

Simply because a) I just wanted a small command line tool for "dumping" some mach-o files, and b) the readme says it can be used as a script.

aaronst commented 7 years ago

Okay, I've switched over to using argparse. Take a look at the new README.md, try it out, and let me know.

htgoebel commented 7 years ago

It uses argparse now, but still input is a glob, which is very unusual (except if you are on Windows). Have a look at the first example of arparse, which allows passing an arbitrary number of Ns.

aaronst commented 7 years ago

Ah yes I see, fixed.