Skip to content

Commit

Permalink
feat: --list-sources command
Browse files Browse the repository at this point in the history
  • Loading branch information
adamperkowski committed Dec 3, 2024
1 parent 4acd98e commit 442c06f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@

</div>

## WIP
nvrs is still a WIP<br>
new features & bugfixes are being pushed every day

you may encounter some issues. please consider [submitting feedback](https://github.com/adamperkowski/nvrs/issues/new/choose) if you do.

## Features
### [nvchecker](https://github.com/lilydjwg/nvchecker) compatibility
check the [release notes](https://github.com/adamperkowski/nvrs/releases) for compatibility updates
Expand All @@ -35,6 +29,12 @@ check the [release notes](https://github.com/adamperkowski/nvrs/releases) for co
- `github`
- `gitlab` (with custom hosts)

### QOL improvements
- `ALL` argument for the `--take` command
- `--no-fail` flag to prevent exiting on recoverable errors
- `--nuke` command to delete packages from all files
- `--list-sources` command to list all available sources

## Installation
<a href="https://repology.org/project/nvrs/versions"><img align="right" src="https://repology.org/badge/vertical-allrepos/nvrs.svg" alt="Packaging status"></a>

Expand Down
12 changes: 8 additions & 4 deletions man/nvrs.1
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ Comma-separated list of packages to update automatically (use `ALL` for all)
\fB\-n\fR, \fB\-\-nuke\fR \fI<packages>\fR
Comma-separated list of packages to delete from the config

.TP
\fB\-\-no\-fail\fR
Don't exit the program on recoverable errors

.TP
\fB\-\-list\-sources\fR
List available sources

.TP
\fB\-\-config\fR \fI<path>\fR
Override path to the config file
Expand All @@ -34,10 +42,6 @@ Default paths:
.br
\fI./nvrs.toml\fR

.TP
\fB\-\-no\-fail\fR
Don't exit the program on recoverable errors

.TP
\fB\-\-copyright\fR
Display copyright information
Expand Down
17 changes: 14 additions & 3 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,19 @@ pub struct Cli {
)]
pub nuke: Option<Vec<String>>,

#[arg(long, help = "Don't exit on recoverable errors")]
pub no_fail: bool,

#[arg(long, help = "List available sources")]
pub list_sources: bool,

#[arg(
long = "config",
value_name = "path",
help = "Override path to the config file"
)]
pub custom_config: Option<String>,

#[arg(long, help = "Don't exit on recoverable errors")]
pub no_fail: bool,

#[arg(long, help = "Display copyright information")]
copyright: bool,
}
Expand All @@ -68,6 +71,14 @@ pub fn get_args() -> Cli {
"Copyright (c) {} Adam Perkowski\n{}",
current_year, COPYRIGHT_TEXT
);

std::process::exit(0);
} else if cli.list_sources {
for api in nvrs::api::API_LIST {
println!("{}", api.name);
}

std::process::exit(0);
}

cli
Expand Down

0 comments on commit 442c06f

Please sign in to comment.