astor icon indicating copy to clipboard operation
astor copied to clipboard

Command line changes needed

Open pmaupin opened this issue 8 years ago • 5 comments

Currently, the only command line supported is python -m astor.rtrip [readonly] [<source file or directory>]

Locally, I've enhanced my own copy of rtrip with a few more options, but the way I did that was, uhhhh, non-standard.

When I started this project, I had some Python interpreter where -m <module> ate any subsequent flags on the command line, e.g. -r didn't work. I don't know what that was, haven't found it again, can't recreate it, don't care.

I also have to confess that I don't know which command line argument parser is winning the hearts and minds of astor-lovers.

So, I have some functionality I'd like to add in a branch, but I haven't created a PR because I assume it's just really wrong code.

I don't know if we want to add a __main__.py and be able to support python -m rtrip ... as well as other options, or whether we just want to do a better job of doing the astor.rtrip command line.

If anybody could help, that'd be awesome.

pmaupin avatar Apr 26 '17 13:04 pmaupin

Oh, and we still support Python 2.6, and I don't see any reason to change that just for a command line parser...

pmaupin avatar Apr 26 '17 13:04 pmaupin

We could use setuptools' console_scripts entry point and introduce a astor ... or astor rtip ... command.

berkerpeksag avatar Apr 26 '17 14:04 berkerpeksag

I just realized that we didn't have rtrip in 0.5, so we probably want to use a command line parser and nail down an interface before we release 0.6.

Shouldn't be too much work, but real life intervenes in my case.

pmaupin avatar Apr 30 '17 03:04 pmaupin

I have a few hours to look at this. I like the console_scripts idea; will probably create a PR tonight.

pmaupin avatar May 01 '17 01:05 pmaupin

PR #78 created.

pmaupin avatar May 01 '17 04:05 pmaupin