PRT(1p) | User Contributed Perl Documentation | PRT(1p) |
prt - Command line frontend of App::PRT
$ prt <command> <args> $ prt <command> <args> <files>
prt is the command line frontend of App::PRT.
Replace "foo" token with "bar".
prt replace_token foo bar
Replace "foo" token with "bar" but target statements must have "bazz" token.
prt replace_token foo bar --in-statement bazz
Rename "Foo" class to "Bar" class.
prt rename_class Foo Bar
Rename "Foo" and "Foo::*" classes to "Bar" and "Bar::*" classes.
prt rename_namespace Foo Bar
Delete "eat" method from "Food" class.
prt delete_method Food eat
Move "method" method in "Class" class to "another_method" method in "AnotherClass". "Class"'s including packages are copied to "AnotherClass".
prt move_class_method 'Class#method' 'AnotherClass#another_method'
Print the variables in the source code. This command accepts input from "STDIN".
prt introduce_variables a.pl cat a.pl | prt introduce_variables pbpaste | prt introduce_variables
You can specify the target files to refactor.
prt replace_token foo bar lib/**/**.pm t/*.t # Refactor Perl modules in lib/ and test files in t/
Without target files, "App::PRT" collects source codes in your project automatically. "App::PRT" searches "cpanfile" to detect project root directory. When executed in git repository, All files in the repository are used.
prt replace_token foo bar # Refactor the project in current working directory
Copyright (C) hitode909.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
hitode909 <hitode909@gmail.com>
2019-01-05 | perl v5.28.1 |