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

How to use @ARGV instead "magic argv" param in the best way? #140

Open
Mir-ina opened this issue Oct 15, 2020 · 0 comments
Open

How to use @ARGV instead "magic argv" param in the best way? #140

Mir-ina opened this issue Oct 15, 2020 · 0 comments

Comments

@Mir-ina
Copy link

Mir-ina commented Oct 15, 2020

It is a question about commit 31395a9 (HEAD)
Date: Thu Mar 14 19:33:27 2019 +0000

I have a stable script for manipulation with DB versions. It has a user menu (Term::Menu) and it is wrote in this style for run user choice:

if ( $answer eq 'status' ) { DBIx::Class::Migration::Script->run_with_options( schema => Tsystem->model('TsystemDB')->schema, argv => ['status'] ); } elsif ( $answer eq 'prepare' ) { DBIx::Class::Migration::Script->run_with_options( schema => Tsystem->model('TsystemDB')->schema, argv => ['-O', 'prepare'] ); } elsif ( $answer eq 'install' ) { my $version = $prompt->question("Which version to install? "); if ( eval $version ) { DBIx::Class::Migration::Script->run_with_options( schema => Tsystem->model('TsystemDB')->schema, argv => ['install', '--to_version', $version] ); } else { DBIx::Class::Migration::Script->run_with_options( schema => Tsystem->model('TsystemDB')->schema, argv => ['install'] ); } } elsif ( $answer eq 'upgrade' ) { my $version = $prompt->question("Which version upgrade to? "); if ( eval $version ) { DBIx::Class::Migration::Script->run_with_options( schema => Tsystem->model('TsystemDB')->schema, argv => ['upgrade', '--to_version', $version] ); } else { DBIx::Class::Migration::Script->run_with_options( schema => Tsystem->model('TsystemDB')->schema, argv => ['upgrade'] ); } } elsif ( $answer eq 'downgrade' ) { ............

How can I modify my script for new version DBIx::Class::Migration::Script the best way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant