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

ps: Add command ps #133

Merged
merged 46 commits into from
Aug 7, 2024
Merged

ps: Add command ps #133

merged 46 commits into from
Aug 7, 2024

Conversation

Krysztal112233
Copy link
Collaborator

fix #102

@Krysztal112233
Copy link
Collaborator Author

Krysztal112233 commented Jul 20, 2024

This command is very complex and flexible (the manpage has 790~830 lines in total), so for now only the most basic functions are implemented :(

@cakebaker
Copy link
Contributor

That's fine :)

@cakebaker
Copy link
Contributor

I noticed you made some refactorings to pgrep. If they are unrelated to ps, I suggest to move those changes to its own PR so they can be merged independently of this PR.

src/uu/ps/src/picker.rs Outdated Show resolved Hide resolved
src/uu/ps/src/mapping.rs Outdated Show resolved Hide resolved
src/uu/ps/src/mapping.rs Outdated Show resolved Hide resolved
Remove TODO in `mapping.rs` and add TODO in `collector.rs`
@cakebaker

This comment was marked as resolved.

src/uu/ps/src/parser.rs Outdated Show resolved Hide resolved
@cakebaker
Copy link
Contributor

Another bug I noticed is that the header row is empty if there are no options:

$ cargo run -q ps
                          
 2406   pts/3  00:00:01  konsole 
 2423   pts/3  00:00:00  bash 
 21330  pts/3  00:00:00  procps 
$ ps
    PID TTY          TIME CMD
   2423 pts/3    00:00:00 bash
  21333 pts/3    00:00:00 ps

@Krysztal112233
Copy link
Collaborator Author

Another bug I noticed is that the header row is empty if there are no options:

$ cargo run -q ps
                          
 2406   pts/3  00:00:01  konsole 
 2423   pts/3  00:00:00  bash 
 21330  pts/3  00:00:00  procps 
$ ps
    PID TTY          TIME CMD
   2423 pts/3    00:00:00 bash
  21333 pts/3    00:00:00 ps

Fixed

❯ cargo run ps
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.06s
     Running `target/debug/procps ps`
 PID     TTY    TIME      CMD 
 5392    pts/0  00:00:01  zsh 
 5415    pts/0  00:00:00  zsh 
 5462    pts/0  00:00:00  zsh 
 5463    pts/0  00:00:00  zsh 
 5465    pts/0  00:00:00  gitstatusd-linu 
 766725  pts/0  00:00:00  procps 
❯ ps
    PID TTY          TIME CMD
   5392 pts/0    00:00:10 zsh
   5415 pts/0    00:00:00 zsh
   5462 pts/0    00:00:00 zsh
   5463 pts/0    00:00:01 zsh
   5465 pts/0    00:00:07 gitstatusd-linu
 766859 pts/0    00:00:00 ps

src/uu/ps/src/sorting.rs Outdated Show resolved Hide resolved
src/uu/ps/src/sorting.rs Outdated Show resolved Hide resolved
- Rename `sorting` to `sort`
- Rename `default_sort` to `sort_by_pid`
@cakebaker cakebaker merged commit e039c3e into uutils:main Aug 7, 2024
15 of 16 checks passed
@cakebaker
Copy link
Contributor

Thanks :)

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.

Add command ps
3 participants