Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: command option keep-outdated #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -33,10 +33,10 @@ Compare `.env-target` with `.env.example` and add missing variables to `.env-tar
php ./vendor/bin/env-diff actualize .env.example .env-target
```

If you want to delete outdated values just run command with `-k=false` option.
If you want to remove outdated values just run command with `-r` option.

```
php ./vendor/bin/env-diff actualize -k=false
php ./vendor/bin/env-diff actualize -r
```

### Show differences
10 changes: 5 additions & 5 deletions src/Console/Command/AbstractCommand.php
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ protected function configure()
$this
->addArgument('dist', InputOption::VALUE_REQUIRED, 'From file', Config::DEFAULT_DIST)
->addArgument('target', InputOption::VALUE_REQUIRED, 'To file', Config::DEFAULT_TARGET)
->addOption('keep-outdated', 'k', InputOption::VALUE_OPTIONAL, 'Keep old env variables', true);
->addOption('remove-outdated', 'r', InputOption::VALUE_NONE, 'Remove old env variables');
}

/**
@@ -48,11 +48,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
*/
private function createConfig(InputInterface $input)
{
$dist = $input->getArgument('dist');
$target = $input->getArgument('target');
$keepOutdated = $input->getOption('keep-outdated');
$dist = $input->getArgument('dist');
$target = $input->getArgument('target');
$removeOutdated = $input->getOption('remove-outdated');

return new Config($dist, $target, $keepOutdated);
return new Config($dist, $target, !$removeOutdated);
}

/**