Giter Site home page Giter Site logo

Comments (3)

dansalvato avatar dansalvato commented on June 30, 2024

Thanks for asking. I haven't really thought about it, but I'd say I'm probably not too open to "code cleanup" PRs, since it runs the risk of me defamiliarizing myself with my own codebase without any direct benefit to the end user. Of course, your suggestion is a very simple one and wouldn't cause that to happen, but for the sake of keeping contribution rules clear and consistent, I'll go ahead and say that those are better as issues rather than PRs. In any case, I appreciate your interest in the project, and we can keep this issue open for the suggestion of implementing argparse.

from melee-gci-compiler.

Nemris avatar Nemris commented on June 30, 2024

Valid point for sure - and something that caused me to keep PRs from others on hold as well.

Regarding the benefits of argparse, I'd say some of the main ones would be automatic generation of the usage message based on the flags you define, plus an automatic -h/--help flag out of the box. It would also allow you to skip the whole pattern matching that you have in the main().

Shall I work on it in a fork and just link it here for discussing, for the time being?

from melee-gci-compiler.

Nemris avatar Nemris commented on June 30, 2024

Alright, I went ahead and replaced getopt, as you can see here.
While I tried to preserve most of the old behavior, you should be aware that the usage message is now slightly different, since argparse formats it in the style of *NIX utilities.

By the way, I noticed a quirk in your code which I'm not sure was intentional - apparently, you made it so that all of script_path, input_gci and output_gci can be omitted.
In my variant, omitting those paths results in a run that appears simulated - in that it goes through the whole process but saves nothing on disk. In yours, the script simply dies without printing anything, possibly because of the catch-all at line 52.

As for sys, I saw that you're exiting with an uncommon code 10 if compiling fails, so I just kept it for the time being in case other tools need that status for compatibility.

from melee-gci-compiler.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.