2023-01-26 16:35:58 -05:00
|
|
|
import 'dart:core';
|
|
|
|
|
|
|
|
import 'package:funkblubber/funkblubber.dart' as funkblubber;
|
|
|
|
import 'package:funkblubber/console.dart' as console;
|
2023-01-31 01:40:30 -05:00
|
|
|
import 'package:funkblubber/parsing/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
|
|
|
}
|