Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions bin/scip_dart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:package_config/package_config.dart';
import 'package:pubspec_parse/pubspec_parse.dart';
import 'package:path/path.dart' as p;
import 'package:scip_dart/src/flags.dart';
import 'package:scip_dart/src/version.dart';

Future<void> main(List<String> args) async {
final result = (ArgParser()
Expand All @@ -21,13 +22,20 @@ Future<void> main(List<String> args) async {
defaultsTo: false,
help: 'Whether or not to display debugging text during indexing',
)
..addFlag('version',
defaultsTo: false, help: 'Display the current version of scip-dart')
..addMultiOption(
'path',
abbr: 'p',
help: 'DEPRECATED, has no effect on executed code',
))
.parse(args);

if (result['version'] as bool) {
print(scipDartVersion);
exit(0);
}

Flags.instance.init(result);

if ((result['path'] as List<String>?)?.isNotEmpty == true) {
Expand Down
3 changes: 2 additions & 1 deletion lib/src/indexer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'package:scip_dart/src/flags.dart';
import 'package:scip_dart/src/gen/scip.pb.dart';
import 'package:scip_dart/src/scip_visitor.dart';
import 'package:scip_dart/src/utils.dart';
import 'package:scip_dart/src/version.dart';

Future<Index> indexPackage(
String root,
Expand All @@ -34,7 +35,7 @@ Future<Index> indexPackage(
textDocumentEncoding: TextEncoding.UTF8,
toolInfo: ToolInfo(
name: 'scip-dart',
version: '0.0.1',
version: scipDartVersion,
arguments: [],
),
);
Expand Down
5 changes: 5 additions & 0 deletions lib/src/version.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// This should be kept in sync with the version for scip-dart that is
// stored within pubspec.yaml

/// The current version of scip_dart
const scipDartVersion = '1.1.1';