Skip to content

Commit

Permalink
feat: add walk command (#48)
Browse files Browse the repository at this point in the history
* test: add generic types to infer type

> remove dynamic type

* feat: add recursive function to update file

> add extension on map to update nested keys
> add extension to convert file read as String to Map
> clean up code to edit yaml file

* refactor: add context to thrown errors

> add information to error to give hint to user on what to fix

* test: add tests for recursive function in 39841af

> update tests for refactored code to test via recursive function
> move tests to map extension test file
> add tests for recursively reading nested keys
> add tests for keys created when missing in file

* style: run dart format

* docs: add missing key in example

* test: update test to check for new exception

> check exception matcher one added in 7348ac0

* refactor: make argsChecker class abstract

* refactor: reduce code duplication

> reduce number of classes managing version modifiers
> update code to reflect changes

* refactor: clean-up arg checker class

> make base class abstract
> add custom overrides for subtypes
> update test to to reflect changes

* refactor: replace mixin with handler class

> consolidate file operations and reused properties to one class
> reduce number of inputs from outside the handler

* refactor: create template for handling a command

> reduce code repetition. Move common functionality to super class
> move file I/O inputs to FileHandler a42d8dd
> move core functionality to subclasses with custom implementation

* test: update file handler tests

* refactor: add extended json/yaml support #42

> allow for adding of maps in list
> allow for adding string/lists to map. map will be converted to list
> add support for recursive update of keys within lists
> add support for updates within lists nested in lists

* refactor: add recursive helper class

> add helper function added in 532bb6e to class
> update recursive read to support changed added in 532bb6e

* test: update tests to reflect 532bb6e

> add new tests for new functionality

* style: run dart format

* fix: fix issues with test

> fix bug caught where value returned is not a string but list
> update tests based on changes added in 532bb6e

* fix: fix bug caught in test

> add ignore rest args for set and bump command arg checkers
> add missing override for set command handler

* refactor: clean up code

> reduce constant conversion of file content
> add yml as valid file extension

* style: remove unused file import

* fix: fix bug saving yaml files as json

> remove direct conversion of file to dart map
> add file ouput containing the file as YamlMap from file handler
> remove dead unreferenced code
> update tests to use update file output

* refactor: clean up code

> remove multiple "continue" in loops

* feat(initial): add finder implementation

> add recursive indexer for yaml/json nodes
> add finder that matches based on keys, values or pairs provided
> add data types for indexing & data nodes found based on conditions

* style: run dart format

* fix: ensure length is same in strict order

> add extension method to check for this

* refactor: clean up code

> add hasAny method to iterable
> add minor documentation

* refactor: add support for multi-directory commands

> extend `FileHandler` to support multiple file reads

* test: update `FileHandler` tests based on e1b0105

> add test for reading file from multiple directories

* refactor: clean up code

> abstract finder functionality

* feat: add support for replacer

> add initial `Replacer` implementation
> add `UpdateMode` enum for easy control
> add support for replace and renaming keys in recursive update
> move recursive helpers to own file
> add supporting typedefs for `Replacer` & `Finder`
> clean up code to reflect `UpdateMode` enum changes

* test: update old tests to support Update Enum

* test: add tests for UpdateMode.Replace

> add tests for recursion based on UpdateMode.Replace

* refactor: clean up code

> add equality & hashcode to `NodeData` & `MatchedNodeData` classes
> add collection for equality comparison
> run dart format

* fix: fix bug caught in test

> convert fileAsYamlMap to modifiable map

* fix: fix bug caught in test

> fix typo in prompt requesting file from console

* fix: fix bug caught in test

> fix bug introduced when refactoring code (ref commit 3555e37)

* refactor: code cleaup & improvements

> remove flag from base command
> rename arg checkers to normalizers
> update name changes

* feat: add partial implementation for  new commands

> add normalizers for `find`, `rename` & `replace` commands
> add enums, typedefs & extensions for functionality

* feat: add custom `Replacer`

> add `MagicalReplacer` for values & `MagicalRenamer` for keys
> move implementations to relevant folders

* feat: add custom lightweight pair definition

> add key and value with level and indices pointing to index in list
> port old NodeData object to support functionality

* refactor(initial): extend 676ee02 to existing code

> declutter and revert changes made in e53d8a0 while adding `UpdateMode`
> remove class with static methods in favour of Dart top level functions
> add method to handle UpdateMode.replace on previously indexed map/list
> update `Replacer` & `Finder` to use pair definition (676ee02)
> extende `MatchedNodeData` to provide additional info

* feat(initial): add initial manager implementation

> add `FindManager` & `ReplacerManager` for simple aggregation
> add `TransformTracker` to managers to abstract aggregation progress

* refactor: clean up & optimize code

> simplify pair definition using Dart records
> apply changes to `NodeData` object
>  add method to return shortest key path for recursive rename
>  update replacer to use shortest key path

* fix: fix bugs caught in local test run

> switch to target if path is exhausted and is nested in list
> return modified list at "n" instead of "n+1" when recursing list

* test: add tests reverted in c4df240

> tests in question where reverted when UpdateMode.replace was removed

* refactor: extend Replacer functionality

> reduce code repetition. Return pair used for replacement

* fix: fix pair definition bug 194b9c0

> map key to value instead of calling toString on dart records added in commit

* refactor: make `MatchedNodeData` a subclass of `NodeData`

> remove "composition" allowing `MatchedNodeData` to use important methods available for `NodeData`
> add method to get "path" of node with key & value indices stripped

* feat(initial PoC): add custom printer class for aggregating info

> add utility methods for parsing and creating tree-like view
> make code ready for future extensibility

* refactor: extend custom tracker functionality

> require file index when resetting tracker for better file tracking
> add method to get count using key

* refactor: clean up manager & subclasses

> add `ConsolePrinter` as required arg d9df525
> clean up `FinderManager` &  `ReplacerManager`. Reduce bloated code which made it hard to follow code
> add file number when calling reset in tracker 909ad98
> add initial final touches that makes the managers complete and ready for tests
> customize enums & typedefs for manager use

* chore(deps): bump test from 1.24.9 to 1.25.0 (#47)

Bumps [test](https://github.com/dart-lang/test/tree/master/pkgs) from 1.24.9 to 1.25.0.
- [Release notes](https://github.com/dart-lang/test/releases)
- [Commits](https://github.com/dart-lang/test/commits/test-v1.25.0/pkgs)

---
updated-dependencies:
- dependency-name: test
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: switch to class `PairType`

> replace `Key` & `Value` record with subclasses of `PairType`
> add package Equatable to ease equality comparison. Poor hashing led to test failures despite objects being same.
> refactor `NodeData` to use new pair types
> clean up code references using old `PairType` record

* test: add tests for `MagicalIndexer` class

> update extension tests to use updated `PairType` 4af6107

* refactor: switch to `Equatable`

* refactor: add reusable generic tracker class

> remove bloated narrow class that was hard to customize
> clean up code referencing old generic class

* refactor: simplify generic tracker class f97ad57

> rename appropriately to `Counter` as this reflects functionality
> remove unnecessary `MultiValue` class. Duplicate as simple `Counter` performs same functionality
> add separate counter class that maintains previous counter histories

* refactor: move granular tracking for each value to `Finder` class

> add custom counter to increment using `MatchedNodeData`
> move members to `ValueFinder` subclass.

* refactor: add method to get sum of count in `Counter`

* refactor: add capability to swap map being indexed once complete

> make map member public in `MagicalIndexer`
> move counter history functionality to `Finder` itself. Switch to `CounterWithHistory`

* refactor(initial): clean up `TranformManager` class

> reduce code complexity in favour of granularity
> add `Counter` for keeping track of count of values found in each file
> refine `FinderManager` functionality to queue files & manage Finder. Builds on 8933949 & d3091c5

* fix: fix bug where execution continues after yielding a generator

* refactor(initial): clean up `ReplacerManager`

> clean class and add changes introduced in 629cc95 and any linked commits
> switch to normal list instead of queue to store modified maps
> add docs to `FinderManager` members used in `ReplacerManager`

* refactor: improve printer aggregation

> add method to enable easy access to counter history using cursor & value
> clean code due changes introduced in 629cc95
> add better formatting of info aggregated

* test: add tests for `ValueFinder`

> move tests for `MagicalIndexer` to dedicated folder
> remove print statement in map extension tests

* fix: fixed `Counter` issues caught in tests added in 47f7fe4

> make `Origin` a required parameter as it is always passed in all methods
> prefer a DualKey when adding map entries to preserve hashcode

* fix: fixed `Finder` bugs caught in tests added in 47f7fe4

> add origin when adding entries to `MatchCounter`
> move `MatchCounter` setup to methods called by `Finder.find`
> switch to named constructors in `ValueFinder`

* refactor: add extensible tracker class

> add generic tracker class for reusability
> clean up rigid `Counter` class

* refactor: clean up manager

> split manager to uphold encapsulation
> add custom tracker for Replacer manager thanks to 6aa1486

* refactor: remove unnecessary protected method for creating keys

> remove need for implicit type when creating key

* refactor: add contextual names to replacer subclasses

* feat(WIP):  add modular Formatter in place of ConsolePrinter

> simplify formatter to simply format strings
> explore generics & modularity to ease testing
> clean up utility methods
> add custom Tracker(6aa1486) class for custom functionality

* refactor(WIP): cleanup Managers

> add custom Formatters dd8d15d
> reduce bloated code

* refactor: clean up file handler class

> make static methods a top level function
> remove unnecessary typedefs and annotations

* refactor: remove unused utility methods & classes

> convert static methods to top level function in VersionModifier object
> remove dead code and anti-pattern behavior

* refactor: clean up core functionality code

> clean up ripple effects of a560c88
> optimize existing code
> remove class with static methods in favour of top level functions

* refactor: clean up code

> add context to base generic classes & other classes
> remove dead unused code
> undo unnecessary encapsulation

* refactor: remove unnecessary mutations on targets for replacer

> remove need to indicate if targets are keys/values since each Replacer subclass does that
> remove typedefs

* test: add Replacer tests & helper

* test: update old tests to use latest code refactor

> Refer to commits -> f76f4f1, 4afea55, 6ab2c73

* test: add tests for base `Tracker` class

> rename exception helper to provide more context

* test: add tests from base `Counter` class

* test: add `ReplacerTracker` tests

* fix: fix bug where tracker overwrites first match of a path

> add method on parent Tracker class allowing to check if it contains a value
> not much of a destructive bug, but this would have resulted in wasting additional CPU time updating a path that already exists?
> replace guard clause with `map.putIfAbsent`

* test: add tests for custom tracker used by the `Formatter` class

* refactor: make tracker testable (refer 8ae19f0)

> allow for custom max tolerance injection

* test: add tests for utility methods used by `Formatter` & its subclasses

* refactor: encapsulate formatter functionality

> move formatting method to actual class instead of making it a top level method
> rename file with utility methods for formatter

* test: add tests for `Formatter` and its subclasses

* refactor: add record for storing formatted path info

> remove confusing use of DualTrackerKey
> remove generics bloat which made it hard to understand functionality

* test: update newly added test to match changes in a6067c8

> remove test for DualTrackerKey
> updated tests commit ref: b465b31, 9361917 & 8ae19f0

* refactor: clean up manager classes

> remove static members & factory constructors. Make use of late & named constructors as is.
> make file inputs a generic map instead of a concrete type
> add way of accessing modified files in replacer manager

* refactor: allow option to show progress in FileHandler

* refactor: encapsulate & consolidate core members of manager subtype

> initialize all code within constructor body in ReplacerManager
> A manager just manages the file queue. Most importantly, the FinderManager does the heavy lifting.

* test: add find & replacer manager tests

* feat(WIP): add `walk` command to `mag`

> add find subcommand for find values in yaml/json files
> add rename subcommand for renaming/swapping keys
> add replace subcommand for replacing values
> add handlers for each subcommand

* style: run dart format

* chore: manually bump to WIP dev release

* chore: update changelog for 80044e7

* style: remove reference to console printer

* style: run dart format

* fix: make targets nullable when normalizing arguments for bump subcommand

> allow targets to "prepped" if null

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
kekavc24 and dependabot[bot] authored Feb 4, 2024
1 parent 2eb0ede commit 7513c0a
Show file tree
Hide file tree
Showing 103 changed files with 7,441 additions and 1,941 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ pubspec.lock
doc/api/

# Files generated during & for tests
.vscode/
.test_coverage.dart
coverage/
.test_runner.dart
fake.dart
fake*.dart
fake.yaml
fake.json
mock_data.json
.markdownlint.yaml

# Android studio and IntelliJ
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# 1.1.0-dev.1

* `refactor`: extend existing code with missing functionality. Closes:
* [#42](https://github.com/kekavc24/magical_version_bump/issues/42)
* [#44](https://github.com/kekavc24/magical_version_bump/issues/44)
* [#45](https://github.com/kekavc24/magical_version_bump/issues/45)
* `feat`: add `walk` command with `find`, `rename` and `replace` subcommands.
* `test`: update existing & add new tests.

# 1.0.1

* `refactor` : improve code readability and testability.
Expand Down
2 changes: 1 addition & 1 deletion example/SET_COMMAND.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ root-key:
- Furthermore, make the nested key `nested-key` accept a map of values like so:

```bash
mag modify set --dict "root-key|nested-key=map->value" --add "root-key=anotherMap->value,otherMap->value"
mag modify set --dict "root-key|nested-key=map->value" --add "root-key|nested-key=anotherMap->value,otherMap->value"
```

Updated file will look like so:
Expand Down
3 changes: 2 additions & 1 deletion lib/src/command_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:args/args.dart';
import 'package:args/command_runner.dart';
import 'package:cli_completion/cli_completion.dart';
import 'package:magical_version_bump/src/commands/commands.dart';
import 'package:magical_version_bump/src/commands/walk/walk_command.dart';
import 'package:magical_version_bump/src/version.dart';
import 'package:mason_logger/mason_logger.dart';
import 'package:pub_updater/pub_updater.dart';
Expand Down Expand Up @@ -30,7 +31,6 @@ class MagicalVersionBumpCommandRunner extends CompletionCommandRunner<int> {
argParser
..addFlag(
'version',
abbr: 'v',
negatable: false,
help: 'Print the current version.',
)
Expand All @@ -42,6 +42,7 @@ class MagicalVersionBumpCommandRunner extends CompletionCommandRunner<int> {
// Add sub commands
addCommand(UpdateCommand(logger: _logger, pubUpdater: _pubUpdater));
addCommand(ModifyCommand(logger: _logger));
addCommand(WalkCommand(logger: _logger));
}

@override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,20 @@
import 'dart:io';

import 'package:args/command_runner.dart';
import 'package:magical_version_bump/src/core/command_handlers/command_handlers.dart';
import 'package:magical_version_bump/src/utils/exceptions/command_exceptions.dart';
import 'package:magical_version_bump/src/core/handlers/command_handlers/command_handlers.dart';
import 'package:magical_version_bump/src/utils/exceptions/magical_exception.dart';
import 'package:mason_logger/mason_logger.dart';

/// Abstract command used by all commands. Every command or subcommand will
/// have access to the `request-path` flag & `directory` option.
/// have access to the `request-path` flag
///
/// This class will **ONLY** be extended by commands that :
/// * Have a set of subcommands
/// * Define a set of flags, options or multiOptions accessible only to the
/// command itself or its subcommands.
///
abstract class MagicalCommand extends Command<int> {
MagicalCommand({required this.logger}) {
argParser
..addFlag(
'request-path',
help: 'Prompt for directory to find yaml/json file',
negatable: false,
aliases: ['reqPath'],
)
..addOption(
'directory',
help: 'Directory where to find yaml/json file',
aliases: ['dir'],
defaultsTo: 'pubspec.yaml',
);
}
MagicalCommand({required this.logger});

/// Logger for utility purposes
final Logger logger;
Expand All @@ -37,7 +23,14 @@ abstract class MagicalCommand extends Command<int> {
/// Generic runnable command template. Will be extended by commands or
/// subcommands that are "run"-able.
abstract class RunnableCommand extends MagicalCommand {
RunnableCommand({required super.logger, required this.handler});
RunnableCommand({required super.logger, required this.handler}) {
argParser.addFlag(
'request-path',
help: 'Prompt for directory to find yaml/json file',
negatable: false,
aliases: ['reqPath'],
);
}

/// Each command will always have a handler class with custom logic
final CommandHandler handler;
Expand All @@ -62,3 +55,26 @@ abstract class RunnableCommand extends MagicalCommand {
return ExitCode.success.code;
}
}

/// A command that reads a yaml/json from a single directory
abstract class SingleDirectoryCommand extends RunnableCommand {
SingleDirectoryCommand({required super.logger, required super.handler}) {
argParser.addOption(
'directory',
help: 'Directory where to find yaml/json file',
aliases: ['dir'],
defaultsTo: 'pubspec.yaml',
);
}
}

/// A command that can read yaml/json files from multiple directories
abstract class MultiDirectoryCommand extends RunnableCommand {
MultiDirectoryCommand({required super.logger, required super.handler}) {
argParser.addMultiOption(
'directory',
help: 'Directory where to find yaml/json files',
aliases: ['dir'],
);
}
}
4 changes: 2 additions & 2 deletions lib/src/commands/modify/modify_base_subcommand.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:magical_version_bump/src/commands/base_command.dart';
import 'package:magical_version_bump/src/commands/base_commands.dart';

part 'subcommands/bump_subcommand.dart';
part 'subcommands/set_subcommand.dart';
Expand All @@ -9,7 +9,7 @@ part 'subcommands/set_subcommand.dart';
/// * Allow modification of a single node - `Bump` subcommand
/// * Allow modification of multiple nodes - `Set` subcommand
///
abstract class ModifySubCommand extends RunnableCommand {
abstract class ModifySubCommand extends SingleDirectoryCommand {
ModifySubCommand({required super.logger, required super.handler}) {
argParser
..addOption(
Expand Down
4 changes: 2 additions & 2 deletions lib/src/commands/modify/modify_command.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:magical_version_bump/src/commands/base_command.dart';
import 'package:magical_version_bump/src/commands/base_commands.dart';
import 'package:magical_version_bump/src/commands/modify/modify_base_subcommand.dart';
import 'package:magical_version_bump/src/core/command_handlers/command_handlers.dart';
import 'package:magical_version_bump/src/core/handlers/command_handlers/command_handlers.dart';

/// This command is the base command for all sub-commands that modify 1 or more
/// nodes in the yaml/json file
Expand Down
2 changes: 1 addition & 1 deletion lib/src/commands/update/update_command.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:io';

import 'package:magical_version_bump/src/command_runner.dart';
import 'package:magical_version_bump/src/commands/base_command.dart';
import 'package:magical_version_bump/src/commands/base_commands.dart';
import 'package:magical_version_bump/src/version.dart';
import 'package:mason_logger/mason_logger.dart';
import 'package:pub_updater/pub_updater.dart';
Expand Down
44 changes: 44 additions & 0 deletions lib/src/commands/walk/finders/find_subcommand.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
part of '../walk_base_subcommands.dart';

/// Command for finding keys/values in a yaml/json file
class FindSubCommand extends WalkSubCommand {
FindSubCommand({required super.logger, required super.handler}) {
argParser
..addMultiOption(
'keys',
help: 'Keys to find',
abbr: 'k',
)
..addMultiOption(
'values',
help: 'Values to find',
abbr: 'v',
)
..addMultiOption(
'pairs',
help: 'Key-Value pair to find',
abbr: 'p',
splitCommas: false,
)
..addOption(
'key-order',
help: 'Order based on provided key/values',
aliases: ['ko'],
defaultsTo: 'loose',
allowed: ['loose', 'grouped', 'strict'],
);
// ..addMultiOption(
// 'bounds',
// help: 'Targets to use "aggregate" argument passed',
// abbr: 'b',
// allowed: ['keys', 'values', 'pairs'],
// );
}

@override
String get name => 'find';

@override
String get description =>
'''A subcommand that finds exact values for a key/value in a yaml/json file''';
}
20 changes: 20 additions & 0 deletions lib/src/commands/walk/replacers/rename_subcommand.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
part of '../walk_base_subcommands.dart';

/// Command for replacing values in a yaml/json file
class RenameSubCommand extends ReplacerTemplate {
RenameSubCommand({required super.logger, required super.handler}) {
argParser.addMultiOption(
'keys',
help: 'Keys to find',
abbr: 'k',
splitCommas: false,
);
}

@override
String get name => 'rename';

@override
String get description =>
'''A subcommand that renames a key/list of keys in a yaml/json file''';
}
20 changes: 20 additions & 0 deletions lib/src/commands/walk/replacers/replace_subcommand.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
part of '../walk_base_subcommands.dart';

/// Command for replacing values in a yaml/json file
class ReplaceSubCommand extends ReplacerTemplate {
ReplaceSubCommand({required super.logger, required super.handler}) {
argParser.addMultiOption(
'values',
help: 'Values to find',
abbr: 'v',
splitCommas: false,
);
}

@override
String get name => 'replace';

@override
String get description =>
'''A subcommand that replaces a value/list of values in a yaml/json file''';
}
44 changes: 44 additions & 0 deletions lib/src/commands/walk/walk_base_subcommands.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import 'package:magical_version_bump/src/commands/base_commands.dart';

part 'finders/find_subcommand.dart';
part 'replacers/rename_subcommand.dart';
part 'replacers/replace_subcommand.dart';

/// Base parent for finder and replacer subcommands which has shared properties
abstract class WalkSubCommand extends MultiDirectoryCommand {
WalkSubCommand({required super.logger, required super.handler}) {
argParser
..addOption(
'view-format',
help: 'Output to console based on "walk" output',
aliases: ['vf'],
defaultsTo: 'grouped',
allowed: ['grouped', 'live', 'hide'],
)
..addOption(
'aggregate',
help: 'Type of count to use on "walk"',
abbr: 'a',
defaultsTo: 'all',
allowed: ['all', 'count', 'first'],
)
..addOption(
'limit-to',
help:
'''Denotes upper limit for "aggregate". Requires a numeric value for "count".''',
aliases: ['lmt'],
defaultsTo: '',
);
}
}

/// Base class for replacer command
abstract class ReplacerTemplate extends WalkSubCommand {
ReplacerTemplate({required super.logger, required super.handler}) {
argParser.addMultiOption(
'subtitute',
help: 'Replacement for value(s) provided',
abbr: 's',
);
}
}
48 changes: 48 additions & 0 deletions lib/src/commands/walk/walk_command.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import 'package:magical_version_bump/src/commands/base_commands.dart';
import 'package:magical_version_bump/src/commands/walk/walk_base_subcommands.dart';
import 'package:magical_version_bump/src/core/handlers/command_handlers/command_handlers.dart';
import 'package:magical_version_bump/src/utils/enums/enums.dart';

/// This command is the base command for all commands that "walk" nodes of a
/// yaml/json to read or read & modify it
class WalkCommand extends MagicalCommand {
WalkCommand({required super.logger}) {
addSubcommand(
FindSubCommand(
logger: logger,
handler: HandleFindCommand(logger: logger),
),
);
addSubcommand(
RenameSubCommand(
logger: logger,
handler: HandleReplaceCommand(
logger: logger,
subCommandType: WalkSubCommandType.rename,
),
),
);
addSubcommand(
ReplaceSubCommand(
logger: logger,
handler: HandleReplaceCommand(
logger: logger,
subCommandType: WalkSubCommandType.replace,
),
),
);
}

@override
String get name => 'walk';

@override
String get description =>
'"Walks" to one or more nodes to read or read & modify them in a yaml/json file';

@override
String get invocation => 'mag walk <subcommand> [arguments]';

@override
String get summary => '$invocation\n$description';
}
41 changes: 0 additions & 41 deletions lib/src/core/argument_checkers/arg_checker.dart

This file was deleted.

Loading

0 comments on commit 7513c0a

Please sign in to comment.