-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accept file paths from CLI arguments, closes #10
Squashed commit of the following: commit e32052e Author: 孙娇 <[email protected]> Date: Wed May 15 23:51:52 2024 +0800 complete commit f4fa97d Merge: c07631a 16e020a Author: 孙娇 <[email protected]> Date: Wed May 15 22:35:17 2024 +0800 Merge branch 'main' into args commit c07631a Merge: ca10e3d 3ecc9c8 Author: 孙娇 <[email protected]> Date: Tue Apr 16 16:15:43 2024 +0800 Merge branch 'main' into args commit ca10e3d Author: 孙娇 <[email protected]> Date: Tue Apr 16 15:39:06 2024 +0800 arg test commit 3d144ac Author: 孙娇 <[email protected]> Date: Mon Apr 15 09:27:42 2024 +0800 add args support
- Loading branch information
Showing
4 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import 'package:args/args.dart'; | ||
|
||
void main([List<String> arguments = const []]) async { | ||
var parser = ArgParser(); | ||
parser.addFlag('hekl', abbr: 'h'); | ||
|
||
arguments.indexWhere((element) => element.startsWith('-')); | ||
|
||
final results = parser.parse(arguments); | ||
|
||
print(results.options.toList()); | ||
print(results.arguments); | ||
print(results.rest); | ||
|
||
print(arguments); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters