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

fix: update ci badge #905

Merged
merged 2 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<div align="center" markdown="1">

[![CI](https://github.com/deutsche-nationalbibliothek/pica-rs/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/deutsche-nationalbibliothek/pica-rs/actions/workflows/ci.yml)
[![CI](https://github.com/deutsche-nationalbibliothek/pica-rs/actions/workflows/rust.yml/badge.svg?branch=main)](https://github.com/deutsche-nationalbibliothek/pica-rs/actions/workflows/rust.yml)
[![Documentation](https://img.shields.io/badge/Documentation-main-orange.svg)](https://deutsche-nationalbibliothek.github.io/pica-rs/)
[![dependency status](https://deps.rs/repo/github/deutsche-nationalbibliothek/pica-rs/status.svg)](https://deps.rs/repo/github/deutsche-nationalbibliothek/pica-rs)

Expand Down
1 change: 1 addition & 0 deletions crates/pica-cli/src/commands/frequency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use crate::prelude::*;
/// requires the {}-notation and is expected at the first position (e.g.
/// "044H/*{b == 'GND' && 9?, 9}").
#[derive(Parser, Debug)]
#[clap(visible_alias = "freq")]
pub(crate) struct Frequency {
/// Skip invalid records that can't be decoded as normalized PICA+.
#[arg(long, short)]
Expand Down
20 changes: 20 additions & 0 deletions crates/pica-cli/tests/frequency/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,26 @@ fn frequency_stdout() -> TestResult {
Ok(())
}

#[test]
fn frequency_alias() -> TestResult {
let mut cmd = Command::cargo_bin("pica")?;
let assert = cmd
.args(["freq", "-s", "[email protected]"])
.arg(data_dir().join("algebra.dat"))
.arg(data_dir().join("invalid.dat"))
.arg(data_dir().join("ada.dat"))
.arg(data_dir().join("ada.dat"))
.assert();

assert
.success()
.code(0)
.stdout(predicates::ord::eq("Tp1,2\nTs1,1\n"))
.stderr(predicates::str::is_empty());

Ok(())
}

#[test]
fn frequency_output() -> TestResult {
let mut cmd = Command::cargo_bin("pica")?;
Expand Down
12 changes: 6 additions & 6 deletions docs/book/commands/frequency.qmd
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# frequency {.unnumbered}

Das Kommando `frequency` wird dazu genutzt, um die Häufigkeiten der Werte ein
oder mehrerer Unterfelder zu bestimmen. Ist das zu untersuchende Feld bzw.
Unterfeld wiederholbar, gehen alle Wertausprägungen eines Datensatzes in die
Häufigkeitsverteilung ein. Die Ausgabe erfolgt standardmäßig im CSV-Format. Im
folgenden Beispiel wird die Häufigkeitsverteilung des Unterfelds `[email protected]`
(Satzart) ermittelt:
Das Kommando `frequency` (Alias `freq`) wird dazu genutzt, um die Häufigkeiten
der Werte ein oder mehrerer Unterfelder zu bestimmen. Ist das zu untersuchende
Feld bzw. Unterfeld wiederholbar, gehen alle Wertausprägungen eines Datensatzes
in die Häufigkeitsverteilung ein. Die Ausgabe erfolgt standardmäßig im
CSV-Format. Im folgenden Beispiel wird die Häufigkeitsverteilung des Unterfelds
`[email protected]` (Satzart) ermittelt:

```{.bash}
$ pica frequency -s "[email protected]" DUMP.dat.gz
Expand Down
Loading