Comments (3)
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.
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.
argparse.py bundled in the repo.
from 0xtools.
Related Issues (20)
- Improve schedlat to report thread/task sched latency
- Enhancement: Addition of checksum to go with a release
- add command line option to sample processes of a user
- Add tid field to psn
- Fix missing newlines when formatting python3 HOT 1
- KeyError getting syscall_id HOT 7
- Not working on Fedora 35 HOT 7
- cmdline HOT 1
- Run process by psn itself HOT 1
- Modify Makefile to better accommodate cross compilation HOT 4
- Pstool snapshot HOT 1
- unistd_64.h HOT 6
- KeyError on Rocky 9 when running psn HOT 5
- add epoll_pwait() to the list of single-fd syscalls
- psn v1.2.3 release may show wrong syscall names on x86_64 due to looking them up from a wrong/template file HOT 1
- It's better to replace % to format HOT 4
- bundle unistd.h with psn HOT 2
- support wrapping/narrower output (especially when kstack is used) HOT 1
- missing proc HOT 9
- ubuntu 18 error while running make HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 0xtools.