mirror of
https://github.com/nix-community/nurl.git
synced 2024-08-17 05:50:22 +03:00
Revert "remove --list-possible-fetchers since all fetchers are possible"
This reverts commit c854935b1a
.
This commit is contained in:
parent
c854935b1a
commit
946688974f
@ -53,6 +53,7 @@ Options:
|
||||
-O, --overwrite-str <NAME> <STRING> same as --overwrite, but accepts strings instead Nix
|
||||
expressions
|
||||
-l, --list-fetchers List all available fetchers
|
||||
-L, --list-possible-fetchers List all fetchers that can be generated without --fetcher
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
```
|
||||
@ -63,7 +64,7 @@ Options:
|
||||
- `nix-prefetch` relies on FOD which is slow, `nurl` tries to use alternatives when possible.
|
||||
- `nix-prefetch` supports arbitrary expressions (planned for `nurl`) and file attributes.
|
||||
- `nix-prefetch` is more configurable and has an interface similar to `nix-build`.
|
||||
- `nurl` has some nice features dedicated to generated packages (`--indent`, `--list-fetchers`).
|
||||
- `nurl` has some nice features dedicated to generated packages (`--indent`, `--list-possible-fetchers`).
|
||||
|
||||
## Changelog
|
||||
|
||||
|
@ -66,6 +66,10 @@ pub struct Opts {
|
||||
/// List all available fetchers
|
||||
#[arg(short, long, group = "command")]
|
||||
pub list_fetchers: bool,
|
||||
|
||||
/// List all fetchers that can be generated without --fetcher
|
||||
#[arg(short = 'L', long, group = "command")]
|
||||
pub list_possible_fetchers: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, ValueEnum)]
|
||||
|
11
src/main.rs
11
src/main.rs
@ -30,13 +30,12 @@ pub enum GitScheme {
|
||||
fn main() -> Result<()> {
|
||||
let opts = Opts::parse();
|
||||
|
||||
if opts.list_fetchers {
|
||||
if opts.list_fetchers || opts.list_possible_fetchers {
|
||||
let mut out = stdout().lock();
|
||||
for fetcher in FetcherFunction::value_variants()
|
||||
.iter()
|
||||
.filter_map(ValueEnum::to_possible_value)
|
||||
{
|
||||
writeln!(out, "{}", fetcher.get_name())?;
|
||||
for fetcher in FetcherFunction::value_variants() {
|
||||
if let Some(fetcher) = fetcher.to_possible_value() {
|
||||
writeln!(out, "{}", fetcher.get_name())?;
|
||||
}
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user