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

feat: Add basename support #155 #216

Merged
merged 2 commits into from
Dec 22, 2021
Merged

feat: Add basename support #155 #216

merged 2 commits into from
Dec 22, 2021

Conversation

sgtcortez
Copy link
Contributor

@sgtcortez sgtcortez commented Dec 19, 2021

Hi, I did this simple implementation, hope it can be useful.

User, can have the choice to see only the program name, instead of the full path.
It seems useful when you have a program that resides on a big directory hierarchy.

I used the b flag, to enable/disable the short process name. I saw, that its the same flag to enable bug hunt mode. I can change, if you request.

This is my first pull request on a project ... So, if I am doing something wrong, please, tell me!

Thanks in advance ...
Best Regards, Matheus Rambo.

Closes #155

@sgtcortez
Copy link
Contributor Author

As is:
image

With the new feature:
image

@raboof
Copy link
Owner

raboof commented Dec 21, 2021

Thanks for this contribution! I think this is a great feature, and perhaps should even be the default behavior.

I do think it would be nice if this behavior could also be switched from the command-line. It would be neat if the same key/letter could be used for the command-line switch and the interactive interface. Unfortunately -b is already taken, but it's a bit exotic anyway - you could move the bughunt mode to -x?

@sgtcortez
Copy link
Contributor Author

Of course, change is on the way!
Thanks for the reply! :)

@sgtcortez
Copy link
Contributor Author

@raboof, please, take a look. Let me know if you find something!

Thanks!

@raboof
Copy link
Owner

raboof commented Dec 22, 2021

I think you also need to update the manpage in doc/nethogs.8 - after that LGTM!

@sgtcortez
Copy link
Contributor Author

Sorry, my bad.

Now, the user can decide to show only the program name, instead of the
full program path. It is useful, when you have a very long hierarchy of
directories, which, with the full path name, the user might not see the
program name.
@sgtcortez
Copy link
Contributor Author

Done!

@raboof
Copy link
Owner

raboof commented Dec 22, 2021

Sorry, my bad.

No worries, nice contribution, thanks!

@raboof raboof merged commit 2acedff into raboof:main Dec 22, 2021
@sgtcortez sgtcortez deleted the feat-add-basename-support branch December 22, 2021 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Long program name
2 participants