Giter Site home page Giter Site logo

Comments (3)

ethanpost avatar ethanpost commented on July 19, 2024

This is not going to save you from having to use argparse. Just something to think about. As the program grows the option list could get very long. Personally I have moved away from having too many command line arguments and moved to functions which set state explicitly before running main command. I find this more readable and easier to manage.

So instead of

foo -x -d "bar" -z 45..............................

I might have

foo_set_export true
foo_set_key "bar"
foo_set_zulu 45
foo -with_a -couple_main_args...

This is just an example I throw out there, not 100% correct, but you get the idea. Usually the ones you set this way are not ones you are going to touch a lot.

from 0xtools.

tanelpoder avatar tanelpoder commented on July 19, 2024

The goal is not to avoid using the argparse library, but to avoid users having to install newer python (or pip install argparse) into their production systems. Reduce friction as much as possible. Bundling argparse.py with psnapper itself achieves that goal.

Yeah, regarding having too many command line options, I hear you. That's why I'm trying to have sensible defaults for some things (simple stuff, like sampling for 5 seconds if -d option is not specified and have a default field grouping too - perhaps different when looking into the whole system vs zooming in to a single process/thread).

And I'm thinking of introducing some "what do you want to do" templates... for example perf has multiple modes like perf top, perf stat, perf sched etc ... perhaps there should also be things like psn top, psn kernel, psn syscalls in addition to some default behavior of just running psn without any arguments. v1.0 stuff! :-)

from 0xtools.

tanelpoder avatar tanelpoder commented on July 19, 2024

argparse.py bundled in the repo.

from 0xtools.

Related Issues (20)

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.