-
Notifications
You must be signed in to change notification settings - Fork 37
Implemented initial version of whereis #287
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
Open
spud0
wants to merge
15
commits into
uutils:main
Choose a base branch
from
spud0:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4795d8c
initial commit with some of the starting code and documentation setup…
spud0 3964a74
added whereis and required fields to toml
spud0 55ef839
whereis added to Cargo.lock file
spud0 7369c36
updated Cargo.toml and whereis.md with glob dependency and copy of or…
spud0 0c0a019
added mod_whereis to the tests, and glob to dependencies
spud0 d555e95
completed initial version of whereis utility, and some very primitive…
spud0 543ab63
added TODO about the command line argument parsing, not all arguments…
spud0 7ac6f92
Implemented initial version of whereis utility
spud0 3983bfd
ran cargo fmt and cargo clippy
spud0 bde93c4
fixed the if statement condition with path.contains for readability
spud0 6b8395e
removed inaccurate comment about dig command
spud0 2172d65
changed test for dig to match output of dig, changed test for nmap si…
spud0 3a4f53b
fixed the naming of the constants (MANDIR, etc) to include an undersc…
spud0 77104e0
changed the uppercase enum states to UpperCamelCase and expanded the …
spud0 761ecfd
changed type_of_dir to dir_type for consistency
spud0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| [package] | ||
| name = "uu_whereis" | ||
| version = "0.0.1" | ||
| edition = "2021" | ||
|
|
||
| [lib] | ||
| path = "src/whereis.rs" | ||
|
|
||
| [[bin]] | ||
| name = "whereis" | ||
| path = "src/main.rs" | ||
|
|
||
| [dependencies] | ||
| regex = { workspace = true } | ||
| uucore = { workspace = true } | ||
| clap = { workspace = true } | ||
| serde = { workspace = true } | ||
| serde_json = { workspace = true } | ||
| sysinfo = { workspace = true } | ||
| glob = "0.3" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| // List of directories, man, src, and binary | ||
|
|
||
| pub const MANDIRS: [&str; 7] = [ | ||
| "/usr/man/*", | ||
| "/usr/share/man/*", | ||
| "/usr/X386/man/*", | ||
| "/usr/X11/man/*", | ||
| "/usr/TeX/man/*", | ||
| "/usr/interviews/man/mann", | ||
| "/usr/share/info", | ||
| // NULL | ||
| ]; | ||
|
|
||
| pub const SRCDIRS: [&str; 6] = [ | ||
| "/usr/src/*", | ||
| "/usr/src/lib/libc/*", | ||
| "/usr/src/lib/libc/net/*", | ||
| "/usr/src/ucb/pascal", | ||
| "/usr/src/ucb/pascal/utilities", | ||
| "/usr/src/undoc", | ||
| // NULL | ||
| ]; | ||
|
|
||
| pub const BINDIRS: [&str; 46] = [ | ||
| "/usr/bin", | ||
| "/usr/sbin", | ||
| "/bin", | ||
| "/sbin", | ||
| // #[cfg(...)] | ||
| /* | ||
| #if defined(MULTIARCHTRIPLET) | ||
|
|
||
| "/lib/" MULTIARCHTRIPLET, | ||
| "/usr/lib/" MULTIARCHTRIPLET, | ||
| "/usr/local/lib/" MULTIARCHTRIPLET, | ||
|
|
||
| #endif | ||
| */ | ||
| // #[cfg(not(...))] | ||
| "/usr/lib", | ||
| "/usr/lib32", | ||
| "/usr/lib64", | ||
| "/etc", | ||
| "/usr/etc", | ||
| "/lib", | ||
| "/lib32", | ||
| "/lib64", | ||
| "/usr/games", | ||
| "/usr/games/bin", | ||
| "/usr/games/lib", | ||
| "/usr/emacs/etc", | ||
| "/usr/lib/emacs/*/etc", | ||
| "/usr/TeX/bin", | ||
| "/usr/tex/bin", | ||
| "/usr/interviews/bin/LINUX", | ||
| "/usr/X11R6/bin", | ||
| "/usr/X386/bin", | ||
| "/usr/bin/X11", | ||
| "/usr/X11/bin", | ||
| "/usr/X11R5/bin", | ||
| "/usr/local/bin", | ||
| "/usr/local/sbin", | ||
| "/usr/local/etc", | ||
| "/usr/local/lib", | ||
| "/usr/local/games", | ||
| "/usr/local/games/bin", | ||
| "/usr/local/emacs/etc", | ||
| "/usr/local/TeX/bin", | ||
| "/usr/local/tex/bin", | ||
| "/usr/local/bin/X11", | ||
| "/usr/contrib", | ||
| "/usr/hosts", | ||
| "/usr/include", | ||
| "/usr/g++-include", | ||
| "/usr/ucb", | ||
| "/usr/old", | ||
| "/usr/new", | ||
| "/usr/local", | ||
| "/usr/libexec", | ||
| "/usr/share", | ||
| "/opt/*/bin", | ||
| // NULL | ||
| ]; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| uucore::bin!(uu_whereis); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.