From 739413706550adf5520a2967251d19ae7d16122e Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Thu, 29 Jun 2023 09:23:00 -0600 Subject: [PATCH 1/2] populated toolInfo version --- bin/scip_dart.dart | 11 +++++++++++ lib/src/indexer.dart | 3 ++- lib/src/version.dart | 5 +++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 lib/src/version.dart diff --git a/bin/scip_dart.dart b/bin/scip_dart.dart index fa354392..8fb0a7e6 100644 --- a/bin/scip_dart.dart +++ b/bin/scip_dart.dart @@ -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 main(List args) async { final result = (ArgParser() @@ -21,6 +22,11 @@ Future main(List 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', @@ -28,6 +34,11 @@ Future main(List args) async { )) .parse(args); + if (result['version'] as bool) { + print(scipDartVersion); + exit(0); + } + Flags.instance.init(result); if ((result['path'] as List?)?.isNotEmpty == true) { diff --git a/lib/src/indexer.dart b/lib/src/indexer.dart index ddf6cac6..d5c58732 100644 --- a/lib/src/indexer.dart +++ b/lib/src/indexer.dart @@ -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 indexPackage( String root, @@ -34,7 +35,7 @@ Future indexPackage( textDocumentEncoding: TextEncoding.UTF8, toolInfo: ToolInfo( name: 'scip-dart', - version: '0.0.1', + version: scipDartVersion, arguments: [], ), ); diff --git a/lib/src/version.dart b/lib/src/version.dart new file mode 100644 index 00000000..9f48ea99 --- /dev/null +++ b/lib/src/version.dart @@ -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'; \ No newline at end of file From 6b0643f5aaa37e98f1d3777c1a5cb6da44cbc912 Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Thu, 29 Jun 2023 09:25:29 -0600 Subject: [PATCH 2/2] fmt --- bin/scip_dart.dart | 7 ++----- lib/src/version.dart | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/bin/scip_dart.dart b/bin/scip_dart.dart index 8fb0a7e6..ff375553 100644 --- a/bin/scip_dart.dart +++ b/bin/scip_dart.dart @@ -22,11 +22,8 @@ Future main(List 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' - ) + ..addFlag('version', + defaultsTo: false, help: 'Display the current version of scip-dart') ..addMultiOption( 'path', abbr: 'p', diff --git a/lib/src/version.dart b/lib/src/version.dart index 9f48ea99..ecd0b8d3 100644 --- a/lib/src/version.dart +++ b/lib/src/version.dart @@ -2,4 +2,4 @@ // stored within pubspec.yaml /// The current version of scip_dart -const scipDartVersion = '1.1.1'; \ No newline at end of file +const scipDartVersion = '1.1.1';