Skip to content

Commit

Permalink
[ Edit ] added doc coments for commands
Browse files Browse the repository at this point in the history
  • Loading branch information
anasfik committed Dec 6, 2023
1 parent 7df35b3 commit 9f252e6
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
4 changes: 4 additions & 0 deletions lib/src/commands/config_command/config_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import 'package:langsync/src/commands/config_command/sub_commands/create_command
import 'package:langsync/src/commands/config_command/sub_commands/validate_command.dart';
import 'package:mason_logger/mason_logger.dart';

/// {@template config_command}
/// A command to manage LangSync configuration in the current directory.
/// {@endtemplate}
class ConfigCommand extends Command<int> {
/// {@macro config_command}
ConfigCommand({
required Logger logger,
}) : _logger = logger {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import 'package:langsync/src/etc/models/config.dart';
import 'package:langsync/src/etc/networking/client.dart';
import 'package:mason_logger/mason_logger.dart';

/// {@template config_create_command}
/// A command to create a new LangSync configuration file in the current directory.
/// {@endtemplate}
class ConfigCreateCommand extends Command<int> {
/// {@macro config_create_command}
ConfigCreateCommand({
required this.logger,
}) {
Expand Down Expand Up @@ -62,6 +66,7 @@ class ConfigCreateCommand extends Command<int> {
}
}

/// Requests the user to overwrite the already existing config file.
Future<int> _requestToOverwrite(
File file,
ConfigFileController configFileController,
Expand All @@ -87,6 +92,7 @@ class ConfigCreateCommand extends Command<int> {
}
}

/// Prompts the user to create a new config file with the given [configFileController].
Future<int> _promptForConfigFileControllerCreation(
ConfigFileController configFileController,
) async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ import 'package:langsync/src/etc/controllers/config_file.dart';
import 'package:langsync/src/etc/extensions.dart';
import 'package:mason_logger/mason_logger.dart';

/// {@template config_validate_command}
/// A command to validate the existent LangSync configuration file in the current directory.
/// {@endtemplate}
class ConfigValidateCommand extends Command<int> {
ConfigValidateCommand({
required this.logger,
});
/// {@macro config_validate_command}
ConfigValidateCommand({required this.logger});

/// The logger to use.
final Logger logger;

@override
Expand Down Expand Up @@ -77,6 +80,7 @@ class ConfigValidateCommand extends Command<int> {
}
}

/// Returns a [ConfigFileController] from the given [configFiles].
ConfigFileController _controllerFromFile({
required List<FileSystemEntity> configFiles,
}) {
Expand Down
5 changes: 5 additions & 0 deletions lib/src/commands/debug_info/debug_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ import 'package:langsync/src/etc/utils.dart';
import 'package:langsync/src/version.dart';
import 'package:mason_logger/mason_logger.dart';

/// {@template debug_info_command}
/// A command to show some useful info while debugging, this command is made for devlopemnet and it should not appear on production version
/// {@endtemplate}
class DebugInfoCommand extends Command<int> {
/// The logger to use.
final Logger logger;

/// {@macro debug_info_command}
DebugInfoCommand({required this.logger});

@override
Expand Down
5 changes: 5 additions & 0 deletions lib/src/commands/start_command/start_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ import 'package:langsync/src/etc/models/result_locale.dart';
import 'package:langsync/src/etc/networking/client.dart';
import 'package:mason_logger/mason_logger.dart';

/// {@template start_command}
/// The start command, it starts the localization process.
/// {@endtemplate}
class StartCommand extends Command<int> {
/// {@macro start_command}
StartCommand({required this.logger});

/// The logger to use.
final Logger logger;

@override
Expand Down

0 comments on commit 9f252e6

Please sign in to comment.