funkblubber/bin/main.dart

23 lines
579 B
Dart
Raw Normal View History

2023-01-26 16:35:58 -05:00
import 'dart:core';
2023-02-04 01:48:31 -05:00
import 'package:funkblubber/funkwhale.dart' as funkblubber;
2023-01-26 16:35:58 -05:00
import 'package:funkblubber/console.dart' as console;
2023-02-04 01:48:31 -05:00
import 'package:funkblubber/parser.dart' as parser;
2023-01-26 16:35:58 -05:00
void main(final List<String> arguments) async {
2023-01-31 01:40:30 -05:00
final result = parser.extract(arguments);
if (!result.success) {
2023-02-01 16:30:06 -05:00
console.error("'funkblubber --help' for more");
2023-01-26 16:35:58 -05:00
return;
}
2023-02-01 17:18:06 -05:00
final bool success = await funkblubber.download(
2023-02-01 16:00:23 -05:00
object: result.object!,
path: result.localPath ?? '.',
);
2023-02-01 17:18:06 -05:00
if (!success) {
console.error("couldn't execute request successfully.");
}
2023-01-26 16:35:58 -05:00
}