feat: add cli sample

This commit is contained in:
2021-04-24 22:10:55 +08:00
parent d9772727c9
commit dd0dcae21a
8 changed files with 61 additions and 0 deletions

9
cli_sample/.gitignore vendored Normal file
View File

@@ -0,0 +1,9 @@
# Files and directories created by pub
.dart_tool/
.packages
# Conventional directory for build outputs
build/
# Directory created by dartdoc
doc/api/

3
cli_sample/CHANGELOG.md Normal file
View File

@@ -0,0 +1,3 @@
## 1.0.0
- Initial version, created by Stagehand

5
cli_sample/README.md Normal file
View File

@@ -0,0 +1,5 @@
A sample command-line application with an entrypoint in `bin/`, library code
in `lib/`, and example unit test in `test/`.
Created from templates made available by Stagehand under a BSD-style
[license](https://github.com/dart-lang/stagehand/blob/master/LICENSE).

View File

@@ -0,0 +1,14 @@
# Defines a default set of lint rules enforced for
# projects at Google. For details and rationale,
# see https://github.com/dart-lang/pedantic#enabled-lints.
include: package:pedantic/analysis_options.yaml
# For lint rules and documentation, see http://dart-lang.github.io/linter/lints.
# Uncomment to specify additional rules.
# linter:
# rules:
# - camel_case_types
analyzer:
# exclude:
# - path/to/excluded/files/**

View File

@@ -0,0 +1,5 @@
import 'package:cli_sample/cli_sample.dart' as cli_sample;
void main(List<String> arguments) {
print('Hello world: ${cli_sample.calculate()}!');
}

View File

@@ -0,0 +1,3 @@
int calculate() {
return 6 * 7;
}

14
cli_sample/pubspec.yaml Normal file
View File

@@ -0,0 +1,14 @@
name: cli_sample
description: A sample command-line application.
# version: 1.0.0
# homepage: https://www.example.com
environment:
sdk: '>=2.8.1 <3.0.0'
#dependencies:
# path: ^1.7.0
dev_dependencies:
pedantic: ^1.9.0
test: ^1.14.4

View File

@@ -0,0 +1,8 @@
import 'package:cli_sample/cli_sample.dart';
import 'package:test/test.dart';
void main() {
test('calculate', () {
expect(calculate(), 42);
});
}