Skip to content

Commit

Permalink
added documentation for pacman listings (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
herzrasen committed Oct 6, 2019
1 parent 34863c9 commit ff8ab23
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ This will build `pkghist` and install it into your cargo bin directory (usually

## Help
```bash
pkghist 0.3.0
pkghist 0.4.0
Trace package versions from pacman's logfile
USAGE:
pkghist [FLAGS] [OPTIONS] [filter]...
FLAGS:
-x, --exclude If set, every filter result will be excluded.
-h, --help Prints help information
--no-colors Disable colored output
--no-details Only output the package names
Expand All @@ -56,7 +57,7 @@ OPTIONS:
ARGS:
<filter>... Filter the packages that should be searched for. Use regular expressions to specify the exact
pattern to match (e.g. '^linux$' only matches the package 'linux'
pattern to match (e.g. '^linux$' only matches the package 'linux')
```
## Usage
Expand Down Expand Up @@ -129,8 +130,23 @@ This is a little collection of useful regexes that can be used for filtering.
Sometimes using `--exclude` is easier than trying to create an exclusion regex.
## Using pkghist's output as input for pacman
You can use the result of a `pkghist` query as input for pacman.

To create an output in the matching format, use the `--no-colors` and the `--no-details' options in your query.
The following command installs all packages that have been removed after 2019-10-01 12:00.
```bash
sudo pacman -S $(pkghist --no-details --no-colors --removed-only --after "2019-10-01 12:00")
```
The following command removes all packages that have been installed after 2019-10-02 12:00.
```bash
sudo pacman -R $(pkghist --no-details --no-colors --after "2019-10-02 12:00")
```
## Shell completions
`pkghist` creates completion scripts for `bash`, `fish` and `zsh`.
They are created at build time using the great [clap library](https://github.com/clap-rs/clap).
They are created at build time using the great [clap crate](https://github.com/clap-rs/clap).
When installing using `makepkg` (e.g. using the AUR), they are put into the appropriate location.
When installing manually, you may copy them from [the completions directory](./completions) into the appropriate location.
2 changes: 1 addition & 1 deletion completions/_pkghist
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ _pkghist() {
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'::filter -- Filter the packages that should be searched for. Use regular expressions to specify the exact pattern to match (e.g. '^linux$' only matches the package 'linux':_files' \
'::filter -- Filter the packages that should be searched for. Use regular expressions to specify the exact pattern to match (e.g. '^linux$' only matches the package 'linux'):_files' \
&& ret=0

}
Expand Down
2 changes: 1 addition & 1 deletion src/opt/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub fn build_cli() -> App<'static, 'static> {
Arg::with_name("filter")
.help("Filter the packages that should be searched for. \
Use regular expressions to specify the exact pattern to match \
(e.g. '^linux$' only matches the package 'linux'")
(e.g. '^linux$' only matches the package 'linux')")
.multiple(true),
)
}
Expand Down

0 comments on commit ff8ab23

Please sign in to comment.