Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new properties for the path and arguments separately #7

Open
sindresorhus opened this issue Mar 11, 2017 · 8 comments
Open

Add new properties for the path and arguments separately #7

sindresorhus opened this issue Mar 11, 2017 · 8 comments
Labels
💵 Funded on Issuehunt This issue has been funded on Issuehunt enhancement help wanted

Comments

@sindresorhus
Copy link
Owner

sindresorhus commented Mar 11, 2017

Issuehunt badges

Currently there's process.cmd, but it includes both the path and arguments. Would be useful for sindresorhus/fkill-cli#16 to have separate process.path and process.args properties.

Context:

I looked into this more, and I might have a solution to get the arguments without the full path. It seems ps -o pid -o comm returns the full path without arguments and ps -o pid -o command returns with arguments. So we could get both columns and just diff them to get the arguments. I think this should be added as a new property in ps-list. So we could add an args property with just the arguments and a path property with the full path to the binary without arguments, just for completeness.

There is a $40.00 open bounty on this issue. Add more on Issuehunt.

@sindresorhus
Copy link
Owner Author

@coffeedoughnuts @alextes Thoughts on this? Does it make sense? If not, any better suggestions?

@dnbkr
Copy link

dnbkr commented May 2, 2017

I think that makes sense; and it's an additive change yes? No won't break anything if theres an issue with it.

@alextes
Copy link

alextes commented May 4, 2017

Hmm, I'm not that familiar with ps. It has a long manual. I would like to give it another once over to see if there are options to get the distinction command/arguments into one column.
Less is more 😄.

@IssueHuntBot
Copy link

@IssueHunt has funded $40.00 to this issue. See it on IssueHunt

@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label May 10, 2019
@stroncium
Copy link
Contributor

command from ps output can be changed by the process, in which case it usually won't contain arguments and the name might not be what you expect. So I think it's impossible to do do it without causing a lot of pain to devs(and bug reports from them).

Can be done with different API, but that would require using more than just ps and would require writing a whole article on what is what for linux(/similar) process.

@sindresorhus
Copy link
Owner Author

I think the conclusion from the issue and many others here is that ps is just junk for programmatic access.

@sindresorhus
Copy link
Owner Author

Can be done with different API, but that would require using more than just ps and would require writing a whole article on what is what for linux(/similar) process.

What other API? And why would it require writing a whole article?

@sindresorhus
Copy link
Owner Author

Ideally, someone would write a cross-platform binary for this in Rust and we could just bundle some binaries for each platform, and fall back to ps if those fail or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💵 Funded on Issuehunt This issue has been funded on Issuehunt enhancement help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants